![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
forkd
Fork of LG2 by
host/Source/App/CntrlGLD.h
- Committer:
- Kovalev_D
- Date:
- 2016-02-03
- Revision:
- 23:12e6183f04d4
File content as of revision 23:12e6183f04d4:
#ifndef DEVICE #define DEVICE //e. constants for the piecewise-linear thermocompensation //r. êîíñòàíòû äëÿ êóñî÷íî-ëèíåéíîé òåðìîêîìïåíñàöèè #define TERMO_FUNC_SIZE 14 //e. amount of the points of the table function of thermocompensation //r. êîëè÷åñòâî òî÷åê òàáëè÷íîé ôóíêöèè òåðìîêîìïåíñàöèè #define MAX_ORDER 9 //e. maximal value of order for the thermocompensation coefficients //r. ìàêñèìàëüíàÿ âåëè÷èíà ïîðÿäêà äëÿ êîýôôèöèåíòîâ òåðìîêîìïåíñàöèè #define TSENS_NUMB 4 //e. number of the temperature sensor used for the thermocompensation //r. íîìåð òåðìîäàò÷èêà, èñïîëüçóåìîãî äëÿ êîìïåíñàöèè typedef enum _TERMO_MODE //e. thermocompensation modes //r. ðåæèìû ðàáîòû òåðìîêîìïåíñàöèè { TERMO_OFF, //e. thermocompensation is switched off //r. òåðìîêîìïåíñàöèÿ âûêëþ÷åíà TERMO_ON, //e. thermocompensation is switched on //r. òåðìîêîìïåíñàöèÿ âêëþ÷åíà TERMO_ON_NUMB_OFF, //e. thermocompensation is switched on, number resets (debug mode) //r. òåðìîêîìïåíñàöèÿ âêëþ÷åíà, ÷èñëî çàíóëÿåòñÿ (îòëàäî÷íûé ðåæèì) TERMO_ON_STATIC_ONLY, //e. only static thermocompensation is switched on //r. âêëþ÷åíà òîëüêî ñòàòè÷åñêàÿ òåðìîêîìïåíñàöèÿ TERMO_ON_DYNAMIC_ONLY, //e. only dynamic thermocompensation is switched on //r. âêëþ÷åíà òîëüêî äèíàìè÷åñêàÿ òåðìîêîìïåíñàöèÿ TERMO_ON_STATIC_ONLY_NUMB_OFF, //e. static thermocompensation is switched on, number resets (debug mode) //r. ñòàòè÷åñêàÿ òåðìîêîìïåíñàöèÿâêëþ÷åíà, ÷èñëî çàíóëÿåòñÿ (îòëàäî÷íûé ðåæèì) TERMO_ON_DYNAMIC_ONLY_NUMB_OFF //e. dynamic thermocompensation is switched on, number resets (debug mode) //r. äèíàìè÷åñêàÿ òåðìîêîìïåíñàöèÿâêëþ÷åíà, ÷èñëî çàíóëÿåòñÿ (îòëàäî÷íûé ðåæèì) } TERMO_MODE; typedef enum _WATCH_MODE //e. variants of control points for scope //r. âàðèàíòû êîíòðîëüíûõ òî÷åê äëÿ îñöèëëîãðàôà { VB_DELAY_MEANDER, //e. the delayed on the VB_phs meander //r. çàäåðæàííûé ìåàíäð íà âåëè÷èíó VB_phs VB_PHASE_DETECTOR, //e. output of the PD of the dither drive //r. âûõîä ôàçîâîãî äåòåêòîðà âèþðîïðèâîäà VB_PHASE_DETECTOR_1_SEC, //e. output of integral of the PD of the dither drive for 1 Sec //r. âûõîä èíòåãðàëà ÔÄ âèáðîïðèâîäà çà 1 ñåê VB_INTEGRATOR_40T, //e. output of integral of the PD of the dither drive for 40 periods //r. âûõîä èíòåãðàëà ÔÄ âèáðîïðèâîäà çà 40 ïåðèîäîâ WP_PHASE_DETECTOR //e. output of the PD of the CPLC regulator //r. âûõîä ôàçîâîãî äåòåêòîðà êîíòóðà ÑÐÏ } WATCH_MODE; //e. ===== device operation modes ================================================================ //r. ===== ðåæèìû ðàáîòû ïðèáîðà ================================================================ #define DM_INT_10KHZ_LATCH 1 //e. mode of internal latch 10 kHz //r. ðåæèì âíóòðåííåé çàùåëêè 10 êÃö #define DM_INT_LATCH_DELTA_PS 2 #define DM_INT_LATCH_DELTA_BINS 3 #define DM_EXT_LATCH_DELTA_PS_PULSE 4 //e. mode of external latch with output of the Delta_PS command by pulse //r. ðåæèì âíåøíåé çàùåëêè ñ âûäà÷åé êîìàíäû Delta_PS ïî èìïóëüñó #define DM_EXT_LATCH_DELTA_BINS_PULSE 6 //e. mode of external latch with output of the Delta_BINS command by pulse//r. ðåæèì âíåøíåé çàùåëêè ñ âûäà÷åé êîìàíäû Delta_BINS ïî èìïóëüñó #define DM_EXT_LATCH_DELTA_SF_PULSE 7 //e. mode of Delta Scale factor //r. ðåæèì Delta_SF command //e. *** the BLOCK of VARIABLES, LOADED from FLASH-memory ********************** //r. *** ÁËÎÊ ÏÅÐÅÌÅÍÍÛÕ, ÇÀÃÐÓÆÀÅÌÛÕ èç FLASH-ïàìÿòè ********************** //e. Address (parameter number in the block = 0..255 ) //r. Àäðåñ (Íîìåð ïàðàìåòðà â áëîêå = 0..255) typedef union { int Array[171]; struct { // Device_blk int My_Addres; //e. 0 - device own address //r.0 - ñîáñòâåííûé àäðåñ óñòðîéñòâà //e. =============== parameters of HFO regulator =============== //r. =============== ïàðàìåòðû êîíòóðà Â× ãåíåðàòîðà íàêà÷êè =============== int HF_ref; //e. 1 - value of the reference //r. 1 - çíà÷åíèå îïîðû int HF_scl; //e. 2 - the gain factor (1.15) //r. 2 - êîýôôèöèåíò ïåðåäà÷è (1.15) int HF_min; //r. 3 - ìèíèìóì âûõîäíîãî çíà÷åíèÿ íà ÖÀÏå ðåãóëÿòîðà (ñîîòâåòñòâóåò ìàêñèì. íàïðÿæåíèþ íà ÃÂ×) int HF_max; //e. 4 - maximum of the output value on the regulator DAC (appropriate to minimal voltage on the HFO) //r. 4 - ìàêñèìóì âûõîäíîãî çíà÷åíèÿ íà ÖÀÏå ðåãóëÿòîðà (ñîîòâåòñòâóåò ìèíèì. íàïðÿæåíèþ íà ÃÂ×) //e. =============== parameters of the regulator of the DS power regulator ========== //r. =============== ïàðàìåòðû êîíòóðà ðåãóëèðîâàíèÿ ìîùíîñòè ÄÓÏ ========== int RI_ref; //e. 5 - value of the reference //r. 5 - çíà÷åíèå îïîðû int RI_scl; //e. 6 - the gain factor (1.15) //r. 6 - êîýôôèöèåíò ïåðåäà÷è (1.15) //e. =============== parameters of the CPLC regulator ===== //r. =============== ïàðàìåòðû êîíòóðà ñòàáèëèçàöèè ðàáî÷åãî ïåðèìåòðà (ÑÐÏ) ===== int WP_ref; //e. 7 - value of the reference //r. 7 - çíà÷åíèå îïîðû int WP_scl; //e. 8 - the gain factor (1.15) //r. 8 - êîýôôèöèåíò ïåðåäà÷è (1.15) int WP_mdy; //e. 9 - value of the reset delay //r. 9 - çíà÷åíèå çàäåðæêè ñáðîñà int WP_rup; //e. 10 - upper value of DAC adjustment (appropriate to minimal voltage on the heater) //r. 10 - âåðõíåå çíà÷åíèå ðåãóëèðîâêè ÖÀÏ (ñîîòâåòñòâóåò ìèíèì. íàïðÿæåíèþ íà íàãðåâàòåëå) int WP_rdw; //e. 11 - lower value of the DAC adjustment (appropriate to maximal voltage on the heater) //r. 11 - âåðõíåå çíà÷åíèå ðåãóëèðîâêè ÖÀÏ (ñîîòâåòñòâóåò ìàêñèì. íàïðÿæåíèþ íà íàãðåâàòåëå) //e. =============== parameters of the dither drive regulator of the GLD ==================== //r. =============== ïàðàìåòðû êîíòóðà âèáðîïðèâîäà ÃËÄ ==================== int VB_phs; //e. 12 - the phase delay parameter of the dither drive PLL //r. 12 - ïàðàìåòð Phase_çàä. ÑÐ× âèáðîïðèâîäà int VB_scl; //e. 13 - the gain factor (1.15) of the dither drive PLL //r. 13 - êîýôôèöèåíò ïåðåäà÷è (1.15) ÑÐ× âèáðîïðèâîäà unsigned int VB_N; //e. 14 - divider for dither drive period (defines dither period) //r. 14 - êîýôô.äåëåíèÿ N âèáðîïðèâîäà (ïåðèîä êîëåáàíèé) ÂÏ unsigned int VB_Nmin; //e. 15 - minimum of the output value of the oscillation period regulator //r. 15 - ìèíèìóì âûõîäíîãî çíà÷åíèÿ ðåãóëÿòîðà ïåðèîäà unsigned int VB_Nmax; //e. 16 - maximum of the output value of the oscillation period regulator //r. 16 - ìàêñèìóì âûõîäíîãî çíà÷åíèÿ ðåãóëÿòîðà ïåðèîäà int VB_Fdf_Hi; //e. 17 - adjusted output frequency (H) //r. 17 - çàäàííàÿ ÷àñòîòà ðàñùåïëåíèÿ (H) unsigned int VB_Fdf_Lo; //e. 18 - (L) (double precision) //r. 18 - (L) (äâîéíàÿ òî÷íîñòü) int VB_Fsc; //e. 19 - the gain factor of the frequency regulator //r. 19 - êîýôôèöèåíò ïåðåäà÷è ðåãóëÿòîðà ÷àñòîòû ðàñùåïëåíèÿ unsigned int VB_Tmin; //e. 20 - the gain factor of the frequency regulator //r. 19 - êîýôôèöèåíò ïåðåäà÷è ðåãóëÿòîðà ÷àñòîòû ðàñùåïëåíèÿ unsigned int VB_Tmax; //e. 21 - maximum of the output value of the regulator //r. 21 - ìàêñèìóì âûõîäíîãî çíà÷åíèÿ ðåãóëÿòîðà Tau unsigned int VB_tau; //e. 22 - pulse width of the dither drive (without noise)//r. 22 - äëèòåëüíîñòü èìïóëüñà âèáðîïðèâîäà (äî îøóìëåíèÿ) int VBN_Tzd; //e. 23 - adjusted noise period //r. 23 - çàäàííûé ïåðèîä îøóìëåíèÿ int VBN_Ran; //e. 24 - range of the random component of noise //r. 24 - äèàïàçîí ñëó÷àéíîé ñîñòàâëÿþùåé îøóìëåíèÿ VBN_Tsl int VBN_k; //e. 25 - adjusted noise constant //r. 25 - çàäàííàÿ êîíñòàíòà îøóìëåíèÿ //e. =============== parameters of processing of accurate data ============= //r. =============== ïàðàìåòðû îáðàáîòêè òî÷íîñòíîé èíôîðìàöèè ============= int PI_Fsc; //_ //e. 26 - the S_ds scale parameter //r. 26 - ìàñøòàáíûé êîýôôèöèåíò Säóï int PI_Fb0; //_ //e. 27 - the B_ds zero shift of the DS //r. 27 - ñìåùåíèå íóëÿ ÄÓÏà Bäóï int PI_scl; //_ //e. 28 - the Scale scale coefficient of the gyro //r. 28 - ìàñøòàáíûé êîýôô. ãèðîñêîïà Scale int PI_bia; //_ //e. 29 - the Bias zero shift of the gyro //r. 29 - ñìåùåíèå íóëÿ ãèðîñêîïà Bias //e. =============== coefficients of the temperature correction ================= //r. =============== êîýôôèöèåíòû òåìïåðàòóðíîé êîððåêöèè ================= int PI_a0; //_ // 30 int PI_a1; //_ // 31 int PI_a2; //_ // 32 int PI_a3; //_ // 33 int PI_a4; //_ // 34 int PI_a5; //_ // 35 int PI_a6; //_ // 36 int PI_b1; //_ // 37 int PI_b2; //_ // 38 int PI_b3; //_ // 39 int PI_b4; //_ // 40 int PI_b5; //_ // 41 int PI_b6; //_ // 42 //e. =============== parameters of normalization of the temperature sensors ============= //r. =============== ïàðàìåòðû íîðìèðîâêè äàò÷èêîâ òåìïåðàòóðû ============= int Tmp_bias[6]; //_ //e. 43 - an array of shifts of the 0..5 temperature sensors //r. 43 - ìàññèâ ñäâèãîâ òåìïåðàòóðíûõ äàò÷èêîâ 0..5 int Tmp_scal[6]; //_ //e. 49 - an array of the scale coefficients of temperature sensors//r. 49 - ìàññèâ ìàñøòàáíûõ ê-òîâ òåìïåðàòóðíûõ äàò÷èêîâ int WP_reset; //e. 55 - initial position of the CPLC regulator (after reset) //r. 55 - èñõîäíîå ïîëîæåíèå ðåãóëÿòîðà ÑÐÏ (ïîñëå ñáðîñà) //e. ================ gain factor of photodetector channels =========== //r. ================ ê-ò óñèëåíèÿ êàíàëîâ ôîòîïðèåìíèêà =========== unsigned int Gain_Ph_A; //e. 56 - initial gain factor of the A channel of photodetector //r. 56 - íà÷àëüíûé ê-ò óñèëåíèÿ êàíàëà À ôîòîïðèåìíèêà unsigned int Gain_Ph_B; //e. 57 - initial gain factor of the B channel of photodetector //r. 57 - íà÷àëüíûé ê-ò óñèëåíèÿ êàíàëà B ôîòîïðèåìíèêà //e. =============== switch of the source of loading GLD variables block === //r. =============== ïåðåêëþ÷àòåëü èñòî÷íèêà çàãðóçêè áëîêà ïåðåìåííûõ ÃËÄ (ãàëî÷êà â íàñòîðîå÷íîé ïðîãðàììå) int Header_Word; //e. 58 - flash sector validity header //r. 58 - çàãîëîâîê-êëþ÷ ê èíäèêàòîðó èñòî÷íèêà çàãðóçêè int LoadFlash_enable; //e. 59 - source loading flag: 1 - load from the flash //r. 59 - ïðèçíàê èñòî÷íèêà çàãðóçêè: 1 - ãðóçèòüñÿ èç flesh //e. 0 - load default parameters (factory) //r. 0 - ãðóçèòü ïàðàìåòðû ïî óìîë÷àíèþ (çàâîäñêèå) unsigned int Device_SerialNumber; //e. 60 - serial number of the device //r. 60 - ñåðèéíûé íîìåð ïðèáîðà int Reserved0; //e. 61 - not used TERMO_MODE TermoMode; //e 62 - device operation mode (with thermocompenstion, without it, debug )//r. 62 - ðåæèì ðàáîòû ïðèáîðà (ñ òåðìîêîìïåíñàöèåé, áåç íåå èëè îòëàäêà) //e. addition for the piecewise-linear termocorrection //r. äîáàâëåíèå äëÿ êóñî÷íî-ëèíåéíîé òåðìîêîððåêöèè int TemperInt[TERMO_FUNC_SIZE]; //e. 63 float TermoFunc[TERMO_FUNC_SIZE]; //e. 77 int WP_reset2; //e. 91 - voltages of CPLC regulator reset at cooling //r. xx - íàïðÿæåíèÿ îáíóëåíèÿ êîíòóðà ÑÐÏ ïðè îõëàæäåíèè //e. parameters setting termocompensation parameters in dynamics (at heating and cooling) //r. ïàðàìåòðû, çàäàþùèå ïàðàìåòðû òåðìîêîìïåíñàöèè â äèíàìèêå (ïðè íàãðåâå è îõëàæäåíèè) float Reserved1; //e. 92 - not used float Reserved2; //e. 93 - not used int K_vb_tu; //e. 94 - slope of dependence of the VB_N division factor from temperature (as though Hz/degree, but in relative units ) //r. êðóòèçíà çàâèñèìîñòè êîýôôèöèåíòà äåëåíèÿ VB_N îò òåìïåðàòóðû (êàê áû Ãö/ãðàäóñ, íî â ó.å.) int TemperNormal; //e. 95 -temperature for which the VB_N division factor of the dither drive is set //r. òåìïåðàòóðà, äëÿ êîòîðîé çàäàí êîýôôèöèåíò äåëåíèÿ âèáðîïðèâîäà VB_N int K_WP_rst_heating; //r. 96 - êðóòèçíà çàâèñèìîñòè íàïðÿæåíèÿ îáíóëåíèÿ ïðè íàãðåâàíèè îò òåìïåðàòóðû (êàê áû âîëüò/ãðàäóñ, íî â ó.å. ÖÀÏ è òåðìîäàò÷èêîâ ) int K_WP_rst_cooling; //e. 97 - slope of dependence of a reset voltage at cooling from temperature (as though Volt/degree, but in relative units of DAC and temperature sensors) //r. êðóòèçíà çàâèñèìîñòè íàïðÿæåíèÿ îáíóëåíèÿ ïðè îõëàæäåíèè îò òåìïåðàòóðû (êàê áû âîëüò/ãðàäóñ, íî â ó.å. ÖÀÏ è òåðìîäàò÷èêîâ ) int WP_transition_step; //e. 98 - step of change of a heater voltage at resetting //r. øàã èçìåíåíèÿ íàïðÿæåíèÿ íàãðåâàòåëÿ ïðè âûïîëíåíèè îáíóëåíèÿ int Reserved3; // e. 99 -not used int HF_scl_2; //r. 100 - êîýôôèöèåíò ïåðåäà÷è (1.15) êîíòóðà ÃÂ× ïðè îáíóëåíèè int TemperIntDyn[TERMO_FUNC_SIZE]; //e. 114 - float ThermoHeatDelta[TERMO_FUNC_SIZE]; //e. 128 - int DeltaTempRecalc; //r. 129 - òåìïåðàòóðíûé èíòåðâàë ïåðåñ÷åòà äèíàìè÷. êîìïåíñàöèè (â ó.å.) //e. temperature delta for dynamic thermocompensation recalculation(in relative units) int TemperCoolIntDyn[TERMO_FUNC_SIZE]; // e. 143 - float ThermoCoolDelta[TERMO_FUNC_SIZE]; //e. 157 - } Str; } TDEVICE_BLK; //e. ************ end of the BLOCK of VARIABLES, LOADED from FLASH-memory ************ //r. ************ êîíåö áëîêà çàãðóæàåìûõ èç ôëýø-ïàìÿòè ïàðàìåòðîâ ÃËÄ ************ extern TDEVICE_BLK Device_blk; //e. the BLOCK of VARIABLES, LOADED from FLASH-memory //r. ÁËÎÊ ÏÅÐÅÌÅÍÍÛÕ, ÇÀÃÐÓÆÀÅÌÛÕ èç FLASH-ïàìÿòè extern int Device_Mode; extern unsigned Valid_Data; extern unsigned ser_num; extern int VB_Nmin0; //r. ìèíèìóì âûõîäíîãî çíà÷åíèÿ ðåãóëÿòîðà ïåðèîäà äëÿ òåìïåðàòóðû Device_blk.TemperNormal extern int VB_Nmax0; //r. ìàêñèìóì âûõîäíîãî çíà÷åíèÿ ðåãóëÿòîðà ïåðèîäà äëÿ òåìïåðàòóðû Device_blk.TemperNormal extern unsigned BIT_number; extern unsigned Is_BIT; extern unsigned start_Rq; //r. çàïðîñ íà çàïóñê ïðèáîðà extern unsigned stop_Rq; //r. çàïðîñ íà îñòàíîâ ïðèáîðà extern unsigned pulse_Rq; //r. çàïðîñ íà ïîäæèã ëàçåðà //r. *** Ïðèáîðíûå ïàðàìåòðû ïî óìîë÷àíèþ *** #define DEVICE_SN 1 //r. ñåðèéíûé íîìåð ïðèáîðà = 01 #define My_Addres_const 0 //r. - ñîáñòâåííûé àäðåñ óñòðîéñòâà //r. ====== ïàðàìåòðû êîíòóðà Â× ãåíåðàòîðà íàêà÷êè =============== #define HF_REF_CONST 15080 //r. 1 - çíà÷åíèå îïîðû #define HF_SCL_CONST 1 //r. 2 - êîýôôèöèåíò ïåðåäà÷è (1.15) #define HF_MIN_CONST -32668 //r. 3 - ìèíèìóì âûõîäíîãî çíà÷åíèÿ íà ÖÀÏå ðåãóëÿòîðà (ñîîòâåòñòâóåò ìàêñèì. íàïðÿæåíèþ íà ÃÂ×) #define HF_MAX_CONST -17379 //r. 4 - ìàêñèìóì âûõîäíîãî çíà÷åíèÿ íà ÖÀÏå ðåãóëÿòîðà (ñîîòâåòñòâóåò ìèíèì. íàïðÿæåíèþ íà ÃÂ×) #define HFO_SHIFT 16 //r. ÷èñëî ðàçðÿäîâ äðîáíîé ÷àñòè â 32-õáèòîâîé ïåðåìåííîé hf_reg32 //r. ====== ïàðàìåòðû êîíòóðà ñòàáèëèçàöèè ðàáî÷åãî ïåðèìåòðà (ÑÐÏ) ===== #define WP_REF_CONST 5 //r. 7 - çíà÷åíèå îïîðû #define WP_SCL_CONST 5 //r. 8 - êîýôôèöèåíò ïåðåäà÷è (1.15) #define WP_MDY_CONST 30 //r. 9 - çíà÷åíèå çàäåðæêè ñáðîñà #define WP_RUP_CONST 31936 //r. 10 - íèæíåå çíà÷åíèå ðåãóëèðîâêè ÖÀÏ (ñîîòâåòñòâóåò ìèíèì. íàïðÿæåíèþ íà íàãðåâàòåëå) #define WP_RDW_CONST 11801 //r. 11 - âåðõíåå çíà÷åíèå ðåãóëèðîâêè ÖÀÏ (ñîîòâåòñòâóåò ìàêñèì. íàïðÿæåíèþ íà íàãðåâàòåëå) //r. =============== ïàðàìåòðû êîíòóðà âèáðîïðèâîäà ÃËÄ ==================== #define VB_PHS_CONST 4 //r. 12 - ïàðàìåòð Phase_çàä. ÑÐ× âèáðîïðèâîäà #define VB_SCL_CONST 1024 //r. 13 - êîýôôèöèåíò ïåðåäà÷è (1.15) ÑÐ× âèáðîïðèâîäà #define T_VIB_START 16600 //r. 14 - êîýôô.äåëåíèÿ N âèáðîïðèâîäà (ïåðèîä êîëåáàíèé) ÂÏ //r. _VB_N íà÷àëüíûé ïåðèîä êîëåáàíèé âèáðîïðèâîäà (406Hz-18916, 17067 - 450Hz) #define T_VIB_DELTA 1000 //r. äèàïàçîí èçìåíåíèÿ ïåðèîäà êîëåáàíèé âèáðîïðèâîäà (~ +/- 10 Hz) #define VB_NMIN_CONST 12080 //r. 15 - ìèíèìóì âûõîäíîãî çíà÷åíèÿ ðåãóëÿòîðà ïåðèîäà #define VB_NMAX_CONST 64000 //r. 16 - ìàêñèìóì âûõîäíîãî çíà÷åíèÿ ðåãóëÿòîðà ïåðèîäà #define VB_FDF_HI_CONST 3 //r. 17 - çàäàííàÿ ÷àñòîòà ðàñùåïëåíèÿ (H) #define VB_FDF_LO_CONST 0 //r. 18 - (L) (äâîéíàÿ òî÷íîñòü) #define VB_FSC_CONST -2000 //r. 19 - êîýôôèöèåíò ïåðåäà÷è ðåãóëÿòîðà ÷àñòîòû ðàñùåïëåíèÿ #define VB_TMIN_CONST 100 //r. 20 - ìèíèìóì âûõîäíîãî çíà÷åíèÿ ðåãóëÿòîðà Tau #define VB_TMAX_CONST 10022 //r. 21 - ìàêñèìóì âûõîäíîãî çíà÷åíèÿ ðåãóëÿòîðà Tau #define L_VIB_START 5120 //r. 22 - äëèòåëüíîñòü èìïóëüñà âèáðîïðèâîäà (äî îøóìëåíèÿ) //r. _VB_tau íà÷àëüíàÿ äëèòåëüíîñòü èìïóëüñà âèáðîïðèâîäà #define VBN_TZD_CONST 500 //r. 23 - çàäàííûé ïåðèîä îøóìëåíèÿ (êîíñòàíòà ïîëüçîâàòåëÿ) #define VBN_RAN_CONST 400 //r. 24 - äèàïàçîí ñëó÷àéíîé ñîñòàâëÿþùåé îøóìëåíèÿ VBN_Tsl #define VBN_K_CONST 7000 //r. 25 - çàäàííàÿ êîíñòàíòà îøóìëåíèÿ (êîíñòàíòà ïîëüçîâàòåëÿ) //r. =============== ïàðàìåòðû êîíòóðà ðåãóëèðîâàíèÿ ìîùíîñòè ÄÓÏ ========== #define RI_REF_CONST 25600 //r. 5 - çíà÷åíèå îïîðû #define RI_SCL_CONST 0 //r. 6 - êîýôôèöèåíò ïåðåäà÷è (1.15) //r. =============== ïàðàìåòðû îáðàáîòêè òî÷íîñòíîé èíôîðìàöèè ============= #define PI_FSC_CONST 128 //r. 26 - ìàñøòàáíûé êîýôôèöèåíò Säóï #define PI_FB0_CONST 0 //r. 27 - ñìåùåíèå íóëÿ ÄÓÏà Bäóï #define PI_SCL_CONST 256 //r. 28 - ìàñøòàáíûé êîýôô. ãèðîñêîïà Scale #define PI_BIA_CONST 0 //r. 29 - ñìåùåíèå íóëÿ ãèðîñêîïà Bias //r. =============== êîýôôèöèåíòû òåìïåðàòóðíîé êîððåêöèè ================= #define PI_A0_CONST 0 // 30 #define PI_A1_CONST 0 // 31 #define PI_A2_CONST 0 // 32 #define PI_A3_CONST 0 // 33 #define PI_A4_CONST 0 // 34 #define PI_A5_CONST 0 // 35 #define PI_A6_CONST 0 // 36 #define PI_B1_CONST 0 // 37 #define PI_B2_CONST 0 // 38 #define PI_B3_CONST 0 // 39 #define PI_B4_CONST 0 // 40 #define PI_B5_CONST 0 // 41 #define PI_B6_CONST 0 // 42 #define TMP_SCALE 0x4000 // 43 - 54 Tmp_bias[6]; Tmp_scal[6] #define TMP_BIAS 0 #define WP_RESET_CONST 7360 // 55 #define WP_RESET2_CONST 29216 #define WP_TRANS_STEP 32767 //r. ================ íà÷àëüíûé ê-ò óñèëåíèÿ êàíàëîâ ôîòîïðèåìíèêà =========== #define G_PHOTO_STRA 60 // 56 #define G_PHOTO_STRB 60 // 57 //r. =============== ïåðåêëþ÷àòåëü èñòî÷íèêà çàãðóçêè áëîêà ïåðåìåííûõ ÃËÄ === #define HEADER_WORD_CONST 0x55aa //r. 58 - çàãîëîâîê-êëþ÷ ê èíäèêàòîðó èñòî÷íèêà çàãðóçêè #define DITHER_REG_PERIOD 40 //r. ïåðèîä ðåãóëèðîâàíèÿ âèáðîïðèîäà (â ïåðèîäàõ âèáðîïðèâîäà) #define PLC_RESET_THRESHOLD (-3276) //r. ñîîòâåòñòâóåò íàïðÿæåíèþ +1.2 âîëüòà //r. ìèí.äîïóñòèìàÿ ÷àñòîòà ðàñùåïëåíèÿ, ïðè êîò. äàííûå ñ÷èòàþòñÿ äîñòîâåðíûìè #define F_RAS_MIN 10000 //r. ìèíèìàëüíàÿ ÷àñòîòà ðàñùåïëåíèÿ ïðè ñòàðòå #define F_OUT_MIN (5000>>4) // 5000 Ãö / 16 #define F_OUT_NORM (70000>>4) // 90000 Ãö / 16 #define F_OUT_MAX (300000>>4) // 300000 Ãö / 16 #define Set_LightUp LPC_GPIO0->FIOSET = (1<<4) //set light up signal #define Reset_LightUp LPC_GPIO0->FIOCLR = (1<<4) //reset light up signal //r. êîíñòàíòû äëÿ êóñî÷íî-ëèíåéíîé òåðìîêîìïåíñàöèè #define TERMO_FUNC_SIZE 14 //r. êîëè÷åñòâî òî÷åê òàáëè÷íîé ôóíêöèè òåðìîêîìïåíñàöèè #define MAX_ORDER 9 //r. ìàêñèìàëüíàÿ âåëè÷èíà ïîðÿäêà äëÿ êîýôôèöèåíòîâ òåðìîêîìïåíñàöèè #define TSENS_NUMB 4 //r. íîìåð òåðìîäàò÷èêà, èñïîëüçóåìîãî äëÿ êîìïåíñàöèè #define VALID_START_4SEC 3 //r. âðåìÿ ïîñëå ñòàðòà, êîãäà òåìïåðàòóðà ñòàëà äîñòîâåðíîé #define N_START_MAX 1 // 4 //r. ÷èñëî ïîïûòîê çàïóñêà ïðèáîðà #define LIGHT_UP_PULSE_WDTH 5000 //1000 //e. width of light-up pulse = 100 msec #define LIGHT_UP_PAUSE 1000 //e. pause after light-up = 100 msec #define LIGHT_UP_POLLING 10000 //e. time of waiting laser generation = 1 sec // Status word errors bits #define OUT_FREQ_ERROR 0x8000 #define DITH_FREQ_ERROR 0x4000 #define HFO_VOLT_ERROR 0x2000 #define THERMO_RANGE_ERROR 0x1000 #define THERMO_DIFF_ERROR 0x0800 #define TS_MIN -2500 // minimal temperature for our thermal sensors #define TS_MAX +13000 // maximal temperature for our thermal sensors #define TS_DIFF_MAX 1300 // maximal difference between 2 thermal sensors #define HFO_NEG_MIN 8738 // -4.5 V #define HFO_NEG_MAX 25122 // -10.5 V #define HFO_POZ_MIN -32221 // +10.5 V #define HFO_POZ_MAX -15837 // +4.5 V //e. ================ bits of the main register (_RgConA) of GLD control ============== //r. ================ áèòû îñíîâíîãî ðåãèñòðà óïðàâëåíèÿ GLD (_RgConA) =============== //e. ================ (bits of the status register) ============================ //r. ================ (îíè æå - áèòû ðåãèñòðà ñîñòîÿíèÿ) ============================ #define LASER_ON 0x0001 //r. âêë./âûêë. ãåíåðàöèþ ëàçåðà #define HF_REG_ON 0x0002 //r. âêë./âûêë. êîíòóð ÃÂ× #define RI_REG_ON 0x0004 //r. âêë./âûêë. êîíòóð ìîùíîñòè ÄÓÏ #define WP_REG_ON 0x0008 //r. ìàñêà âêë./âûêë. êîíòóðà ÑÐÏ #define WP_SIN_ON 0x0010 //r. âêë./âûêë. ïîèñêîâûé ñèãíàë ÑÐÏ #define VB_TAU_ON 0x0020 //r. âêë./âûêë. êîíòóð àìïëèòóäû âèáðîðèâîäà #define VB_FREQ_ON 0x0040 //r. âêë./âûêë. êîíòóð ÷àñòîòû âèáðîïðèâîäà #define GLD_ON 0x0080 //r. âêë./âûêë. âåñü ÃËÄ // Status word errors bits #define OUT_FREQ_ERROR 0x8000 #define DITH_FREQ_ERROR 0x4000 #define HFO_VOLT_ERROR 0x2000 #define THERMO_RANGE_ERROR 0x1000 #define THERMO_DIFF_ERROR 0x0800 #define loop_is_closed(loop_bit) ((RgConA & (loop_bit)) == loop_bit) #define close_loop(loop_bit) RgConA |= loop_bit #define open_loop(loop_bit) RgConA &= ~(loop_bit) //r. âûêëþ÷èòü âñå êîíòóðà ðåãóëèðîâàíèÿ #define open_all_loops() RgConA = 0 #define close_all_loops() RgConA = 0xFFFF extern unsigned SRgR; //r.ñèñòåìíîãî ðåãèñòðà ðåæèìà ïëàòû ADSP extern unsigned RgConA; //r. îñíîâíîé ðåãèñòð óïðàâëåíèÿ óñòðîéñòâà extern unsigned RgConB; //r. äîïîëíèòåëüíûé ðåãèñòð óïðàâëåíèÿ //extern unsigned Copy_e5_RgR; //r. êîïèÿ ðåãèñòðà ðåæèìà ïëàòû E5 //extern unsigned Copy_e5_RgRA; //r. êîïèÿ äîïîëíèòåëüíîãî ðåãèñòðà ðåæèìà E5 void contrl_GLD(void); #endif