# Motor stall using FOC

1. Main point i want to understand can FOC be used to apply a fixed voltage to the motor?
2. I apply a fixed Electrical angle of -90 and Idref=0 and Iqref = Inominal current?
I have few doubts on why i selected -90, i will go in details if the flow chart is correct.

Any support on this will clarify some of my doubts.

Hey @FOCLearner,

I would be happy to help you, but I am not entirely sure that I understand what you wish to achieve.

This is exactly what we do when we control the motor in the voltagemode. We apply the fixed Uq voltage to the motor and for the most part keep the Ud at zero. But you can also set some other Ud if you wish.

But I am not sure that this is what you are aiming to do; Our voltage mode is a simplified FOC mode that assumes that the current is proportional to the voltage and avoids measuring the current in that way.
This assumption is not necessarily true for higher velocities and therefore this control law has some troubles achieving them.
However , setting a fixed Uq voltage to your motor will not produce stall, it will produce a movement in the same manner as setting the voltage to the DC motor does. Setting a fixed Uq voltage to the BLDC motor is the equivalent to setting a fixed voltage to the DC motor.

I am not sure if this is a question

But if you’re interested why we use -90 degrees, that is simple. Because when we set a current/voltage to the BLDC motor at -90 degrees electric, it will produce a movement in its rotor that will align to the motor’s 0 electric angle.
Magnetic force induced in the rotor is proportional to the sine of the angle \theta between the induced field of the coils in the stator and the permanent magnets in the rotor:

F \sim \sin \theta

When the rotor magnets and the coil induced filed is aligned (\theta=0) the force on the rotor is F=0 and the motor will stay in that position.

Hi @FOCLearner. Welcome.
I’m struggling to understand some of what you are saying.
What do you mean by ‘Motor Stall’? The chart looks more like ‘motor setup’ with a bit of ‘motor theory’ thrown in. To use SimpleFOC you don’t need to know the details of Park+Clarke.

Are you particular interested in ‘motor stall’ i.e when a motor no longer has enough current/torque to rotate?

Are you asking about the capabilities of SimpleFOC or do you have a problem with using SimpleFOC?
The docs are very good place to start - perhaps you are interested in some of the theory (e.g. Park+Clarke)

To try to answer your question. Assuming you’ve configured your motor/driver - you can set SimpleFOC to ‘position control’ mode and set motor to a specific mechanical or electrical angle. When in this ‘hold’ position - each phase in the motor will be at a fixed duty cycle (equivalent to a fixed voltage). In open loop mode (without sensor) you may well be able to overcome the motor position and it may end settling at the same electrical angle but on a different pole. In closed loop (e.g. using magnetic sensor attached to shaft) - the motor will return to the original position after you stop trying to turn the motor.

It is quite possible that I’ve misunderstood your questions. Please feel free to elaborate and we can try to help more.

Thank you for replying sorry i could not ask the questions more clearly. I am referring to the document TI and mainly related to the pages from 14 - 16 where he was referring to the start of the motor. I wanted to know the motor initial alignment procedure that is what i created the flow chart, at present i am mostly trying to understand the theory before i start the source code. I will start a different thread for additional questions, but i think i have understood the point what is explained by both of you. Thank you once again.

The document you are referencing is a good guide to how Texas instruments does foc on a dsp that they sell. Are you asking us to comment on that, or just general principles about how electrical/mechanical aligment typically works?

Antun wrote an excellent response on how simplefoc does the electrical to mechanical angle alignment here:

If you have an absolute sensor then this init only needs to be done once and the alignment angle can then be stored for future mcu boots.
The init can also deduce the number of pole pairs of the motor and the ‘natural direction’ of the motor.