![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
forkd
Fork of LGstaandart by
vibro.c@216:189b0ea1dc38, 2017-09-04 (annotated)
- Committer:
- Kovalev_D
- Date:
- Mon Sep 04 12:09:55 2017 +0000
- Revision:
- 216:189b0ea1dc38
- Parent:
- 215:b58b887fd367
- Child:
- 218:b4067cac75c0
plc_work
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
igor_v | 0:8ad47e2b6f00 | 1 | #include "Global.h" |
igor_v | 30:17c84ed091b3 | 2 | GyroT Gyro; |
Kovalev_D | 129:406995a91322 | 3 | GyroParam GyroP; |
Kovalev_D | 112:4a96133a1311 | 4 | volatile unsigned int Cheng_AMP_Flag=0; |
Kovalev_D | 190:289514f730ee | 5 | //int reper=0; |
Kovalev_D | 193:a0fe8bfc97e4 | 6 | int Rate2VibFlag,countA=0,tempDP,vibrot=0,fnoize=0,Znak=0,tempy,ttempo; |
Kovalev_D | 209:224e7331a061 | 7 | unsigned int OldMaxAmp=0,countFras=0; |
Kovalev_D | 207:d1ce992f5d17 | 8 | int z=25; |
Kovalev_D | 208:19150d2b528f | 9 | int i=16,tempi=0,klk=0; |
Kovalev_D | 193:a0fe8bfc97e4 | 10 | __irq void EINT3_IRQHandler() |
Kovalev_D | 208:19150d2b528f | 11 | { |
Kovalev_D | 208:19150d2b528f | 12 | Gyro.EXT_Latch=1; |
Kovalev_D | 205:775d54fdf646 | 13 | // Gyro.DeltaEXT_Event=1; |
Kovalev_D | 205:775d54fdf646 | 14 | // Gyro.B_Delta_EventEXT=1; |
Kovalev_D | 193:a0fe8bfc97e4 | 15 | LPC_GPIOINT->IO0IntClr |= (1<<1); |
Kovalev_D | 193:a0fe8bfc97e4 | 16 | // CMD_Delta_Bins(); |
Kovalev_D | 193:a0fe8bfc97e4 | 17 | } |
Kovalev_D | 193:a0fe8bfc97e4 | 18 | |
Kovalev_D | 193:a0fe8bfc97e4 | 19 | |
igor_v | 114:5cc38a53d8a7 | 20 | void VibroOut(void) // выставка ног вибро |
igor_v | 0:8ad47e2b6f00 | 21 | { |
Kovalev_D | 190:289514f730ee | 22 | if(CountV31>=16) |
Kovalev_D | 190:289514f730ee | 23 | {//первая нога вибро |
Kovalev_D | 89:a0d344db227e | 24 | // левая граница вЫкл вибро 1 > Time_vibro <ПРАВАЯ граница вЫкл вибро 1 |
Kovalev_D | 190:289514f730ee | 25 | if((Time_vibro>Gyro.AmpN1) && (Time_vibro<Gyro.AmpN2)) |
Kovalev_D | 190:289514f730ee | 26 | { |
Kovalev_D | 203:3a6615de9581 | 27 | SetV1//установить в регистре PinReg бит "вибро 1" в "0" |
Kovalev_D | 190:289514f730ee | 28 | } |
Kovalev_D | 190:289514f730ee | 29 | else |
Kovalev_D | 190:289514f730ee | 30 | { |
Kovalev_D | 207:d1ce992f5d17 | 31 | ClrV1 //установить в регистре PinReg бит "вибро 1" в "1" |
igor_v | 21:bc8c1cec3da6 | 32 | } |
Kovalev_D | 85:0466ee8cdfc8 | 33 | |
Kovalev_D | 190:289514f730ee | 34 | } |
Kovalev_D | 190:289514f730ee | 35 | else {//вторая нога вибро |
Kovalev_D | 190:289514f730ee | 36 | if((Time_vibro>Gyro.AmpN1)&&(Time_vibro<Gyro.AmpN2)) |
Kovalev_D | 190:289514f730ee | 37 | { |
Kovalev_D | 207:d1ce992f5d17 | 38 | SetV2 //установить в регистре PinReg бит "вибро 2" в "0" |
Kovalev_D | 190:289514f730ee | 39 | } |
Kovalev_D | 190:289514f730ee | 40 | else |
Kovalev_D | 190:289514f730ee | 41 | { |
Kovalev_D | 203:3a6615de9581 | 42 | ClrV2//установить в регистре PinReg бит "вибро 2" в "1" |
igor_v | 21:bc8c1cec3da6 | 43 | } |
igor_v | 21:bc8c1cec3da6 | 44 | } |
igor_v | 0:8ad47e2b6f00 | 45 | } |
Kovalev_D | 214:4c70e452c491 | 46 | /* |
Kovalev_D | 193:a0fe8bfc97e4 | 47 | |
Kovalev_D | 193:a0fe8bfc97e4 | 48 | void OLDCalcAmpN(void)//расчет точек старта и стопа импульса вибропривода и расчет частоты ошумления. |
Kovalev_D | 207:d1ce992f5d17 | 49 | { |
Kovalev_D | 207:d1ce992f5d17 | 50 | static int PeriodCount = 0,Period=0; |
Kovalev_D | 210:b02fa166315d | 51 | unsigned int Nmax=0, lowper=1; |
Kovalev_D | 209:224e7331a061 | 52 | Gyro.FrqHZ=Gyro.Frq>>16; |
Kovalev_D | 209:224e7331a061 | 53 | if(PeriodCount>= Gyro.AmpT) |
Kovalev_D | 209:224e7331a061 | 54 | { //если количество заходов в прерывание больше либо равно частоте ошумления. |
Kovalev_D | 209:224e7331a061 | 55 | PeriodCount=0;//сбрасываем таймер |
Kovalev_D | 214:4c70e452c491 | 56 | sprintf((Time),"%d %d %d\r\n", Gyro.AmpN1, Gyro.AmpN2-Gyro.AmpN1, Gyro.AmpPer); |
Kovalev_D | 214:4c70e452c491 | 57 | WriteCon(Time); |
Kovalev_D | 211:ac8251b067d2 | 58 | //Gyro.AmpPerDel=(Gyro.AmpPer*100)/Gyro.AmpPerDel; |
Kovalev_D | 209:224e7331a061 | 59 | if(Cheng_AMP_Flag==0) |
Kovalev_D | 209:224e7331a061 | 60 | { |
Kovalev_D | 214:4c70e452c491 | 61 | if((Gyro.AmpPer+Gyro.AmpPerDel)>90) Gyro.AmpPer=90-Gyro.AmpPerDel; //проверка верхней граници амплитуды |
Kovalev_D | 210:b02fa166315d | 62 | Nmax = (unsigned int)((100000/(Gyro.Frq>>16))-1);//256 // |
Kovalev_D | 210:b02fa166315d | 63 | Gyro.AmpN1=(unsigned int)((Nmax*(100-Gyro.AmpPer))/Gyro.FrqHZ); //левая граница амплитуды 63 |
Kovalev_D | 210:b02fa166315d | 64 | Gyro.AmpN2=(unsigned int)((Nmax/2)-Gyro.AmpN1); //правая граница амплитуды 65 |
Kovalev_D | 210:b02fa166315d | 65 | Gyro.L_vibro=Gyro.AmpPer*208; |
Kovalev_D | 214:4c70e452c491 | 66 | sprintf((Time),"%d %d %d \r\n",Gyro.L_vibro,Gyro.AmpPer,Cheng_AMP_Flag); |
Kovalev_D | 214:4c70e452c491 | 67 | WriteCon(Time); |
Kovalev_D | 209:224e7331a061 | 68 | Cheng_AMP_Flag=1; |
Kovalev_D | 209:224e7331a061 | 69 | } |
Kovalev_D | 210:b02fa166315d | 70 | else |
Kovalev_D | 210:b02fa166315d | 71 | { |
Kovalev_D | 210:b02fa166315d | 72 | if((Gyro.AmpPer+Gyro.AmpPerDel)>90) Gyro.AmpPer=90-Gyro.AmpPerDel; //проверка верхней граници амплитуды |
Kovalev_D | 210:b02fa166315d | 73 | if((Gyro.RgConA&0x20)) |
Kovalev_D | 210:b02fa166315d | 74 | { |
Kovalev_D | 210:b02fa166315d | 75 | Nmax =(unsigned int)((100000/(Gyro.Frq>>16))-1);//256 |
Kovalev_D | 210:b02fa166315d | 76 | Gyro.AmpN1=(unsigned int)((Nmax*(100-Gyro.AmpPer-Gyro.AmpPerDel))/Gyro.FrqHZ); //левая граница амплитуды 61 |
Kovalev_D | 210:b02fa166315d | 77 | Gyro.AmpN2=(unsigned int)((Nmax/2)-Gyro.AmpN1); //правая граница амплитуды 67 |
Kovalev_D | 210:b02fa166315d | 78 | Gyro.L_vibro=(Gyro.AmpPer+Gyro.AmpPerDel)*208; |
Kovalev_D | 214:4c70e452c491 | 79 | sprintf((Time),"%d %d %d \r\n",Gyro.L_vibro,Gyro.AmpPer,Cheng_AMP_Flag); |
Kovalev_D | 214:4c70e452c491 | 80 | WriteCon(Time); |
Kovalev_D | 210:b02fa166315d | 81 | } |
Kovalev_D | 210:b02fa166315d | 82 | Cheng_AMP_Flag=0; |
Kovalev_D | 210:b02fa166315d | 83 | } |
Kovalev_D | 210:b02fa166315d | 84 | if(Gyro.AmpN2<(Gyro.AmpN1+2))Gyro.AmpN2=Gyro.AmpN1+2; |
Kovalev_D | 210:b02fa166315d | 85 | |
Kovalev_D | 207:d1ce992f5d17 | 86 | srand(Global_Time);//инициализация функции rand() для получения новых случайных велечин. |
Kovalev_D | 210:b02fa166315d | 87 | Gyro.AmpT = (rand() % Gyro.AmpTD+Gyro.AmpMin);// ОШУМЛЕНИЕ amp |
Kovalev_D | 193:a0fe8bfc97e4 | 88 | } else { |
Kovalev_D | 193:a0fe8bfc97e4 | 89 | PeriodCount++;//таймер амплитуды |
Kovalev_D | 193:a0fe8bfc97e4 | 90 | } |
Kovalev_D | 214:4c70e452c491 | 91 | }*/ |
Kovalev_D | 214:4c70e452c491 | 92 | void OLDCalcAmpN(void)//расчет точек старта и стопа импульса вибропривода и расчет частоты ошумления. |
Kovalev_D | 214:4c70e452c491 | 93 | { |
Kovalev_D | 214:4c70e452c491 | 94 | static int PeriodCount = 0,Period=0; |
Kovalev_D | 214:4c70e452c491 | 95 | unsigned int Nmax=0, lowper=1; |
Kovalev_D | 214:4c70e452c491 | 96 | Gyro.FrqHZ=Gyro.Frq>>16; |
Kovalev_D | 214:4c70e452c491 | 97 | if(PeriodCount>= Gyro.AmpT) |
Kovalev_D | 214:4c70e452c491 | 98 | { |
Kovalev_D | 214:4c70e452c491 | 99 | PeriodCount=0;//сбрасываем таймер |
Kovalev_D | 214:4c70e452c491 | 100 | if(Cheng_AMP_Flag==0) |
Kovalev_D | 214:4c70e452c491 | 101 | { |
Kovalev_D | 214:4c70e452c491 | 102 | //if((Gyro.AmpPer+Gyro.AmpPerDel*100)>9000) Gyro.AmpPer=9000-Gyro.AmpPerDel*100; //проверка верхней граници амплитуды |
Kovalev_D | 214:4c70e452c491 | 103 | T_vib_1 = Gyro.AmpPer * T_vibP; |
Kovalev_D | 214:4c70e452c491 | 104 | T_vib_2 = T_vibP * (10000-Gyro.AmpPer); |
Kovalev_D | 214:4c70e452c491 | 105 | Gyro.L_vibro=Gyro.AmpPer*3; |
Kovalev_D | 214:4c70e452c491 | 106 | Cheng_AMP_Flag=1; |
Kovalev_D | 214:4c70e452c491 | 107 | } |
Kovalev_D | 214:4c70e452c491 | 108 | else |
Kovalev_D | 214:4c70e452c491 | 109 | { |
Kovalev_D | 214:4c70e452c491 | 110 | //if((Gyro.AmpPer+Gyro.AmpPerDel*100)>9000) Gyro.AmpPer=9000-Gyro.AmpPerDel*100; //проверка верхней граници амплитуды |
Kovalev_D | 214:4c70e452c491 | 111 | if((Gyro.RgConA&0x20)) |
Kovalev_D | 214:4c70e452c491 | 112 | { |
Kovalev_D | 214:4c70e452c491 | 113 | T_vib_1 = T_vibP * (Gyro.AmpPer +(Gyro.AmpPerDel*100)); |
Kovalev_D | 214:4c70e452c491 | 114 | T_vib_2 = T_vibP * (10000 -(Gyro.AmpPer+(Gyro.AmpPerDel*100))); |
Kovalev_D | 214:4c70e452c491 | 115 | Gyro.L_vibro=(Gyro.AmpPer+Gyro.AmpPerDel)*3; |
Kovalev_D | 214:4c70e452c491 | 116 | } |
Kovalev_D | 214:4c70e452c491 | 117 | Cheng_AMP_Flag=0; |
Kovalev_D | 214:4c70e452c491 | 118 | } |
Kovalev_D | 214:4c70e452c491 | 119 | |
Kovalev_D | 214:4c70e452c491 | 120 | srand(Global_Time);//инициализация функции rand() для получения новых случайных велечин. |
Kovalev_D | 214:4c70e452c491 | 121 | Gyro.AmpT = (rand() % Gyro.AmpTD+Gyro.AmpMin);// ОШУМЛЕНИЕ amp |
Kovalev_D | 214:4c70e452c491 | 122 | } |
Kovalev_D | 214:4c70e452c491 | 123 | else {PeriodCount++;} |
Kovalev_D | 208:19150d2b528f | 124 | |
Kovalev_D | 192:d32c8cf7bcd9 | 125 | } |
Kovalev_D | 207:d1ce992f5d17 | 126 | |
Kovalev_D | 112:4a96133a1311 | 127 | void VibroAMPRegul(void) //подстройка амплитуды ВП |
Kovalev_D | 208:19150d2b528f | 128 | { |
Kovalev_D | 209:224e7331a061 | 129 | |
Kovalev_D | 208:19150d2b528f | 130 | int temp=0; |
Kovalev_D | 211:ac8251b067d2 | 131 | int LowDZ,HiDZ; |
Kovalev_D | 189:8a16378724c4 | 132 | Gyro.CaunPlus = CaunAddPlus;//амплитуда по модулю из востановленного синиуса Buff_Restored_sin |
Kovalev_D | 210:b02fa166315d | 133 | // Gyro.CaunPlus = Gyro.CaunPlusReper; |
Kovalev_D | 112:4a96133a1311 | 134 | CaunAddPlus = 0; |
Kovalev_D | 209:224e7331a061 | 135 | Gyro.CaunMin = CaunAddMin; //амплитуда по модулю из востановленного синиуса Buff_Restored_sin |
Kovalev_D | 210:b02fa166315d | 136 | //Gyro.CaunMin=Gyro.CaunMinReper; |
Kovalev_D | 112:4a96133a1311 | 137 | CaunAddMin = 0; |
Kovalev_D | 208:19150d2b528f | 138 | Gyro.MaxAmp = Gyro.CaunPlus + Gyro.CaunMin; |
Kovalev_D | 209:224e7331a061 | 139 | |
Kovalev_D | 209:224e7331a061 | 140 | |
Kovalev_D | 209:224e7331a061 | 141 | if(countFras<512) |
Kovalev_D | 209:224e7331a061 | 142 | { |
Kovalev_D | 209:224e7331a061 | 143 | countFras++; |
Kovalev_D | 210:b02fa166315d | 144 | Gyro.F_rasAdd += Gyro.MaxAmp/32*Gyro.FrqHZ/40; |
Kovalev_D | 209:224e7331a061 | 145 | } |
Kovalev_D | 209:224e7331a061 | 146 | else |
Kovalev_D | 210:b02fa166315d | 147 | { |
Kovalev_D | 210:b02fa166315d | 148 | Gyro.F_rasAdd += Gyro.MaxAmp/32*Gyro.FrqHZ/40; |
Kovalev_D | 214:4c70e452c491 | 149 | Gyro.F_ras=Gyro.F_rasAdd>>9; |
Kovalev_D | 209:224e7331a061 | 150 | Gyro.F_rasAdd=0; |
Kovalev_D | 209:224e7331a061 | 151 | countFras=0; |
Kovalev_D | 209:224e7331a061 | 152 | } |
Kovalev_D | 208:19150d2b528f | 153 | if(Gyro.RgConA&0x20) |
Kovalev_D | 208:19150d2b528f | 154 | { |
Kovalev_D | 209:224e7331a061 | 155 | //расчет максимальной амплитуды из востановленного синуса р-р. |
Kovalev_D | 214:4c70e452c491 | 156 | temp=(int)(((Gyro.MaxAmp - Gyro.AmpTarget*2/((Gyro.Frq)>>16)) * Gyro.AmpSpeed)); |
Kovalev_D | 210:b02fa166315d | 157 | temp=temp>>6; |
Kovalev_D | 211:ac8251b067d2 | 158 | LowDZ = ((Gyro.AmpSpeed<<3)*(-1)); |
Kovalev_D | 211:ac8251b067d2 | 159 | HiDZ = (Gyro.AmpSpeed<<3); |
Kovalev_D | 214:4c70e452c491 | 160 | Gyro.Amp -= temp; // расчет амплитуды ВП с учетом разници |
Kovalev_D | 214:4c70e452c491 | 161 | if((Gyro.Amp>>16) > (Gyro.AmpPerMax)) {Gyro.Amp = (Gyro.AmpPerMax << 16);} // временное ограничение роста амплитуды ВП в случае неподоженного гироскопа////////// |
Kovalev_D | 214:4c70e452c491 | 162 | if((Gyro.Amp>>16) < (Gyro.AmpPerMin)) {Gyro.Amp = (Gyro.AmpPerMin << 16);} // временное ограничение роста амплитуды ВП в случае неподоженного гироскопа////////// |
Kovalev_D | 214:4c70e452c491 | 163 | // Gyro.AmpPer = (Gyro.Amp)>>16; //приведение амплитуды ВП к виду 0%-100% |
Kovalev_D | 208:19150d2b528f | 164 | } |
Kovalev_D | 214:4c70e452c491 | 165 | |
Kovalev_D | 214:4c70e452c491 | 166 | LPC_MCPWM->MAT1 = T_vib_1; |
Kovalev_D | 214:4c70e452c491 | 167 | LPC_MCPWM->MAT2 = T_vib_2; |
Kovalev_D | 208:19150d2b528f | 168 | } |
Kovalev_D | 112:4a96133a1311 | 169 | |
Kovalev_D | 191:40028201ddad | 170 | |
Kovalev_D | 191:40028201ddad | 171 | |
Kovalev_D | 112:4a96133a1311 | 172 | void VibroFrqRegul(void)// расчет Фазы с учетор разници(подстройка частоты) |
Kovalev_D | 196:f76dbc081e63 | 173 | { |
Kovalev_D | 112:4a96133a1311 | 174 | static int TempFaza, CountFaza; |
Kovalev_D | 112:4a96133a1311 | 175 | TempFaza = -4; |
Kovalev_D | 209:224e7331a061 | 176 | Gyro.FrqPhaseEror=0; |
Kovalev_D | 209:224e7331a061 | 177 | for (CountFaza = 0; CountFaza <8; CountFaza++ ) {if (Buff_Restored_sin [(CountV31 - Gyro.FrqPhase + CountFaza) & 0x1f] > 0 ) TempFaza++;} //резонанс когда CountV31 = 8 => Buff_Restored_sin = 0 |
Kovalev_D | 209:224e7331a061 | 178 | for (CountFaza = 0; CountFaza <8; CountFaza++ ) {Gyro.FrqPhaseEror += Buff_Restored_sin [(CountV31 - Gyro.FrqPhase + CountFaza) & 0x1f];} |
Kovalev_D | 208:19150d2b528f | 179 | if(Gyro.RgConA&0x40) |
Kovalev_D | 208:19150d2b528f | 180 | { //12 |
Kovalev_D | 209:224e7331a061 | 181 | Gyro.Frq += TempFaza*Gyro.FrqChengSpeed; |
Kovalev_D | 208:19150d2b528f | 182 | } |
Kovalev_D | 209:224e7331a061 | 183 | // Gyro.FrqPhaseEror = TempFaza<<10; |
Kovalev_D | 189:8a16378724c4 | 184 | if (Gyro.Frq < Gyro.FrqHZmin) Gyro.Frq=Gyro.FrqHZmin;//нижнее ограничение частоты |
Kovalev_D | 214:4c70e452c491 | 185 | else if(Gyro.Frq > Gyro.FrqHZmax) Gyro.Frq=Gyro.FrqHZmax;//верхнее ограничение частоты*/ |
Kovalev_D | 214:4c70e452c491 | 186 | LPC_TIM1->MR0 =(unsigned int)(103200000/(Gyro.Frq>>11));//запись в таймер нового значение частоты вибро |
Kovalev_D | 214:4c70e452c491 | 187 | // LPC_TIM1->MR0 =(unsigned int) F_vib; |
igor_v | 0:8ad47e2b6f00 | 188 | } |
igor_v | 0:8ad47e2b6f00 | 189 | |
igor_v | 0:8ad47e2b6f00 | 190 | ////////////////////////////////////////////////////////////////////////////// |
Kovalev_D | 190:289514f730ee | 191 | /////////////////////////основного 32 тактного цикла////////////////////////// |
igor_v | 0:8ad47e2b6f00 | 192 | ////////////////////////////////////////////////////////////////////////////// |
igor_v | 0:8ad47e2b6f00 | 193 | void cheng(void) |
Kovalev_D | 216:189b0ea1dc38 | 194 | { static unsigned int counttt=0; |
Kovalev_D | 107:4d178bcc9d8a | 195 | switch(CountV31) { |
Kovalev_D | 112:4a96133a1311 | 196 | case 0: |
Kovalev_D | 216:189b0ea1dc38 | 197 | |
Kovalev_D | 214:4c70e452c491 | 198 | ReVib();///обновление значений вибро |
Kovalev_D | 196:f76dbc081e63 | 199 | Gyro.VibroAMPRegulF=1; |
Kovalev_D | 112:4a96133a1311 | 200 | Time_vibro=0; |
Kovalev_D | 215:b58b887fd367 | 201 | Gyro.VibroNoiseF++;//расчет и установка нового заначения частоты ошумления и запись в таймер частоты ошумления. |
Kovalev_D | 112:4a96133a1311 | 202 | break; |
Kovalev_D | 214:4c70e452c491 | 203 | case 8: |
Kovalev_D | 214:4c70e452c491 | 204 | LPC_MCPWM->CON_CLR |= (1<<8); |
Kovalev_D | 214:4c70e452c491 | 205 | LPC_MCPWM->CON_CLR |= (1<<16); |
Kovalev_D | 214:4c70e452c491 | 206 | |
Kovalev_D | 214:4c70e452c491 | 207 | LPC_MCPWM->TC1 =1; |
Kovalev_D | 214:4c70e452c491 | 208 | LPC_MCPWM->TC2 =1; |
Kovalev_D | 214:4c70e452c491 | 209 | |
Kovalev_D | 215:b58b887fd367 | 210 | LPC_MCPWM->CON_SET |= (1<<8); |
Kovalev_D | 214:4c70e452c491 | 211 | LPC_MCPWM->CON_SET |= (1<<16); //вкл |
Kovalev_D | 214:4c70e452c491 | 212 | break; |
Kovalev_D | 214:4c70e452c491 | 213 | |
Kovalev_D | 112:4a96133a1311 | 214 | case 16: |
Kovalev_D | 215:b58b887fd367 | 215 | Time_vibro=0; |
Kovalev_D | 215:b58b887fd367 | 216 | Gyro.VibroFrqRegulF=1; // |
Kovalev_D | 112:4a96133a1311 | 217 | break; |
Kovalev_D | 214:4c70e452c491 | 218 | |
Kovalev_D | 215:b58b887fd367 | 219 | case 31: |
Kovalev_D | 216:189b0ea1dc38 | 220 | /* if(counttt>199) |
Kovalev_D | 216:189b0ea1dc38 | 221 | { |
Kovalev_D | 216:189b0ea1dc38 | 222 | |
Kovalev_D | 216:189b0ea1dc38 | 223 | sprintf((Time)," %d %d %d %d \r\n ", SinMns, SinPls, SinMns+SinPls, faza); |
Kovalev_D | 216:189b0ea1dc38 | 224 | WriteCon(Time); |
Kovalev_D | 216:189b0ea1dc38 | 225 | counttt=0; |
Kovalev_D | 216:189b0ea1dc38 | 226 | SinMns=0; |
Kovalev_D | 216:189b0ea1dc38 | 227 | SinPls=0; |
Kovalev_D | 216:189b0ea1dc38 | 228 | } |
Kovalev_D | 216:189b0ea1dc38 | 229 | counttt++; |
Kovalev_D | 216:189b0ea1dc38 | 230 | */ |
Kovalev_D | 214:4c70e452c491 | 231 | break; |
Kovalev_D | 207:d1ce992f5d17 | 232 | } |
Kovalev_D | 191:40028201ddad | 233 | } |
Kovalev_D | 191:40028201ddad | 234 | void AllRegul (void) |
Kovalev_D | 191:40028201ddad | 235 | { ///////////////////////////контуры регулировки///////////////////////////// |
Kovalev_D | 191:40028201ddad | 236 | |
Kovalev_D | 191:40028201ddad | 237 | if (Spi.ADC_NewData == 1) {ADS_Acum(); } // был приход новых данных по ацп сдесь сделать обработку информации и подготовку для выдачи делается 1 раз за вибро |
Kovalev_D | 191:40028201ddad | 238 | if (Gyro.ADF_NewData == 1) {Gyro.ADF_NewData = 0; } // был приход новых данных После быстрого фильтра AD |
Kovalev_D | 191:40028201ddad | 239 | if (Gyro.VibroFrqRegulF == 1) {Gyro.VibroFrqRegulF = 0; VibroFrqRegul(); } // Регулеровка частоты виброподвеса |
Kovalev_D | 209:224e7331a061 | 240 | if (Gyro.VibroAMPRegulF == 1) |
Kovalev_D | 209:224e7331a061 | 241 | { |
Kovalev_D | 209:224e7331a061 | 242 | Gyro.VibroAMPRegulF = 0; |
Kovalev_D | 209:224e7331a061 | 243 | VibroAMPRegul(); |
Kovalev_D | 215:b58b887fd367 | 244 | PLCRegul(); |
Kovalev_D | 215:b58b887fd367 | 245 | if(Gyro.LG_Type==1) |
Kovalev_D | 215:b58b887fd367 | 246 | { |
Kovalev_D | 215:b58b887fd367 | 247 | HFORegul(); |
Kovalev_D | 215:b58b887fd367 | 248 | } |
Kovalev_D | 209:224e7331a061 | 249 | } // Регулеровка Амплитуды виброподвеса |
Kovalev_D | 209:224e7331a061 | 250 | if (Gyro.VibroNoiseF == 1) {Gyro.VibroNoiseF = 0; OLDCalcAmpN();} |
Kovalev_D | 196:f76dbc081e63 | 251 | } |