This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

F28M35x : HrPWM calibration routine SFOv7

Other Parts Discussed in Thread: CONTROLSUITE

Hello,

At the moment we're using a F28M35x Concerto device for generating HRPWM for our stepper drive. The SYSCLK & TBCLK are both running at 100 MHz, and the PWM frequency = 500 kHz with symmetric HrPWM generation in dutycycle control.

We sweep through the dutycycle by increasing/decreasing the CMPA:CMPAHR registers with Autoconversion enabled, and using a sine wave LUT as input setpoint. Then it becomes notable that some jumps/overlap occurs each time CMPA increments/decrements. We know that CMPAHR should be in range of 1 to 255, but the problem still persists even if CMPAHR is never 0. Here's a small sample of what we see on the output of the drive (note current is sampled as voltage in the image):

After some more testing we found out that the MEP_ScaleFactor (and thus also the HRMSTEP) value calculated by the SFOv7 calibration routine from the ControlSuite calculated a value that was too large (e.g. ~62). When we remove the calibration routine entirely and hardcode the HRMSTEP to a smaller value (e.g. 59) the sine on the output does become fluent.

It makes sense that when the HRMSTEP value is too large or small the HrPWM is wrongly generated, but why does this happen in the first place? The entire purpose of the SFO routine is to calculate this value, so what is causing this? According to the datasheet the SFO function should be called every so often, but even when it is the only function that is executed continuously it still generates incorrect values.

I suppose that is some applications it doesn't matter that much if the factor is a little off, but in this case it will create problems when driving a stepper with high precision. Is this issue known to you, or do you have any idea why this is happening and how it can be resolved?