Part Number: TMS320F280049C
I'm trying to change the frequency of the pwm while the motor is spinning. The change is small, mostly under 2%.
My first try looked like this:
uint16_t periodCount = halfPeriod_cycles * jitter_1;
EPWM_setTimeBasePeriod(obj->pwmHandle[0], periodCount);
EPWM_setTimeBasePeriod(obj->pwmHandle[1], periodCount);
EPWM_setTimeBasePeriod(obj->pwmHandle[2], periodCount);
Unfortunately it doesn't work that way.
There is a Lab: is12_variable_pwm_frequency – Online Variable Switching Frequencies"
In the module vsf.* is a function "VSF_setPeriod"
The documentation says: "Call the below function to set the period register of the ePWM module to update the switching frequency."
And that looks right because the function is also passed a HAL handle. Unfortunately, this handle is missing in the source code of the corresponding lab. In fact, the function doesn't do it at all. It looks as if the lab could not work at all. I can't find a newer version of the lab either.
So my question is: what is the correct way to change the PWM while the motor is spinning?
Thanks for you help!
