# PMSM FOC - holding motor on current limit

Discussion in 'Automotive Electronics' started by Krzysztof Bieda, Oct 5, 2016.

1. ### Krzysztof Bieda Thread Starter Member

Jan 5, 2016
32
0
Hello Everyone,

I have developed PMSM controller with FOC algorithm. All control works fine and I have no problem with ramping, velocity control or PI tune.
That design is going to replace current one.

The problem is with voltage drop and current limit.
I supply it with 24V and current limit is 40A. When current goes above limit then voltage drops and controller restarts. It is normal, but I have to prevent from restart and even try to hold motor in position.
Normally reference controller takes up to 150A from battery and my controller is designed to do the same.
I have to add that restart prevent to my design, because that reference controller does it.

I have used oscilloscope to analize reference controller performance when current goes up to limit ( here : 40A):

Yellow – supply current, green – supply voltage

And also I have observed PWM control signal:
Yellow – PWM, violet – supply voltage, green – supply current

PWM in critical moment of drop:

And also Phase current:
Green – phase current, violet – supply voltage

1. A, B phase currents
2. Supply current
3. Supply voltage
4. Motor position – thanks to that I know velocity.

Maybe somebody had similar problem and found solution.
What should I do to prevent from restart?
SImply, how to hold motor on current limit.

Best regards,
Chris

2. ### tsan Member

Sep 6, 2014
41
4
If I understand correctly supply voltage is actively reduced in case supply current goes above a threshold. Let's assume the supply current limit/threshold is 40 A. You can affect with FOC torque reference how much current the motor takes. Motor torque relates to supply current. Reduce torque and supply current reduces. You can monitor input supply current and reduce/limit allowed torque ref so that input current always stays below supply current limit. For example try first 30 A limit on your "supply current limitation" when supply current threshold is 40A. The better the limitation you can make the closer of the 40 A you can run. If I understand reference controller scope pictures (scalings) correctly limitation is quite coarse. Perhaps limitation is executed on quite slow task cycle.

Actual limitation could be sort of P controller. Again assuming 40 A supply current threshold and 30 A setting on limitation. Also assume 100 % is nominal (maximum) torque reference. With 30 A limitation function allows 100 % torque. For example 32 A allows 80 %. 34 A allows 60 % and so on. With P controller style code torque reference limit changes smoothly. Test with different limit setpoint, task time, supply current value filtering and p controller gain.

3. ### Krzysztof Bieda Thread Starter Member

Jan 5, 2016
32
0
tsan: "If I understand correctly supply voltage is actively reduced in case supply current goes above a threshold."
Yes, supply is taken from laboratory PSU now for tests. In final design it would be battery with capability of more than 150A.

Accordign to that what you wrote I think to do it like that:
When voltage drops, then save current value and limit current controller to that value.
Is it good thinking?

Best regards,
Chris

4. ### tsan Member

Sep 6, 2014
41
4
My idea was that if current limit is known then current is always controlled to be below that limit. This way voltage never drop/dip. If you can act fast enough when the voltage dips it can work too. On the scope pictures it seems that dips are too big but it could be that I understand scaling wrong. For me it seems to be that limitation is pumping on and off.

It's possible that some sort of controller is required on "voltage detection mode". It could be that input/supply current increases even when FOC current ref is steady. Power is torque x speed. If it is possible that speed increases input current increases. And, if voltage already has dropped because of too high motor current, the saved current limit might be too big and voltage drops even more.

Voltage detection can be good method when running on battery. When battery charge gets smaller and smaller, voltage detection activates with smaller current. On some point detection activates with so small current that recharge is necessary.

5. ### Krzysztof Bieda Thread Starter Member

Jan 5, 2016
32
0
Current limit is known and it is 150A and PI control should limit it up to it.
That 40A limit is only my test limit. Reference controller do not switch-off then, but my does.

I see that this refernce controller has something additional to react when voltage drops.