_Cla1Task1: ;MDEBUGSTOP MMOV32 MR1, @_PidParam1.MaxAdc1Current MI16TOF32 MR0, @_AdcResult.ADCRESULT0
MMOV32 MR3, @_PidParam1.Last1Current1Error MNOP MSUBF32 MR2, MR0, MR1
MNOP MNOP MNOP ;||MMOV32 MR3, @_PidParam1.Last1Current1Error MCMPF32 MR0, MR1 MNOP ; Three instructions after MCMPF32 ???? ;MMOV32 @_PidParam1.Last1Current1Error, MR2 MNOP MNOP MNOP
MBCNDD _Task1Overload, GEQ ; If current overflow MNOP ; Three instructions after MBCNDD are always ; executed whether the branch is taken or not MADDF32 MR0, MR3, MR2
||MMOV32 MR3, @_PidParam1.
MMPYF32 MR2, #0.5, MR2
MNOP ;========================================================= MI16TOF32 MR1, @_OutputValue.Out1SetVlt ; MI16TOF32 MR0, @_AdcResult.ADCRESULT1 ; Out1 Output Voltage MSUBF32 MR2, MR1, MR0
||MMOV32 MR3, @_PidParam1.Out1TatolError
MMOV32 MR0, @_PidParam1.Last1Vlt1Error MNOP MNOP ;MNOP MADDF32 MR3, MR2, MR3
||MMOV32 @_PidParam1.Last1Vlt1Error, MR2 ; MMINF32 MR3, #1000.0 MMAXF32 MR3, #-1000.0 MNOP MNOP MNOP MSUBF32 MR0, MR2, MR0
||MMOV32 @_PidParam1.Out1TatolError, MR3 ; MMPYF32 MR2, #0.045, MR2
MNOP MNOP MMPYF32 MR0, #0.005, MR0
MMPYF32 MR3, #0.045, MR3
MNOP MNOP MADDF32 MR0, MR0, MR2
MNOP MNOP MI16TOF32 MR2, @_EPwm1Regs.CMPA.half.CMPA MEINVF32 MR1, MR1 ; 1/Out1SetVlt MADDF32 MR0, MR0, MR3
MNOP MNOP MMPYF32 MR1, MR1, MR0 ; Error/Out1SetVlt MMPYF32 MR1, #50.0, MR1 MNOP MNOP MNOP MSUBF32 MR3, MR2, MR1 MMINF32 MR3, #295.0 MMAXF32 MR3, #1.0 MNOP MNOP MF32TOI16 MR0, MR3 MNOP MNOP MNOP MMOV16 @_EPwm1Regs.CMPA.half.CMPA, MR0 MSTOP MNOP MNOP MNOP MNOP _Task1Overload: MMPYF32 MR1, #0.5, MR2
MMPYF32 MR2, #0.5, MR0
MSUBF32 MR0, MR2, MR3 ; MMPYF32 MR3, #0.1, MR0
MADD32 MR0, MR2, MR1 MADD32 MR0, MR0, MR3 MF32TOI16 MR1, MR0 MMOV16 @_EPwm1Regs.CMPA.half.CMPA, MR1 MSTOP MNOP MNOP MNOP _Cla1T1End: |