hi expert,
I see there is enable swap of high frequency PWM at negativeZeroCrossing3, which let PWMxA= PWMxB, PWMxB= PWMxA.
if(acSine < threshold_NZC2) { state_slew=0; pwm_SwState.enum_pwmSwState=pwmSwState_negativeZeroCrossing3; // Enable xA xB Swap ENABLE_SWAP_DEADBAND_OUTPUT(HIGH_FREQ_PWM1_BASE); ENABLE_SWAP_DEADBAND_OUTPUT(HIGH_FREQ_PWM2_BASE); ENABLE_SWAP_DEADBAND_OUTPUT(HIGH_FREQ_PWM3_BASE); softstart_duty=0; gi.i10=0; gi.i6=1; gi.Ki=0; gi_out=0; }
And remain the setting, after that, disable the swap of high frequency PWM at positiveZeroCrossing3
if(acSine > threshold_PZC2 ) { pwm_SwState.enum_pwmSwState=pwmSwState_positiveZeroCrossing3; state_slew=0; softstart_duty=0; // Dead band output swap disabled DISABLE_SWAP_DEADBAND_OUTPUT(HIGH_FREQ_PWM1_BASE); DISABLE_SWAP_DEADBAND_OUTPUT(HIGH_FREQ_PWM2_BASE); DISABLE_SWAP_DEADBAND_OUTPUT(HIGH_FREQ_PWM3_BASE); gi.i10=0; gi.i6=1; gi_out=0; gi.Ki=0; }
I really don't understand, why you want to let PWMxA= PWMxB, PWMxB= PWMxA during the whole negativeHalf stage?
And basicly,
zerocrossing1 means shut down all the PWM channels
zerocrossing2 means giving the high frequency channels a fixed duty 0.004
zerocrossing3 means soft start of the high frequency channels, using state_slew_max to control the end of this stage.
look forward to your answers.
BR Emma