This part is for members
Membership opens soon. Leave your email and we'll tell you the day it does. Founding members get the launch price.
Keep watching the free partsThe current loop 2: the angle pushed four ticks ahead
The line before Park (current_ctl_loop_task.c:136) pushes the angle ahead by elec_angle_compensation ticks of rotation; the header says 4. The angle is written by the control layer's mode steps in the 10 kHz position loop, so the current loop gets a new one every other call, while the rotor turns 7.5° per tick at 5000 rpm. Push wrong and Park measures in a turned frame: the loop's own id stays under a milliamp while the real id is −2.50 A, and holding the same load takes 5.62 A instead of 5.04. All real runs (SIL, 5000 rpm, 0.2 N·m): pushes of 0, 0.5, 2, 4 and 8 ticks; at push 4 the effect grows with speed (only −0.11 A at 300 rpm). A voltage one tick late barely matters (the integrators absorb it), so the push must match how old the angle is when the currents are sampled: half a tick in the SIL, about 3.5 on the board, worked out from the code (episodes 6e and 11a), which is why the header says 4. The SIL with the board's delay added, labelled as a model: push 0 gives +2.49 A, push 4 −0.33 A, 3.5 is best. Your turn: no push at 2500 rpm; what is the real id?