/************************************************************************* $Archive: /pacs/OnBoard/pid_ctrl.h $ $Revision: 1.15 $ $Date: 2009/04/23 13:51:12 $ $Author: amazy $ $Log: pid_ctrl.h,v $ Revision 1.15 2009/04/23 13:51:12 amazy 6.029 * * 14 4/23/09 3:46p Pacs1 * 6.029 * * 12 9/10/08 12:05 Amazy * * 11 28/07/08 15:50 Amazy * added QM chopper field plate LUT * * 10 6/04/08 11:45p Amazy * - added a filter to the grating controller * - now resetting ChopperOut in the chopper enable * * 9 6/07/07 11:01a Amazy * v6.018 * * 8 5/31/07 11:27a Amazy * v6.018 * * 7 5/03/07 4:02p Amazy * added thresholds for the FW and an additional parameter to specify the * direction of the move * * 6 2/07/07 11:30a Amazy * - The open loop code for the grating has been updated and validated on * DMC FM with QM grating * - The position limit error is now signaled in the chopper controller * (error code 0x0b15). The position limit * is stored in the field 'scaling' of the chopper pid controller. Its * default value is 0x7FFFFFFF. * * 5 12/01/07 14:49 Amazy * Introduced a filter on the speed in the grating controller. The filter * order is stored in Kf (0 means no filter) * * 51 3/14/06 4:32p Pacs Egse * Version 6.001 * Cleaned and commented *************************************************************************/ #define PID_CTRL_H #define NB_STEPS_IN_PHASE 16384 #define LOG2_NB_STEPS_IN_PHASE 14 #define K_BMASK_NB_STEPS_IN_PHASE 0x3FFF #define MAX_STEPS_IN_PHASE (NB_STEPS_IN_PHASE - 1) #ifndef INCLUDE_DEFINE_ONLY #ifndef CSL_TYPE_H #include "csl_type.h" #endif #ifndef MIM_H #include "mim.h" #endif /* STRUCT: PidControllerParams *************************** AUTHOR: Amazy USE: This is the base structure for all PID controllers */ typedef struct PidControllerParams { int CurrentPosition; //(MP) //HK //these variables are used internaly by the servo ISR int Output; // (OY) //HK int Error; // (ER) //HK int Accumulator; // (IA) //HK int CurrentSetPoint;// (SP) //HK //setpoint generated by the trajectory generator int PidStatus; // (SW) //modified by IRS int ControlWord; // (CW) // to switch on/off the regulation int Target; // (TG) //HK //filled by High Level Command (Move) int TaskStatus; // (TK) //HK /filled by High Level HK routine (copy of PidStatus + check Limits and generate errors) //these variables are accessible through a write command // note : leave these variables in this order int Kp; // (KP) int Ki; // (KI) int Kd; // (KD) int Kf; // (KF) // feed forward int Rate; // (RT) //=setpoint increment at each IRS call. int AccumulatorLimit; // (IL) int OutputLimit; // (OL) int Scaling; // (KC) // DACS = Output << Scaling int ErrorLimit; // (EL) int PosOffset; // (PO) } PidControllerParams; /* STRUCT: GratingControllerParams ******************************* AUTHOR: Amazy USE: This structure contains all variables used by the Grating PID controller */ typedef struct GratingControllerParams { PidControllerParams PidController; int Range; // (GR_RA) int InductosynExcitationAmplitude;//(GR_IND_AMP) int HallSensorsOffset; // (GR_HSO) this is actually an offset int DegModeRate; // (GR_DEG_RT) int DegModeScaling; // (GR_DEG_KC) maximum output voltage // end of variables accessible through the write commands int LaunchLockIsrCounter; // (GR_CO) //counter used for grating launch lock only int DegModeNbStepsForThisMove; // (GR_DEG_NS) int DegModeCurrentStep; // (GR_DEG_IS) int DegModeInitPhasePos; // (GR_DEG_IP) int DegModeCurrentInc; // (GR_DEG_IN) int DegModeIsrCounter; // (GR_DEG_IC) int DegModeOutputPhaseA; // (GR_DEG_OUTA) int DegModeOutputPhaseB; // (GR_DEG_OUTB) int DegModeCurrentPosInPhaseA; // (GR_DEG_CURA) int DegModeIsMoving; // (GR_DEG_MOVE) int NbInterruptsBeforeStoppingOutput; //(GR_NB_STOP) int CurrentNbInterruptsOfMaxOutput; //(GR_CUR_STOP) int MaxOutputLongDuration; //(GR_MAX_OUT_LG) float PrevDerivGratError; //(GR_PREV_DER) int IntFilterN1; // (GR_I_FILT_N1) int IntFilterN2; // (GR_I_FILT_N2) int IntFilterN3; // (GR_I_FILT_N3) int IntFilterD1; // (GR_I_FILT_D1) int IntFilterD2; // (GR_I_FILT_D2) float FloatFilterN1; // (GR_F_FILT_N1) float FloatFilterN2; // (GR_F_FILT_N2) float FloatFilterN3; // (GR_F_FILT_N3) float FloatFilterD1; // (GR_F_FILT_D1) float FloatFilterD2; // (GR_F_FILT_D2) } GratingControllerParams; /* STRUCT: ChopperControllerParams ******************************* AUTHOR: Amazy USE: This structure contains all variables used by the Chopper PID controller */ typedef struct ChopperControllerParams { PidControllerParams PidController; int KiCurr; // (CH_KIC) int SelectFieldPlateLUT; // (CH_SEL_FP_LUT) int Spare; // (CH_SPARE) int IntFilterN1; // (CH_I_FILT_N1) int IntFilterN2; // (CH_I_FILT_N2) int IntFilterN3; // (CH_I_FILT_N3) int IntFilterD1; // (CH_I_FILT_D1) int IntFilterD2; // (CH_I_FILT_D2) int IntInductance; // (CH_I_INDUCTANCE) int IntResistance; // (CH_I_RESISTANCE) int IntControlLoopGain; // (CH_I_CLG) float FloatKp; // (CH_F_KP) float FloatKi; // (CH_F_KI) float FloatKd; // (CH_F_KD) float FloatKf; // (CH_F_KF) float FloatKiCurr; // (CH_F_KIC) float FloatFilterN1; // (CH_F_FILT_N1) float FloatFilterN2; // (CH_F_FILT_N2) float FloatFilterN3; // (CH_F_FILT_N3) float FloatFilterD1; // (CH_F_FILT_D1) float FloatFilterD2; // (CH_F_FILT_D2) float FloatInductance; // (CH_F_INDUCTANCE) float FloatResistance; // (CH_F_RESISTANCE) float FloatControlLoopGain; // (CH_F_CLG) float SineTransitionAmplitude; //(CH_F_SINE_AMP) float SineTransitionPosInArrayIncr; //(CH_F_SINE_INCR) float SineTransitionPosInArrayCurrent;//(CH_F_SINE_CURPOS) float SineTransitionStartSetPoint; //(CH_F_SINE_STARTSET) int OffsetToSelectedLUT; //CH_I_LUT_OFFSET float FmNominalFieldPlateLUT[0x10000]; //CH_FM_N_LUT float FmRedundantFieldPlateLUT[0x10000]; //CH_FM_R_LUT float QmNominalFieldPlateLUT[0x10000]; //CH_QM_N_LUT float QmRedundantFieldPlateLUT[0x10000]; //CH_QM_R_LUT float NoFieldPlateLUT[0x10000]; //CH_F_NO_LUT } ChopperControllerParams; extern int gSinArray[NB_STEPS_IN_PHASE]; extern float gFloatSinArray[NB_STEPS_IN_PHASE]; /* STRUCT: FwControllerParams ************************** AUTHOR: Amazy USE: This structure contains all variables used by the FW controllers */ typedef struct FwControllerParams { int TaskStatus; //(FW_TK) //these variables are accessible through a write command // note : leave these variables in this order int Rate; //(FW_RT) number of interrupt routine execution between 2 steps int Scaling; //(FW_KC) maximum output voltage int SwitchThresholdControlA;//(FW_STA) above this limit, the controller stops sending current in the wheel int SwitchThresholdControlB;//(FW_STB) above this limit, the controller stops sending current in the wheel int SwitchThresholdStatusA; //(FW_ST_STA) above this limit, the fw is considered to be at position int SwitchThresholdStatusB; //(FW_ST_STB) above this limit, the fw is considered to be at position // end of variables accessible through the write commands int NbStepsForThisMove; //(FW_NS) int CurrentStep; //(FW_IS) int InitPhasePos; //(FW_IP) int CurrentInc; //(FW_IN) int SwitchSensorA; //(FW_SSA) int SwitchSensorB; //(FW_SSB) int IsrCounter; //(FW_IC) int OutputPhaseA; //(FW_OUTA) int OutputPhaseB; //(FW_OUTB) int CurrentPosInPhaseA; //(FW_CURA) int CurrentPos; //(FW_CP) (-1 : unknwon, 0: pos A, 1: pos B) int SimulatedSwitchSensorA; //(FW_SIM_SA) int SimulatedSwitchSensorB; //(FW_SIM_SB) } FwControllerParams; /* STRUCT: CsControllerParams ************************** AUTHOR: Amazy USE: This structure contains all variables used by the calibration source controllers */ typedef struct CsControllerParams { int TaskStatus; //(CS_TK) int Output; //(CS_OUT) float Accumulator; //(CS_IA) float Error; //(CS_ER); int Target; //(CS_TG) int PeriodCounter; //(CS_PC); //counts the 500ms periods int Spare2; //(CS_S2); int Spare3; //(CS_S3); int Spare4; //(CS_S4); int Spare5; //(CS_S5); int Spare6; //(CS_S5); int Spare7; //(CS_S5); int Measure1; //(CS_M1) int Measure2; //(CS_M2) int Measure3; //(CS_M3) int Measure4; //(CS_M4) int Measure5; //(CS_M5) int Measure6; //(CS_M6) int Measure7; //(CS_M7) int Measure8; //(CS_M8) //these variables are accessible through a write command // note : leave these variables in this order int Kp; //(CS_KP) the proportional gain of the PI regulator int Ki; //(CS_KI) the integral gain of the PI regulator int MaxAccumulatorLimit; //(CS_MAX_IL) the maximum accumulator value of the PI regulator int MinAccumulatorLimit; //(CS_MIN_IL) the minimum accumulator value of the PI regulator int OutputThreshold; //(CS_OT) if the output is below this limit, we enter the measure only mode where this value is used to make the measure int OutputLimit; //(CS_OL) maximum value of the output int DacOffset; //(CS_DAC_OFFSET) offset added to DAC // end of variables accessible through the write commands int CurrentResistorValue; int Voltage0; int Voltage5neg; int Voltage5pos; int VoltageDacOut; int VoltageSmallGainSensor; int VoltageBigGainSensor; int CurrentSmallGainSensor; int CurrentBigGainSensor; int HkVoltage0; int HkVoltage5neg; //(INDUCT_SIN) int HkVoltage5pos; //(INDUCT_COS) int HkVoltageDacOut; int HkVoltageSmallGainSensor; int HkVoltageBigGainSensor; int HkCurrentSmallGainSensor; int HkCurrentBigGainSensor; int PosVoltage0; int PosVoltage5neg; int PosVoltage5pos; int PosVoltageDacOut; int PosVoltageSmallGainSensor; int PosVoltageBigGainSensor; int PosCurrentSmallGainSensor; int PosCurrentBigGainSensor; int NegVoltage0; int NegVoltage5neg; int NegVoltage5pos; int NegVoltageDacOut; int NegVoltageSmallGainSensor; int NegVoltageBigGainSensor; int NegCurrentSmallGainSensor; int NegCurrentBigGainSensor; } CsControllerParams; extern void InitializeChopperControllerParams(ChopperControllerParams* p_controller); extern void InitializeGratingControllerParams(GratingControllerParams* p_controller); extern void InitializePidControllerParams(PidControllerParams* p_controller); extern void InitializeFwControllerParams(FwControllerParams* p_controller); extern void InitializeCsControllerParams(CsControllerParams* p_controller); extern BOOL EnablePidController(PidControllerParams* p_controller); extern BOOL StartMovingToTarget(PidControllerParams* p_controller, int target); #define IS_PID_ENABLED(gpController) TEST_ONE_BIT(gpController->StatusWord, PID_CTRL_STATUS_PID_ENABLED) #define RESET_INTEGRAL_ACCUMULATOR(gpController) gpController->Accumulator = 0; #endif //INCLUDE_DEFINE_ONLY /*********************************************************************************************/ /* SYMBOLIC CONSTANTS FOR ASM attention should be consistent with PID block declaration in C */ /*********************************************************************************************/ #define MP 0 #define OY 1 #define ER 2 #define IA 3 #define SP 4 #define SW 5 #define CW 6 #define TG 7 #define TK 8 #define KP 9 #define KI 10 #define KD 11 #define KF 12 #define RT 13 #define IL 14 #define OL 15 #define KC 16 #define EL 17 #define PO 18 #define GR_RA 19 #define GR_IND_AMP 20 #define GR_HSO 21 #define GR_DEG_RT 22 #define GR_DEG_KC 23 #define GR_CO 24 #define GR_DEG_NS 25 #define GR_DEG_IS 26 #define GR_DEG_IP 27 #define GR_DEG_IN 28 #define GR_DEG_IC 29 #define GR_DEG_OUTA 30 #define GR_DEG_OUTB 31 #define GR_DEG_CURA 32 #define GR_DEG_MOVE 33 #define GR_NB_STOP 34 #define GR_CUR_STOP 35 #define GR_MAX_OUT_LG 36 #define GR_PREV_DER 37 #define GR_I_FILT_N1 38 #define GR_I_FILT_N2 39 #define GR_I_FILT_N3 40 #define GR_I_FILT_D1 41 #define GR_I_FILT_D2 42 #define GR_F_FILT_N1 43 #define GR_F_FILT_N2 44 #define GR_F_FILT_N3 45 #define GR_F_FILT_D1 46 #define GR_F_FILT_D2 47 #define CH_POS_LIMIT 16 //for chopper, the scaling actually contains the position limit #define CH_KIC 19 #define CH_SEL_FP_LUT 20 #define CH_SPARE 21 #define CH_I_FILT_N1 22 #define CH_I_FILT_N2 23 #define CH_I_FILT_N3 24 #define CH_I_FILT_D1 25 #define CH_I_FILT_D2 26 #define CH_I_INDUCTANCE 27 #define CH_I_RESISTANCE 28 #define CH_I_CLG 29 #define CH_F_KP 30 #define CH_F_KI 31 #define CH_F_KD 32 #define CH_F_KF 33 #define CH_F_KIC 34 #define CH_F_FILT_N1 35 #define CH_F_FILT_N2 36 #define CH_F_FILT_N3 37 #define CH_F_FILT_D1 38 #define CH_F_FILT_D2 39 #define CH_F_INDUCTANCE 40 #define CH_F_RESISTANCE 41 #define CH_F_CLG 42 #define CH_F_SINE_AMP 43 #define CH_F_SINE_INCR 44 #define CH_F_SINE_CURPOS 45 #define CH_F_SINE_STARTSET 46 #define CH_I_LUT_OFFSET 47 #define CH_FM_N_LUT 48 #define CH_FM_N_LUT2 (0x8000 + CH_FM_N_LUT) #define CH_FM_R_LUT (0x10000 + CH_FM_N_LUT) #define CH_FM_R_LUT2 (0x18000 + CH_FM_N_LUT) #define CH_QM_N_LUT (0x20000 + CH_FM_N_LUT) #define CH_QM_N_LUT2 (0x28000 + CH_FM_N_LUT) #define CH_QM_R_LUT (0x30000 + CH_FM_N_LUT) #define CH_QM_R_LUT2 (0x38000 + CH_FM_N_LUT) #define CH_F_NO_LUT (0x40000 + CH_FM_N_LUT) #define CH_F_NO_LUT2 (0x48000 + CH_FM_N_LUT) #define FW_TK 0 #define FW_RT 1 #define FW_KC 2 #define FW_STA 3 #define FW_STB 4 #define FW_ST_STA 5 #define FW_ST_STB 6 #define FW_NS 7 #define FW_IS 8 #define FW_IP 9 #define FW_IN 10 #define FW_SSA 11 #define FW_SSB 12 #define FW_IC 13 #define FW_OUTA 14 #define FW_OUTB 15 #define FW_CURA 16 #define FW_CP 17 #define FW_SIM_SA 18 #define FW_SIM_SB 19 #define CS_TK 0 #define CS_OUT 1 #define CS_IA 2 #define CS_ER 3 #define CS_TG 4 #define CS_PC 5 #define CS_S2 6 #define CS_S3 7 #define CS_S4 8 #define CS_S5 9 #define CS_S6 10 #define CS_S7 11 #define CS_M1 12 #define CS_M2 13 #define CS_M3 14 #define CS_M4 15 #define CS_M5 16 #define CS_M6 17 #define CS_M7 18 #define CS_M8 19 #define CS_KP 20 #define CS_KI 21 #define CS_MAX_IL 22 #define CS_MIN_IL 23 #define CS_OT 24 #define CS_OL 25 #define CS_DAC_OFFSET 26 #define INDUCT_SIN 37 #define INDUCT_COS 38 //************************************************************************** // defines the bits of the command word of the pid controllers (ControlWord) // NOTE : ControlWord is set only by the HLSW and reset (acknowledged by the ISR) //************************************************************************** // definition applicable to all PID //********************************* #define K_BPOS_PID_CTRL_COMMAND_ENABLE_PID 21 #define K_BPOS_PID_CTRL_COMMAND_DISABLE_PID 22 #define K_BPOS_PID_CTRL_COMMAND_ENABLE_COMMUTATION 23 #define K_BPOS_PID_CTRL_COMMAND_DISABLE_COMMUTATION 24 #define K_BPOS_PID_CTRL_COMMAND_MOVE_UP 25 #define K_BPOS_PID_CTRL_COMMAND_MOVE_DOWN 26 #define K_BPOS_PID_CTRL_COMMAND_USE_SYNCHRO 27 #define K_BPOS_PID_CTRL_COMMAND_ENABLE_OPEN_LOOP 30 #define K_BPOS_PID_CTRL_COMMAND_DISABLE_OPEN_LOOP 31 #define K_BMASK_PID_CTRL_COMMAND_ENABLE_PID 0x00200000 #define K_BMASK_PID_CTRL_COMMAND_DISABLE_PID 0x00400000 #define K_BMASK_PID_CTRL_COMMAND_ENABLE_COMMAND 0x00600000 #define K_BMASK_PID_CTRL_COMMAND_ENABLE_COMMUTATION 0x00800000 #define K_BMASK_PID_CTRL_COMMAND_DISABLE_COMMUTATION 0x01000000 #define K_BMASK_PID_CTRL_COMMAND_COMMUTATAION_COMMAND 0x01800000 #define K_BMASK_PID_CTRL_COMMAND_MOVE_UP 0x02000000 #define K_BMASK_PID_CTRL_COMMAND_MOVE_DOWN 0x04000000 #define K_BMASK_PID_CTRL_COMMAND_MOVE_COMMAND 0x06000000 #define K_BMASK_PID_CTRL_COMMAND_USE_SYNCHRO 0x08000000 #define K_BMASK_PID_CTRL_COMMAND_ENABLE_OPEN_LOOP 0x40000000 #define K_BMASK_PID_CTRL_COMMAND_DISABLE_OPEN_LOOP 0x80000000 #define K_BMASK_PID_CTRL_COMMAND_OPEN_LOOP_COMMAND 0xc0000000 //*************************************************************************************************** // defines the bits of the status word of the pid controllers (PidStatus member and TaskStatus in HK) // Note : PidStatus is modified only by the ISR to acknowledge the commands //*************************************************************************************************** // definition applicable to all PID //********************************* #define K_BPOS_PID_CTRL_STATUS_POWER_ON 20 #define K_BPOS_PID_CTRL_STATUS_PID_ENABLED 21 #define K_BPOS_PID_CTRL_STATUS_COMMUTATION_ENABLED 22 #define K_BPOS_PID_CTRL_STATUS_POSITION_ERROR 13 #define K_BPOS_PID_CTRL_STATUS_POWER_LIMIT_ERROR 14 #define K_BPOS_PID_CTRL_STATUS_FOLLOWING_ERROR 15 #define K_BPOS_PID_CTRL_STATUS_MOVING_UP 25 #define K_BPOS_PID_CTRL_STATUS_MOVING_DOWN 26 #define K_BPOS_PID_CTRL_STATUS_USING_SYNCHRO 27 #define K_BMASK_PID_CTRL_STATUS_POWER_ON 0x00100000 #define K_BMASK_PID_CTRL_STATUS_PID_ENABLED 0x00200000 #define K_BMASK_PID_CTRL_STATUS_COMMUTATION_ENABLED 0x00400000 #define K_BMASK_PID_CTRL_STATUS_POSITION_ERROR 0x00002000 #define K_BMASK_PID_CTRL_STATUS_POWER_LIMIT_ERROR 0x00004000 #define K_BMASK_PID_CTRL_STATUS_FOLLOWING_ERROR 0x00008000 #define K_BMASK_PID_CTRL_STATUS_MOVING_UP 0x02000000 #define K_BMASK_PID_CTRL_STATUS_MOVING_DOWN 0x04000000 #define K_BMASK_PID_CTRL_STATUS_MOVING_STATUS 0x06000000 #define K_BMASK_PID_CTRL_STATUS_USING_SYNCHRO 0x08000000 #define K_BMASK_PID_CTRL_STATUS_TO_COPY_IN_TASK 0xFFEB0000 //all these bits can be set by the Pid itself, the remaining bits are set directly in the TaskStatus // definitions specific to grating //******************************** //Grating command word //-------------------- #define K_BPOS_GRAT_CTRL_COMMAND_HOME 28 #define K_BMASK_GRAT_CTRL_COMMAND_HOME 0x10000000 #define K_BPOS_GRAT_CTRL_COMMAND_LOCK_MECHANICAL 1 #define K_BPOS_GRAT_CTRL_COMMAND_UNLOCK_MECHANICAL 3 #define K_BPOS_GRAT_CTRL_COMMAND_LOCK_MECHANICAL2 4 #define K_BPOS_GRAT_CTRL_COMMAND_UNLOCK_MECHANICAL2 5 #define K_BMASK_GRAT_CTRL_COMMAND_LOCK_MECHANICAL 0x00000002 #define K_BMASK_GRAT_CTRL_COMMAND_LOCK_USE_LIMIT_SWITCH 0x00000004 #define K_BMASK_GRAT_CTRL_COMMAND_UNLOCK_MECHANICAL 0x00000008 #define K_BMASK_GRAT_CTRL_COMMAND_LOCK_MECHANICAL2 0x00000010 #define K_BMASK_GRAT_CTRL_COMMAND_UNLOCK_MECHANICAL2 0x00000020 #define K_BMASK_GRAT_CTRL_COMMAND_LOCK 0x0000003E //Grating task status //------------------- #define K_BPOS_GRAT_CTRL_STATUS_LL_SHORT_CIRCUIT 16 #define K_BPOS_GRAT_CTRL_STATUS_LL_MOVING 19 #define K_BPOS_GRAT_CTRL_STATUS_LIMIT_SWITCH 23 #define K_BPOS_GRAT_CTRL_STATUS_DEGRADED_MODE 24 #define K_BPOS_GRAT_CTRL_STATUS_HOMING_IN_PROGRESS 28 #define K_BPOS_GRAT_CTRL_STATUS_HOMING_COMPLETED 29 #define K_BPOS_GRAT_CTRL_STATUS_LL_LOCKED 30 #define K_BPOS_GRAT_CTRL_STATUS_LL_UNLOCKED 31 #define K_BMASK_GRAT_CTRL_STATUS_LL_SHORT_CIRCUIT 0x00010000 #define K_BMASK_GRAT_CTRL_STATUS_LL_MOVING 0x00080000 #define K_BMASK_GRAT_CTRL_STATUS_LIMIT_SWITCH 0x00800000 #define K_BMASK_GRAT_CTRL_STATUS_DEGRADED_MODE 0x01000000 #define K_BMASK_GRAT_CTRL_STATUS_HOMING_IN_PROGRESS 0x10000000 #define K_BMASK_GRAT_CTRL_STATUS_HOMING_COMPLETED 0x20000000 #define K_BMASK_GRAT_CTRL_STATUS_LL_LOCKED 0x40000000 #define K_BMASK_GRAT_CTRL_STATUS_LL_UNLOCKED 0x80000000 //Grating Pid Status //------------------ // Note : the 16 MSb of Pid Status are copied as is in the 16 MSB of the task status // so they use the same definition // The 16 LSb are not copied in the task status and are therefore not reflected in the HK. #define K_BPOS_GRAT_CTRL_STATUS_LOCK_SHORT_CIRCUIT 0 #define K_BPOS_GRAT_CTRL_STATUS_LOCK_MECHANICAL 1 #define K_BPOS_GRAT_CTRL_STATUS_LOCK_USE_LIMIT_SWITCH 2 #define K_BPOS_GRAT_CTRL_STATUS_UNLOCK_MECHANICAL 3 #define K_BMASK_GRAT_CTRL_STATUS_LOCK 0x0000000F //Chopper Pid Status //------------------ #define K_BMASK_CHOP_CTRL_STATUS_OPEN_LOOP 0x00800000 #define K_BPOS_CHOP_CTRL_STATUS_OPEN_LOOP 23 // definitions specific to filter wheels //************************************** //FW task status //-------------- #define K_BPOS_FW_CTRL_STATUS_MOVING 25 #define K_BPOS_FW_CTRL_STATUS_SEARCHING_POS_A 26 #define K_BPOS_FW_CTRL_STATUS_SEARCHING_POS_B 27 #define K_BPOS_FW_CTRL_STATUS_ON_LOCATION_A 28 #define K_BPOS_FW_CTRL_STATUS_ON_LOCATION_B 29 #define K_BPOS_FW_CTRL_STATUS_CMD_THRESHOLD_A 30 #define K_BPOS_FW_CTRL_STATUS_CMD_THRESHOLD_B 31 #define K_BMASK_FW_CTRL_STATUS_MOVING 0x02000000 #define K_BMASK_FW_CTRL_STATUS_SEARCHING_POS_A 0x04000000 #define K_BMASK_FW_CTRL_STATUS_SEARCHING_POS_B 0x08000000 #define K_BMASK_FW_CTRL_STATUS_ON_LOCATION_A 0x10000000 #define K_BMASK_FW_CTRL_STATUS_ON_LOCATION_B 0x20000000 #define K_BMASK_FW_CTRL_STATUS_CMD_THRESHOLD_A 0x40000000 #define K_BMASK_FW_CTRL_STATUS_CMD_THRESHOLD_B 0x80000000 #define K_BMASK_FW_CTRL_STATUS_SENSORS_MASK 0xF0000000 #define K_BMASK_FW_CTRL_STATUS_SENSORS_INVERTED_MASK 0x0FFFFFFF // definitions specific to calibration sources //******************************************** //CS task status //-------------- #define K_BMASK_CS_CTRL_STATUS_USING_BIG_GAIN 0x02000000 #define K_BMASK_CS_CTRL_STATUS_MEASURE_ONLY 0x04000000 /*#define K_BMASK_CS_CTRL_STATUS #define K_BMASK_CS_CTRL_STATUS #define K_BMASK_CS_CTRL_STATUS*/ //Other definitions //----------------- #define K_CS_SIGNAL_CHANGE_OUTPUT_SIGN 1 #define K_CS_SIGNAL_COPY_MEASURE 2 #define K_CS_BIG_GAIN_VALUE_THRESHOLD (64000*256) #define K_CS_SMALL_GAIN_VALUE_THRESHOLD (620*256) #define K_CS_PERIOD_COUNT 40 //definitions specific to SelectControllersMode //********************************************* #define K_BPOS_CTRL_MODE_GRATING 0 #define K_BPOS_CTRL_MODE_CHOPPER 1 #define K_BPOS_CTRL_MODE_FW_SPEC 2 #define K_BPOS_CTRL_MODE_FW_PHOT 3 #define K_BPOS_CTRL_MODE_CS1 4 #define K_BPOS_CTRL_MODE_CS2 5 #define K_BMASK_CTRL_MODE_CS1 0x00000010 #define K_BMASK_CTRL_MODE_CS2 0x00000020