Ряд правок:

V_PWM_Module.c - изменено чередование ШИМ каналов;
V_adc.c - добавлена обработка датчика температуры;
cood1.c - изменены дефолтные коэффициенты усиления для датчиков тока и датчика температуры.
This commit is contained in:
KulikEgor 2019-09-24 11:41:09 +03:00
parent 7e38106ce2
commit bd31578422
4 changed files with 1164 additions and 1547 deletions

View File

@ -403,9 +403,9 @@ void PWM_Module_No_SV_Update(TPWM_Module *p) {
//Второй раз - чтобы предотвратить ситуацию с постоянной "незагрузкой" при равенстве частот расчета и ШИМ
DINT;
if (PWM0->TBCTR>30) {
PWM0->CMPA_bit.CMPA=(Uint16)p->GammaA;
PWM1->CMPA_bit.CMPA=(Uint16)p->GammaB;
PWM2->CMPA_bit.CMPA=(Uint16)p->GammaC;
PWM0->CMPA_bit.CMPA=(Uint16)p->GammaB;
PWM1->CMPA_bit.CMPA=(Uint16)p->GammaC;
PWM2->CMPA_bit.CMPA=(Uint16)p->GammaA;
}
EINT;
}
@ -470,9 +470,9 @@ void PWM_Module_Sin_Update(TPWM_Module *p) {
p->GammaC = p->k_pwm + 1;
PWM0->CMPA_bit.CMPA = (Uint16) p->GammaA;
PWM1->CMPA_bit.CMPA = (Uint16) p->GammaB;
PWM2->CMPA_bit.CMPA = (Uint16) p->GammaC;
PWM0->CMPA_bit.CMPA = (Uint16) p->GammaB;
PWM1->CMPA_bit.CMPA = (Uint16) p->GammaC;
PWM2->CMPA_bit.CMPA = (Uint16) p->GammaA;
}
@ -513,9 +513,9 @@ void PWM_Module_Separate_Update(TPWM_Module *p) {
if (p->GammaC > p->k_pwm)
p->GammaC = p->k_pwm + 1;
PWM0->CMPA_bit.CMPA = (Uint16) p->GammaA;
PWM1->CMPA_bit.CMPA = (Uint16) p->GammaB;
PWM2->CMPA_bit.CMPA = (Uint16) p->GammaC;
PWM0->CMPA_bit.CMPA = (Uint16) p->GammaB;
PWM1->CMPA_bit.CMPA = (Uint16) p->GammaC;
PWM2->CMPA_bit.CMPA = (Uint16) p->GammaA;
}

View File

