Let me try to explain the limiting bit more in detail.
Our BLDC motor is a electric motor which has only one type of input the voltage
V. In the particular base of the BLDC, we have three phase voltages
Vc which create the voltage vector
V. This vector is calculated as as vector sum of the three phase voltages and its calculation is based on park and clarke transformations in most cases. In general voltage vector
V will rotate in its coordinate system with the same velocity as the physical rotation velocity of the motor and will be aligned with the physical rotor angle the whole time in order to produce the torque. But once when you have calculated your
V you can imagine it as a DC motor voltage. And the behavior of the BLDC voltage in the voltage torque mode will be exactly the behavior of the voltage controlled DC motor.
The maximal dc voltage we can set to the motor phases is the power supply voltage
driver.voltage_power_supply and additionally we can limit this value in the driver
driver.voltage_limit . The
driver class will make sure then that it never surpasses the
driver.voltage_limit value on its outputs , for any phase
Vc. Driver does not know anything about our voltage vector
V, it only knows the voltages it has to set on its phase outputs. Here is how it looks, this is an image from the docs.
In the BLDC motor class, during the FOC calculation, we can limit the voltage vector magnitude
V using the variable
motor.voltage_limit. This limit is a bit different to the one in the driver because this one limits the dc voltage we set to the motor and the driver one limits the phase voltages, as shown on the figure.
In general since the phase voltages
Vc and sinusoidal the maximum voltage vector magnitude
V can be
driver.voltage_limit/2. You can see a bit more docs on this subject in the botom of this docs page.
So the rule of thumb is to use
driver.voltage_limit if you are really unsure of your motor parameters and use this variable as a safety feature in order to guarantee that not just your voltage vector magnitude
V but also phase voltages
Vc will not surpass certain value.
But in most cases you will not need to set this variable and the limit will be:
In those cases you will be setting the voltage vector magnitude
V limit using
Now we have already discussed that what you really want to limit is the current, not the voltage. But if you are not measuring the current there is no way you can limit it in real time. The only way you can limit is is to limit the voltage vector magnitude
V to the value that you are sure that it will no generate currents higher than the value you wish it to be. The current of the electric motor can be written as:
I = (V - Vbemf)/R = (V - k*vel)/R
V is our vector magnitude,
R is phase resistance and
Vbemf is the back emf induced voltage due to the motor rotation. And the back emf can be calculated using the motor emf constant
k and the current motor velocity
You can see in the formula that the back emf is proportional to the velocity and you can also see that current will decrease with velocity. This means that your current for a given voltage vector
V will be maximal if your motor is not moving
vel=0. And maximal current will be:
I = V/R
So a rough rule can for current limiting, to a certain value
I_max, is to limit the voltage vector
V to the value:
motor.voltage_limit = I_max*R; // Volts
Finally the library provides you way to use this feature automatically if you specify the phase resistance
R to the motor class. It will give you the way to use the current vector limit instead of voltage:
motor.phase_resistance = R; // Ohms
motor.current_vector = I_max; // Amps
You can find a lot more about it in the docs.