In our robotics-like application we use RPM mode while adjusting current limit - we customized it to allow dynamic modification of the limit by terminal command. I noticed that if the current limit is set below the actual current, the duty cycle jumps to the highest value (95%) and stays there.
For instance, say current limit is set to 1 Amp, and the motor is spinning at 1000 ERPM drawing 0.3 Amp. If I change the limit to 0.2 Amp, the duty cycle jumps to 95% and motor speeds up to max.
Any ideas ?
Sounds kinda like https://github.com/vedderb/bldc/issues/207 which was fixed in 5.2
What version you on?
We're using slightly customized fork of 3.40, however additional logging seems to imply the problem is deeper. Before the motor starts accelerating, it looks like the IQ sign is reversing.
For instance in this run the motor speed up form rest to a set point of 20K ERPM (normalized to 1 in the plot). IQ is initially positive, clipped to a maximum of 1Amp. However around the point of 18K ERPM it reverses sign and become negative and stays negative at steady state.
Next plot shows acceleration from steady state of 19K ERPM to 21K. The IQ (corresponding to speed control PID output) is also changing sign from negative to positive and then back to negative again.
This seems contrary to all the theory that IQ is the torque generating component of the current - the sign (=direction) of the torque should not change in those scenarios.
Also, the motor seems well controlled in those runs, with the speed following setpoint closely.
[TMotor MN4010 outrunner, Kv=370, PP=12, V=24, maximal ERPM = 106K, so we're pretty far from that ]
Here is an even more clear display of Iq sign reversal under constant RPM with varying mechanical load. When spinning idle, the Iq is negative ~-0.3Amp. When applying friction load, the Iq moves towards zero and then becomes positive.
How can this behavior make sense ?
It seems that this offset in current measurement is fixed by enabling "Sample in V0 and V7" flag.