@ -112,6 +112,7 @@ void AdcDrv_fast_calc(TAdcDrv *p) {
p->Imeas_b = p->IbGainNom * (((p->IB_temp<< 4) + p->Imeas_b_offset));
p->Udc_meas = p->UdcGainNom * (p->Udc_temp + p->Udc_meas_offset);
p->Imeas_c = -p->Imeas_a - p->Imeas_b;
p->T_meas = p->T_temp * p->TGainNom;
//ADC->SEQ[0].SCCTL_bit.RAVGEN ^= 1;
}
@ -172,6 +173,7 @@ void AdcDrv_slow_calc(TAdcDrv *p) {
p->IbGainNom = _IQ16mpy(p->Imeas_b_gain, drv_params._1_I_nom) << 1;
p->IcGainNom = _IQ16mpy(p->Imeas_c_gain, drv_params._1_I_nom) << 1;
p->UdcGainNom = _IQ16mpy(p->Udc_meas_gain, drv_params._1_Udc_nom) << 4;
p->TGainNom = _IQ16mpy(p->T_meas_gain,_IQ(1.0/100)) << 6;
}
//! Ìèëëèñåêóíäíûé ðàñ÷åò

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="windows-1251"?>
<root>
<dictionary_settings group_set="15" proc_series="28" prefix="1" AddrComm1="CO1_SPI_START_ADDR" AddrUser1="CO1_SPI_START_ADDR" AddrComm2="CO2_SPI_START_ADDR" AddrUser2="CO1_SPI_START_ADDR" BigYA="false" M3Includes="false" Use6000Range="false" FormatType="1" old_groups="false"/>
<root COODEdit4="v.7.3.8">
<dictionary_settings group_set="15" proc_series="28" prefix="1" AddrComm1="CO1_SPI_START_ADDR" AddrUser1="CO1_SPI_START_ADDR" AddrComm2="CO2_SPI_START_ADDR" AddrUser2="CO1_SPI_START_ADDR" BigYA="false" M3Includes="false" Use6000Range="false" FormatType="1" GenCoodCToFolder="false" CoodCFolder="" GenPUTextsToFolder="false" PUCodeType="0" PUTextsType="2" PUEnumsType="2" PUUseOtherEnumIfNoGiven="false" PUTextsHPath="" PUTextsHInc="&quot;DSP.h&quot;" PUTextsCPath="" PUTextsCInc="&quot;PU_Texts.h&quot;" old_groups="false" CurrSubProfile="0"/>
<eds_header header_text=""/>
<scale_numbers>
<scale_00 units="0" prefix="0" scaleQ="0" num_of_float="1" possible_value="1" name=""/>
@ -36,7 +36,7 @@
<scale_30 units="0" prefix="" scaleQ="0" num_of_float="0" possible_value="" name=""/>
<scale_31 units="" prefix="" scaleQ="" num_of_float="" possible_value="1" name=""/>
</scale_numbers>
<Indexes>
<Indexes name="Áàçîâûé ïðîôèëü">
<obj_1000h.00h DataType="Viewable" name="Òèï óñòðîéñòâà" addr="co_deviceType" group="6" groupName="CAN" fullgroup="6" callback="">
<format Type="StandartNum" Size="32" Signed="false"/>
<text text="Device Type" textID="1"/>
@ -3712,7 +3712,7 @@
<obj_5116h.01h DataType="Editable" name="Êîýôôèöèåíò òîêà ôàçû À" addr="adc.Imeas_a_gain" group="16" groupName="ÀÖÏ" fullgroup="16" callback="">
<format Type="IQ" Size="16" Signed="true" QValue="0" ScaleNum="14"/>
<text text="IaÓñèë" textID="416"/>
<defaults default="-81" min="" max=""/>
<defaults default="81" min="" max=""/>
<description description=""/>
</obj_5116h.01h>
<obj_5116h.02h DataType="Editable" name="Ñìåùåíèå òîêà ôàçû À" addr="adc.Imeas_a_offset" group="16" groupName="ÀÖÏ" fullgroup="16" callback="">
@ -3730,7 +3730,7 @@
<obj_5116h.04h DataType="Editable" name="Êîýôôèöèåíò òîêà ôàçû Â" addr="adc.Imeas_b_gain" group="16" groupName="ÀÖÏ" fullgroup="16" callback="">
<format Type="IQ" Size="16" Signed="true" QValue="0" ScaleNum="14"/>
<text text="IbÓñèë" textID="419"/>
<defaults default="-81" min="" max=""/>
<defaults default="81" min="" max=""/>
<description description=""/>
</obj_5116h.04h>
<obj_5116h.05h DataType="Editable" name="Ñìåùåíèå òîêà ôàçû Â" addr="adc.Imeas_b_offset" group="16" groupName="ÀÖÏ" fullgroup="16" callback="">
@ -3784,7 +3784,7 @@
<obj_5116h.0Dh DataType="Editable" name="Êîýôôèöèåíò òåìïåðàòóðû" addr="adc.T_meas_gain" group="16" groupName="ÀÖÏ" fullgroup="" callback="">
<format Type="IQ" Size="16" Signed="true" QValue="0" ScaleNum="27"/>
<text text="t_gain" textID="633"/>
<defaults default="0" min="" max=""/>
<defaults default="1500" min="" max=""/>
<description description=""/>
</obj_5116h.0Dh>
<obj_5116h.0Eh DataType="Viewable" name="Òåìïåðàòóðà" addr="adc.T_meas" group="16" groupName="ÀÖÏ" fullgroup="" callback="">
@ -4544,4 +4544,5 @@
<description description="Èíäóêòèâíîñòü ôàçû ñòàòîðà"/>
</obj_5B04h.08h>
</Indexes>
<SubProfiles/>
</root>