![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
forkd
Fork of LGstaandart by
Diff: vibro.h
- Revision:
- 231:079835d508ef
- Parent:
- 226:4a4d5bd5fcd7
- Child:
- 232:130a2b5003e6
--- a/vibro.h Tue Jan 09 13:25:45 2018 +0000 +++ b/vibro.h Thu Jan 25 13:59:43 2018 +0000 @@ -78,7 +78,7 @@ #define LedON Gyro.PinReg |= PinRegBitLED; //установить бит светодиода в "1" #define StartBackLight 0xf -#define StartDischarg 0xc +#define StartDischarg 0x2 #define PinRegBitTXE (1<<5) #define PinRegBitLED (1<<4) @@ -134,12 +134,231 @@ //unsigned int DeltaEXT_Event; // вывод параметров типа Rate по внешней защелке. //unsigned int B_Delta_EventEXT;// вывод параметров типа Rate по внешней защелке.(надо чтоб от одного влага было, как Event_500Hz) + + + +typedef struct { + union { + float StaticTermoCorr_Temp_Arr[14]; + struct { + float TermoTempStatic_0; + float TermoTempStatic_1; + float TermoTempStatic_2; + float TermoTempStatic_3; + float TermoTempStatic_4; + float TermoTempStatic_5; + float TermoTempStatic_6; + float TermoTempStatic_7; + float TermoTempStatic_8; + float TermoTempStatic_9; + float TermoTempStatic_10; + float TermoTempStatic_11; + float TermoTempStatic_12; + float TermoTempStatic_13; + } Str; + }TermoTempStatic; + + union { + float StaticTermoCorr_Delta_Arr[14]; + struct { + float TermoDeltaStatic_0; + float TermoDeltaStatic_1; + float TermoDeltaStatic_2; + float TermoDeltaStatic_3; + float TermoDeltaStatic_4; + float TermoDeltaStatic_5; + float TermoDeltaStatic_6; + float TermoDeltaStatic_7; + float TermoDeltaStatic_8; + float TermoDeltaStatic_9; + float TermoDeltaStatic_10; + float TermoDeltaStatic_11; + float TermoDeltaStatic_12; + float TermoDeltaStatic_13; + } Str; + + } TermoDeltaStatic; + } TermCorS; + +extern TermCorS TermoCorrStatic; + +//TermoCorrSatatic.TermoTempStatic.StaticTermoCorr_Temp_Arr[14]; +//TermoCorrSatatic.TermoTempStatic.Str.TermoTempStatic_0; + +//TermoCorrSatatic.TermoDeltaStatic.StaticTermoCorr_Delta_Arr[14]; +//TermoCorrSatatic.TermoDeltaStatic.Str.TermoDeltaStatic_0; + + +typedef struct { + union { + float DynamicTermoCorr_Temp_Arr[14]; + struct { + float TermoTempDynamic_0; + float TermoTempDynamic_1; + float TermoTempDynamic_2; + float TermoTempDynamic_3; + float TermoTempDynamic_4; + float TermoTempDynamic_5; + float TermoTempDynamic_6; + float TermoTempDynamic_7; + float TermoTempDynamic_8; + float TermoTempDynamic_9; + float TermoTempDynamic_10; + float TermoTempDynamic_11; + float TermoTempDynamic_12; + float TermoTempDynamic_13; + } Str; + }TermoTempDynamic; + + union { + float DynamicTermoCorr_Delta_Arr[14]; + struct { + float TermoDeltaDynamic_0; + float TermoDeltaDynamic_1; + float TermoDeltaDynamic_2; + float TermoDeltaDynamic_3; + float TermoDeltaDynamic_4; + float TermoDeltaDynamic_5; + float TermoDeltaDynamic_6; + float TermoDeltaDynamic_7; + float TermoDeltaDynamic_8; + float TermoDeltaDynamic_9; + float TermoDeltaDynamic_10; + float TermoDeltaDynamic_11; + float TermoDeltaDynamic_12; + float TermoDeltaDynamic_13; + } Str; + } TermoDeltaDynamic; + } TermCorD; + +extern TermCorD TermoCorrDynamic; + + +//TermoCoreDynamic.TermoTempDynamic.DynamicTermoCorr_Temp_Arr[14]; +//TermoCoreDynamic.TermoTempDynamic.Str.TermoTempDynamic_0; + + +//TermoCoreDynamic.TermoDeltaDynamic.DynamicTermoCorr_Delta_Arr[14]; +//TermoCoreDynamic.TermoDeltaDynamic.Str.TermoDeltaDynamic_0; + + + + + + + + + + typedef struct _Gyro { - + unsigned int T4; + + unsigned int T5; + unsigned int TemperNewData; + unsigned int NP; + unsigned int ParamFlag; + int DeltaT4; + int DeltaT5; + + int TermoModT4; + int TermoModT5; + int TermoModSum; + int TermoMod; + + int TermoModAdd; + + + int TermoCompensDelta0; + int TermoCompensDelta1; + int TermoCompensDelta2; + int TermoCompensDelta3; + int TermoCompensDelta4; + int TermoCompensDelta5; + int TermoCompensDelta6; + int TermoCompensDelta7; + int TermoCompensDelta8; + int TermoCompensDelta9; + int TermoCompensDelta10; + int TermoCompensDelta11; + int TermoCompensDelta12; + int TermoCompensDelta13; + + /* float FloatTermoCompensDelta0; + float FloatTermoCompensDelta1; + float FloatTermoCompensDelta2; + float FloatTermoCompensDelta3; + float FloatTermoCompensDelta4; + float FloatTermoCompensDelta5; + float FloatTermoCompensDelta6; + float FloatTermoCompensDelta7; + float FloatTermoCompensDelta8; + float FloatTermoCompensDelta9; + float FloatTermoCompensDelta10; + float FloatTermoCompensDelta11; + float FloatTermoCompensDelta12; + float FloatTermoCompensDelta13;*/ + + + unsigned int TermoCompensTemp0; + unsigned int TermoCompensTemp1; + unsigned int TermoCompensTemp2; + unsigned int TermoCompensTemp3; + unsigned int TermoCompensTemp4; + unsigned int TermoCompensTemp5; + unsigned int TermoCompensTemp6; + unsigned int TermoCompensTemp7; + unsigned int TermoCompensTemp8; + unsigned int TermoCompensTemp9; + unsigned int TermoCompensTemp10; + unsigned int TermoCompensTemp11; + unsigned int TermoCompensTemp12; + unsigned int TermoCompensTemp13; + + + + + + + + unsigned int TimeToJump; //5 unsigned int JumpDelta; + unsigned int Termodata0; + unsigned int Termodata1; + unsigned int Termodata2; + unsigned int Termodata3; + unsigned int Termodata4; + unsigned int Termodata5; + unsigned int Termodata6; + unsigned int Termodata7; + unsigned int Termodata8; + unsigned int Termodata9; + unsigned int Termodata10; + unsigned int Termodata11; + unsigned int Termodata12; + unsigned int Termodata13; + unsigned int Termodata14; + unsigned int Termodata15; + unsigned int Termodata16; + unsigned int Termodata17; + unsigned int Termodata18; + unsigned int Termodata19; + unsigned int Termodata20; + unsigned int Termodata21; + unsigned int Termodata22; + unsigned int Termodata23; + unsigned int Termodata24; + unsigned int Termodata25; + unsigned int Termodata26; + unsigned int Termodata27; + + int AnglaOut; + + + int CurTermoCompens; + int AngelCompens; unsigned int ShowMod2; int Debag; int Debag2; @@ -290,6 +509,7 @@ unsigned int LaserOn; unsigned int EXT_Latch; //69 } GyroT, *Gyro_p; + extern GyroT Gyro; typedef union { @@ -374,50 +594,51 @@ unsigned int TermoMode; //62 серийный номер прибора -unsigned int a36; //63 -unsigned int a37; //64 -unsigned int a38; //65 -unsigned int a39; //66 -unsigned int a40; //67 -unsigned int a41; //68 -unsigned int a42; //69 -unsigned int a43; //70 -unsigned int a44; //71 -unsigned int a45; //72 -unsigned int a46; //73 -unsigned int a47; //74 -unsigned int a48; //75 -unsigned int a49; //76 -unsigned int a50; //77 -unsigned int a51; //78 -unsigned int a52; //79 -unsigned int a53; //80 -unsigned int a54; //81 -unsigned int a55; //82 должен быть на 31 -unsigned int a56; //83 -unsigned int a57; //84 -unsigned int a58; //85 -unsigned int a59; //86 -unsigned int a60; //87 -unsigned int a61; //88 -unsigned int a62; //89 -unsigned int a63; //90 -unsigned int a64; //91 -unsigned int a65; //92 -unsigned int a66; //93 -unsigned int a67; //94 -unsigned int a68; //95 -unsigned int a69; //96 -unsigned int a70; //97 -unsigned int a71; //98 -unsigned int a72; //99 -unsigned int a73; //100 -unsigned int a74; //101 -unsigned int a75; //102 -unsigned int a76; //103 -unsigned int a77; //104 +unsigned int TStatic_0; //63 +unsigned int TStatic_1; //64 +unsigned int TStatic_2; //65 +unsigned int TStatic_3; //66 +unsigned int TStatic_4; //67 +unsigned int TStatic_5; //68 +unsigned int TStatic_6; //69 +unsigned int TStatic_7; //70 +unsigned int TStatic_8; //71 +unsigned int TStatic_9; //72 +unsigned int TStatic_10; //73 +unsigned int TStatic_11; //74 +unsigned int TStatic_12; //75 +unsigned int TStatic_13; //76 - unsigned int /*RLC;*/ResetLevelCool; //105 временно должен быть на 39 +unsigned int TermoDeltaStatic_0; //77 +unsigned int TermoDeltaStatic_1; //78 +unsigned int TermoDeltaStatic_2; //79 +unsigned int TermoDeltaStatic_3; //80 +unsigned int TermoDeltaStatic_4; //81 +unsigned int TermoDeltaStatic_5; //82 +unsigned int TermoDeltaStatic_6; //83 +unsigned int TermoDeltaStatic_7; //84 +unsigned int TermoDeltaStatic_8; //85 +unsigned int TermoDeltaStatic_9; //86 +unsigned int TermoDeltaStatic_10; //87 +unsigned int TermoDeltaStatic_11; //88 +unsigned int TermoDeltaStatic_12; //89 +unsigned int TermoDeltaStatic_13; //90 +unsigned int TermoDeltaStatic_14; //91 +unsigned int TermoDeltaStatic_15; //92 +unsigned int TermoDeltaStatic_16; //93 +unsigned int TermoDeltaStatic_17; //94 +unsigned int TermoDeltaStatic_18; //95 +unsigned int TermoDeltaStatic_19; //96 +unsigned int TermoDeltaStatic_20; //97 +unsigned int TermoDeltaStatic_21; //98 +unsigned int TermoDeltaStatic_22; //99 +unsigned int TermoDeltaStatic_23; //100 +unsigned int TermoDeltaStatic_24; //101 +unsigned int TermoDeltaStatic_25; //102 +unsigned int TermoDeltaStatic_26; //103 +unsigned int TermoDeltaStatic_27; //104 + +unsigned int /*RLC;*/ResetLevelCool; //105 временно должен быть на 39 unsigned int a79; //106 unsigned int a80; //107 @@ -447,51 +668,51 @@ unsigned int TSHeat12; //129 unsigned int TSHeat13; //130 -unsigned int TermoDataHeat0; //131 -unsigned int TermoDataHeat1; //132 -unsigned int TermoDataHeat2; //133 -unsigned int TermoDataHeat3; //134 -unsigned int TermoDataHeat4; //135 -unsigned int TermoDataHeat5; //136 -unsigned int TermoDataHeat6; //137 -unsigned int TermoDataHeat7; //138 -unsigned int TermoDataHeat8; //139 -unsigned int TermoDataHeat9; //140 -unsigned int TermoDataHeat10; //141 -unsigned int TermoDataHeat11; //142 -unsigned int TermoDataHeat12; //143 -unsigned int TermoDataHeat13; //144 -unsigned int TermoDataHeat14; //145 -unsigned int TermoDataHeat15; //146 -unsigned int TermoDataHeat16; //147 -unsigned int TermoDataHeat17; //148 -unsigned int TermoDataHeat18; //149 -unsigned int TermoDataHeat19; //150 -unsigned int TermoDataHeat20; //151 -unsigned int TermoDataHeat21; //152 -unsigned int TermoDataHeat22; //153 -unsigned int TermoDataHeat23; //154 -unsigned int TermoDataHeat24; //155 -unsigned int TermoDataHeat25; //156 -unsigned int TermoDataHeat26; //157 -unsigned int TermoDataHeat27; //158 +unsigned int TermoDynamicDataHeat0; //131 +unsigned int TermoDynamicDataHeat1; //132 +unsigned int TermoDynamicDataHeat2; //133 +unsigned int TermoDynamicDataHeat3; //134 +unsigned int TermoDynamicDataHeat4; //135 +unsigned int TermoDynamicDataHeat5; //136 +unsigned int TermoDynamicDataHeat6; //137 +unsigned int TermoDynamicDataHeat7; //138 +unsigned int TermoDynamicDataHeat8; //139 +unsigned int TermoDynamicDataHeat9; //140 +unsigned int TermoDynamicDataHeat10; //141 +unsigned int TermoDynamicDataHeat11; //142 +unsigned int TermoDynamicDataHeat12; //143 +unsigned int TermoDynamicDataHeat13; //144 +unsigned int TermoDynamicDataHeat14; //145 +unsigned int TermoDynamicDataHeat15; //146 +unsigned int TermoDynamicDataHeat16; //147 +unsigned int TermoDynamicDataHeat17; //148 +unsigned int TermoDynamicDataHeat18; //149 +unsigned int TermoDynamicDataHeat19; //150 +unsigned int TermoDynamicDataHeat20; //151 +unsigned int TermoDynamicDataHeat21; //152 +unsigned int TermoDynamicDataHeat22; //153 +unsigned int TermoDynamicDataHeat23; //154 +unsigned int TermoDynamicDataHeat24; //155 +unsigned int TermoDynamicDataHeat25; //156 +unsigned int TermoDynamicDataHeat26; //157 +unsigned int TermoDynamicDataHeat27; //158 unsigned int Step; //159 -unsigned int TSCool0; //160 -unsigned int TSCool1; //161 -unsigned int TSCool2; //162 -unsigned int TSCool3; //163 -unsigned int TSCool4; //164 -unsigned int TSCool5; //165 -unsigned int TSCool6; //166 -unsigned int TSCool7; //167 -unsigned int TSCool8; //168 -unsigned int TSCool9; //169 -unsigned int TSCool10; //170 -unsigned int TSCool11; //171 -unsigned int TSCool12; //172 -unsigned int TSCool13; //173 +unsigned int TDCool_0; //160 +unsigned int TDCool_1; //161 +unsigned int TDCool_2; //162 +unsigned int TDCool_3; //163 +unsigned int TDCool_4; //164 +unsigned int TDCool_5; //165 +unsigned int TDCool_6; //166 +unsigned int TDCool_7; //167 +unsigned int TDCool_8; //168 +unsigned int TDCool_9; //169 +unsigned int TDCool_10; //170 +unsigned int TDCool_11; //171 +unsigned int TDCool_12; //172 +unsigned int TDCool_13; //173 unsigned int TermoDataCool0; //174 unsigned int TermoDataCool1; //175 @@ -522,149 +743,9 @@ unsigned int TermoDataCool26; //200 unsigned int TermoDataCool27; //201 -/* -unsigned int a84; //131 -unsigned int a85; //132 -unsigned int a86; //133 -unsigned int a87; //134 -unsigned int a88; //135 -unsigned int a89; //136 - - - - unsigned int Firmware_Version; //1 версия программы - unsigned int DropDelayGLD; //3 задержка для мультидропа (дискрета 100кГц) - - unsigned int Gain_Sin; //7 коиф усиления синуса. - unsigned int Gain_Cos; //8 коиф усиления косинуса. - - unsigned int FrqHZ; //9 Частота в Гц. - unsigned int FrqHZmin; //10 Мин значение частоты ВП - unsigned int FrqHZmax; //11 Мах значение частоты ВП - - unsigned int AmpPer; //13 начальное значение амплитуды - - - unsigned int AmpPerDel; //16 значение для расчета амплитуды (дельта амплитуды) на сколько будет отличаться в працентах 1 амплитуда от второй при ошумлении, мин знач : AmpPer, мах знач : AmpPer+AmpPerDel; (в процентах) - unsigned int AmpPerMin; //17 ограничение минимальной амплитуды ВП - unsigned int AmpPerMax; //18 ограничение максимальной амплитуды ВП - unsigned int AmpSpeed; //19 коиффициент сорости регулировки амплитуды - unsigned int AmpTarget; //20 целевая амплитуда ВП к которой стремится регулировка. - - unsigned int TermoNKU; //21 - - - - - - unsigned int DAC_B; //25 - unsigned int Try_Discarg; - */ -//unsigned int PLC_Lern; //3 обратный таймер для поиска максимальной амплитуды при работе без модулятора -//unsigned int Frq; //6 Непосредственное значение частоты для таймера. } Str; } GyroParam; -/* -typedef union { - int Array[70]; - struct { - unsigned int LogPLC; // 1 - unsigned int Log; // 2 - - unsigned int PLC_Lern; // 3 обратный таймер для поиска максимальной амплитуды при работе без модулятора - unsigned int ModAmp; // 4 амплитуда модулятора - - unsigned int FlashMod; // 5 0-ничего не делать, 1 - запись во Flash, 2 чтение из Flash. - unsigned int ModeOut; // 6 переменная для выбора варианта вывода параметров типа Rate. - - unsigned int Rate1_Event; // 7 событие 1с для вывода параметров Rate 1 - unsigned int Reper_Event; // 8 событие для вывода набора параметров типа Rate по меандру. - unsigned int Event_500Hz; - - unsigned int RgConA; // 9 регистр управления ГЛД - unsigned int RgConB; //10 регистр управления ГЛД - unsigned int Gain_Sin; //11 коиф усиления синуса. - unsigned int Gain_Cos; //12 коиф усиления косинуса. - unsigned int Frq; //13 Непосредственное значение частоты для таймера. - unsigned int FrqHZ; //14 Частота в Гц. - unsigned int FrqHZmin; //15 Мин значение частоты ВП - unsigned int FrqHZmax; //16 Мах значение частоты ВП - unsigned int FrqChengSpeed; //17 скорость регулировки частоты ВП - - unsigned int VibroFrqRegulF; //18 флаг регулировки частоты ВП - unsigned int VibroAMPRegulF; //19 флаг регулировки амплитуды ВП - unsigned int VibroNoiseF; //20 флаг ошумления амплитуды ВП - unsigned int VibroOutF; //21 флаг изменения состояния ножек вибро. - - - unsigned int Amp; //22 значение амплитуды вибропривода в попугаях (Gyro.Amp = (0%--100%) << 16) - unsigned int AmpPer; //23 Амплитуда в процентах Gyro.AmpPer = Gyro.Amp>>16 ; - unsigned int AmpT; //24 значение тиков после которых происходит смена амплитуды ошумления ( rand() % Gyro.AmpTD+Gyro.AmpMin)(частота ошумления) - unsigned int AmpMin; //25 минимальное значение AmpT(частота ошумления); - unsigned int AmpTD; //26 диапозон частоты ошумления(частота ошумления); - - unsigned int AmpPerMin; //27 ограничение минимальной амплитуды ВП - unsigned int AmpPerMax; //28 ограничение максимальной амплитуды ВП - unsigned int AmpSpeed; //29 коиффициент сорости регулировки амплитуды - unsigned int AmpTarget; //30 целевая амплитуда ВП к которой стремится регулировка. - unsigned int AmpPerDel; //31 значение для расчета амплитуды (дельта амплитуды) на сколько будет отличаться в працентах 1 амплитуда от второй при ошумлении, мин знач : AmpPer, мах знач : AmpPer+AmpPerDel; (в процентах) - unsigned int AmpN1; //32 левая граница импулься ВП - unsigned int AmpN2; //33 правая граница импулься ВП - unsigned int F_ras; //34 частота расщипления (не расчитывается) - int MaxAmp; //35 амплитуда Пик-Пик расчтитанная по востановленному синусу. - - //ЭНКОДЕР - int CaunPlus; //36 счетчик + - int CaunMin; //37 счетчик - - - // данные АЦП - unsigned int TermoNKU; //38 - unsigned int Termo; //39 значение АЦП - unsigned int DeltaT; //40 - unsigned int In1; //41 - unsigned int In2; //42 - - //пятый ацп, он же амплитудный детектор "AD". есть два фильтра быстрый "Fast" и медленный "Slow" - unsigned int ADF_Accum; //43 Значенее амплитудного детектора Временное - unsigned int ADS_Accum; //44 Значенее амплитудного детектора Временное - unsigned int ADS_AccumTermLM; //45 - unsigned int TermLM; //46 - unsigned int ADF_Count; //47 Значенее времени накопления данных - unsigned int ADS_Count; //48 Значенее времени накопления данных - unsigned int AD_Fast; //49 Значенее амплитудного детектора сдвинутое на 16 бит - unsigned int AD_Slow; //50 Значенее амплитудного детектора сдвинутое на 16 бит - unsigned int ADF_NewData; //51 есть данные после фильтрации в быстром фильтре - unsigned int ADS_NewData; //52 -----------/----------/----------/-------- - - int PLC_Error2Mode; //53 счетчик, не ноль когдав двух модовом регулировка без модулятора(для просмотра мод) - - unsigned int CMD_In; //54 входящая команда - unsigned int SOC_Out; //55 - unsigned int My_Addres; //56 адрес прибора - unsigned int DropDelayGLD; //57 задержка для мультидропа (дискрета 100кГц) - - unsigned int GLD_Serial; //58 серийный номер прибора - unsigned int CRC; //59 контрольная сумма посылки - unsigned int Firmware_Version; //60 версия программы - unsigned int RsErrLine; //61 регистр ошибок передачи. - - int CuruAngle; //62 текущеий угол. - int OldCuruAngle; //63 старый угол - int Cnt_Dif; //64 приращение угла между прошлым и текушим приращением за тик виброподвеса (32 тика) - - unsigned int PinReg; //65 bit4 bit3 bit 2 bit1 bit0 - unsigned int PinRegOld; //66 || светодиод || состояние поджига || состояние подсветки || состояние вибро 2 || состояние вибро 1 || - - unsigned int Discharg; //67 последовательность бит харрактеризующая форму сигнала поджига. - unsigned int BackLight; //68 последовательность бит харрактеризующая форму сигнала подсветки. - - unsigned int EXT_Latch; //69 - - unsigned int wall; //70 - unsigned int ParamMod ; //71 - } Str; -} GyroParam; */ extern GyroParam GyroP; extern void AllRegul (void);