Open dzid26 opened 1 year ago
The present Sine commutation may lose steps when backdriving. SimpleFOC implements a FOC library for closed loop control of stepper motors, as demonstrated here https://youtu.be/zcb86TRxTxc
SimpleFOC has all kind of control schemes. I like voltage control the most for our board. For full-blown FOC you would need different hardware with inline current sensing and fast phase current close loop control done by the MCU.
Current hardware is simpler, but I believe this issue can still be solved by using knowledge of motor inductance and sensor delays.
Currents data during the snap event: Snap on overload.xlsx
Current changes fast during the snap, because the shaft accelerates rapidly (jerks, snaps).
But why does it snap? Either current is not commanded right or it has something to do with large torque ripple under load. (#11) To be investigated...
looks like some variable is reset or overflow?
I don't think so. The current waveworms draw a circle which is correct and impressive given the rate of change of things.
But It could be that the timing is not ideal - but things don't happen fast before the snap occurs.
I am leaning toward that this could be hardware characteristics - the large torque ripple under high load coupled with springiness in the load in my setup and non-linear friction (stiction) in the case of a gearbox.
I think fully solving #11 would fix this too. I would only hope that the torque peaks are aligned at multiples of 90deg and not 45, because in one case we can extract more useful torque and power from the motor, and in the other, we may lose average power.
The distortion is probably caused by the decay mode and/or back EMF, as proposed by TI in the smart tune method.
Youtube
Technical White Paper,
Getting smart about tuning your stepper motor
I think I mixed two issues/scenarios here. :(
One could be related to decay modes and distortion - which at higher speed oposing the driving torque, the torque value drops. But it is normal scenario of driving the moror when bemf makes it harder to maintain the high current. Here we are braking, so bemf helps to have high braking current.
At much higher requested torque (say 3Amp) somewhat similar effect can be visible at 0 speed! If the load torque increases, eventually the motor is "giving up" and the torque drops. It's the snap I mentioned last week.
However I think underlying causes are different. Although eventually they may get combined once the speed increases.
For the 2. scenario, (which is more disturbing), the decay mode doesn't play a role. - initially the speed is close to zero (before it snaps and looses torque), and so bemf is close to zero and slow decay will do just fine. It is confirmed by the circle plot above.
Realistically, I think the seconds scenario is caused by nonlinearity if the torque - which in turn is probably amplfied by localized magnetic saturation during high current. - That is the holding torque is probably only high where teeth are aligned and relatively small in-between. (Or opposite way). And so once I go pass the tooth, I loose torque and motor speed goes up due to inertia and springiness of the system. Once it starts rotating, perhaps the torque never comes back due to combination of the 1. scenario.
With high torque (high current) and backdriving against it, there are two effects contributing to the jerky movement.
When backdriving under smaller currents, both effects are not as visible as the current can quickly change direction. For larger currents, it takes time for it to change - the phase delay.
When phase delay is large enough more than 90deg, the driving current stop adding to torque generation, and causes rapid torque decline.
The phase delay can be compensated using speed calculation by additionally taking into account motor inductance.