Quiet Mode
STM32 PWM Frequency Change Debug
Symptom
At the 16 kHz carrier the shaft settles at the commanded speed. At 20 kHz the same command settles a quarter fast. The registers and bit fields are on the Datasheet tab. The motor's registers are in the Circuit figure.
Circuit
Pass condition
At every carrier the shaft is within 500 RPM of the command by 40 ms and within 300 at the end, no fault. TIM2 runs at the carrier set, prescaler 0.
Notes
The operator sets the carrier and speed before the drive starts. The drive runs 45 ms. TIM2 counts at 16 MHz, SysTick at 72 MHz.