Zero_electric_angle differences among modulation types

Hmm, I wonder if we should be using +.866,-.866 in the trapezoid tables rather than +1,-1. Otherwise trapezoid modes are running about 15% higher voltage, and the effect of voltage-based current limiting won’t match between the two.

Has anyone actually measured the phase currents when using voltage-based limiting? It actually looks more like trapezoid will be correct and sine and SVPWM will limit to .866 times the requested current.

In any case, trapezoid120 should always jump the motor to the physical cogging step positions, because the voltage values it outputs are based on the sector number, which will always be an integer regardless of whether the float value was truncated or rounded.

The pi/6 rounding offset only impacts how the sector number relates to the sensor reading and zero angle. Judging by your results with the zero angle, the comment “adding PI/6 to align with other modes” is wrong, and in fact causes it NOT to align with the other modes.

But as said in my previous post, if we remove the rounding, then we will have numerical trouble with the angles output by HallSensor. Maybe the best solution for that would be to change the pi/6 offset to something small like .001 to tip it over the integer boundary without actually rounding.

Trapezoid150 does half-stepping. Even numbered sectors are cogging steps, odd numbered are half way between and don’t hold reliably on my little motor with strong cogging torque.

1 Like