In the Sinusoidal operation of the controller there are two set of FOC gains that must be set. The Flux FOC and Torque FOC gains.



These are the gains of two PI controllers that regulate the Flux current and Torque current of the motor.



Flux current control




The Flux current regulation is used for the sinusoidal commutation of the motor in general and ensures that the angle between the magnetic field of the stator and rotor will be at 90 degrees, so the optimal torque is provided.



More preceicely, the FOC flux gains will determine how fast the correction to any deviations from the 90 degrees will take place. These deviations can occur because of load or speed changes. A properly tuned FOC loop will keep the field difference almost always equal to 90 and this will be reflected to the Flux current of the motor that will be all the time close to zero. 




The flux current regulation takes place every time the motor rotates, so it is applicable in Open Loop, Speed, Position and Torque mode. It is enabled by setting the FOC flux gains.


Torque current control


The torque current control takes place in all Cosed Loop modes, by configuring the FOC torque gains (the Flux FOC gains should have been already configured). 



Doing so, will enable the current/torque loop, that will work cascaded with any other operating modes used. It is reminded, that in 2.1+ firmware version three control loops work cascaded to optimize the control of the motor.



By enabling the torque loop comes a big advantage. Now the motor current instead of the motor voltage will be controlled to drive the motor to the desired  speed. To understand that better, let's first have a look to the previous simple Closed Loop implementation, without having the torque loop enabled.


Implementation without Torque loop:



In the previous implementation, any occuring high speed error would lead to a rapid voltage increase that would create an uncontrolled increase in the motor current. So if the motor command was increased rapidly or if the motor speed was rapidly decreased because of an obstacle, the motor current could easily spike and reach harmful levels. 



Implementation with Torque loop:


By adding the torque loop in between, the output of the Speed loop will be the current demand, instead of voltage demand. The current will increase smoothly while being controlled by the PI regulator and will not reach harmful values for the motor or controller. The practical outcomes of enabling the torque loop is that there are less possibilities to get a high current error (short circuit error), since the current should not be allowed to reach the limit values. The motor operation will be smoother, faster and more stable.



Q & A


1. Since the motor speed is reguated by voltage and motor torque by current, how the current control can be used in the speed regulation of the motor? 


The Torque Loop is used as medium between the speed demand and the provided voltage. The controller is finally regulating the voltage but this happens by having another variable being controlled, the current. Controlling the motor current ensures that it will be kept at the safe limits during the whole operation of the motor and that it will not spike when there is a big change in the desired speed. At the end the motor will get the same voltage that is required to reach a speed as if torque loop was not enabled, but the current wil be smoother during the transition.


2. Why current control is required, since amp limiting function will already keep the current under safe levels?


The amp limit function will indeed eventually reduce the motor current at the safe limits but it this will not happen immediately. So the current is possible to spike before the amp limit acts. Enabling torque loop ensures that the current will change smoothly, by following a ramp given by the controller, instead of changing in an uncontrolled way as it would happen in the no - torque gains - closed loop operation.