#define FAUCON using System; using Microsoft.SPOT; namespace CPF { class configFile { //Instrument dependent values #if(FAUCON) //Use this one for at sea deployments public const double SOSetBellowsPosition = 42.0; public const double ABSetBellowsPosition = 20.0; //Use this one for quick turnarounds during develoment //public const double SOSetBellowsPosition = 58.5; public const double cn0254CH1Offset = 0; public const double bellowsLowerLimit = 16.5; public const double bellowsUpperLimit = 44.1; #else //Use this one for at sea deployments public const double SOSetBellowsPosition = 65.0; //Use this one for quick turnarounds during develoment //public const double SOSetBellowsPosition = 58.5; public const double cn0254CH1Offset = 0; public const double bellowsLowerLimit = 23.9; public const double bellowsUpperLimit = 69.9; #endif //Values that change often static public readonly TimeSpan preMissionDelayTimeout = new TimeSpan(0, 0, 20); static public readonly TimeSpan surfaceOpsTimeout = new TimeSpan(0, 15, 0); public static double lowerDescendBellowsLimit = bellowsLowerLimit + 3.0; public static double upperDescendBellowsLimit = bellowsUpperLimit - 3.0; public const int anchorPressureCountThreshold = 4; public const double anchorPressureMinimum = 4.0; public const double anchorPressureVarianceLimit = 0.01; public const double exitAnchorPressureThreshold = 5.0; //State timeout values static public readonly TimeSpan RunEngrTestTimeout = new TimeSpan(0, 2, 0, 0); static public readonly TimeSpan InitializeMissionTimeout = new TimeSpan(0, 3, 0); static public readonly TimeSpan InitializeProfileTimeout = new TimeSpan(0, 1, 0); static public readonly TimeSpan SOSetBellowsTimeout = new TimeSpan(0, 10, 0); static public readonly TimeSpan ABSetBellowsTimeout = new TimeSpan(0, 20, 0); static public readonly TimeSpan ABRetractTimeout = new TimeSpan(0, 20, 0); static public readonly TimeSpan descendTimeout = new TimeSpan(0, 25, 0); static public readonly TimeSpan startCPModeTimeout = new TimeSpan(0, 15, 0); static public readonly TimeSpan dumpCPDataTimeout = new TimeSpan(0, 15, 0); static public readonly TimeSpan deAnchorTimeout = new TimeSpan(0, 20, 0); static public readonly TimeSpan ascendTimeout = new TimeSpan(1, 0, 0); static public readonly TimeSpan EATimeout = new TimeSpan(500, 0, 0); //static public readonly TimeSpan surfaceTimeout = 300000; static public readonly TimeSpan timeoutDefaultPeriod = new TimeSpan(0, 0, 10); //Time to delay after starting CP mode static public readonly TimeSpan cpDelay = new TimeSpan(0, 0, 20); //SBE41 stuff public const int SBE41SamplePeriod = 3000; //msec public const double maxPressure = 120.0; //dBar public static TimeSpan SMSleepPeriod = new TimeSpan(0, 0, 0, 0, SBE41SamplePeriod); //msec //Buoyancy control holdVelocity constants public const double KPlatVel = 80.0, //Constant for P term of PID TiPlatVel = 50000.0, // Time constant for I term of PID (in denominator, bigger values less I term in output TdPlatVel = 10.0, // Time constant for D term of PID TfPlatVel = 2.0, // Derivative filter time constant TtPlatVel = 100.0, // Anti-windup time constant BPlatVel = 1.0, // Setpoint weight uLowPlatVel = -3000.0 / 60.0, // minimum possible output (RPS) uHighPlatVel = 3000.0 / 60.0, // maximum possible output (RPS) hPlatVel = SBE41SamplePeriod / 1000.0; // Sample period (seconds) //Pump motor encoder counts per revolution public const double COUNTSperREV = 500.0 * 4.0; //500 Counts per Revolution *4 for quadrature interpolation //autoballast (AB) stuff public const int ABSetBellowsJV = 20000; public const int ABRetractJV = 5000; public const double ABVelocityThreshold = -0.02; public const double ABDepthThreshold = 0.2; //ADC stuff public const int aducEnqueueDecimator = 15; public const double minBatteryBusVolts = 26.0; public const int ADCSamplePeriod = 3000; //public const int PTHSamplePeriod = 300000; public const int PTHSamplePeriod = 60000; //calculated from MTS C-Series position sensor data sheet public const double cn0254CH0Scale = 22.81250; public const double cn0254CH0Offset = -2.28125; //CH1 scale and offset calculated from SPICE model of resistor divider and ADC analog front end public const double cn0254CH1Scale = 8.87; //Calculated from current monitor and DC/DC converter data sheets public const double cn0254CH2Scale = 1.667; public const double cn0254CH2Offset = 0.0; public const double cn0254CH3Scale = 2.5; public const double cn0254CH3Offset = 0.0; public const double cn0254CH4Scale = 2.5; public const double cn0254CH4Offset = 0.0; //RecoverMode (RM) stuff public const double RMSetBellowsPosition = bellowsUpperLimit - 1.0; //Buoyancy control stuff public const double surfacePressure = 0.35; public const int SOSetBellowsJV = 40000; //Anchor stuff public const double deanchorVelocityThreshold = 0.007; public const int deanchorJV = 10000; //nudge control bands public const double OB = 2; //"outer band" in meters public const double IB = 0.75; //"inner band" in meters public const double approachVel = 0.01; //FLBB Stuff public static int flbbPkt = 2; public static int flbbAve = 3; //SBE41 stuff public const int cpPressureCutoff = 2; //CP mode stops below this pressure in deciBars public const int cpRunPumpTime = 2; //run the pump for this many seconds before starting CP mode public static bool CPMode = true; //Puts SBE41 in CP mode during ascend state only //Buoyancy control holdDepth constants public const double KDepth = 0.6, //Constant for P term of PID TiDepth = 1000000.0, // Time constant for I term of PID (in denominator, bigger values less I term in output TdDepth = 0.2, // Time constant for D term of PID TfDepth = 2.0, // Derivative filter time constant TtDepth = 1000000.0, // Anti-windup time constant BDepth = 1.0, // Setpoint weight uLowDepth = -3000.0 / 60.0, // minimum possible output (RPS) uHighDepth = 3000.0 / 60.0, // maximum possible output (RPS) hDepth = SBE41SamplePeriod / 1000.0; // Sample period (seconds) } }