# Field Oriented Control (FOC) Made Ultra Simple

Every modern motor controller for Brushless motors now features Field Oriented Control (aka Vector Drive). But what is it exactly and how does it work? One way to figure this out is to look on Wikipedia, or most other articles on the subject on the internet. There, the explanation are complete and accurate but often filled with too much math formula to actually make practical sense of it. Yet, Field Oriented Control is simple enough a concept that it can be explained in a few words and pictures: First, FOC applies to three phase Brushless Motors that are operating in sinusoidal mode. In sinusoidal commutation, all three wires are permanently energized with a sinusoidal current that is 120 degrees apart on each phase. This has the effect of creating a North/South magnetic field that rotates inside the motor cage. As shown in the figure below If a magnet is placed on a rotor inside this cage, its North and South poles will be pulled towards the South and North poles of the rotating field. Assuming for a moment that the magnetis field rotation is paused, we can see the effect of the pull on the magnet at different angular position relative to the rotating field. We can see that the maximum torque is achieve when the rotor’s magnet is 90o apart from the stator field. If the rotor magnet is aligned with the stator field, the magnet experiences a very strong outwards pull – which will burn power - but create no torque or rotation at all. All other aligments will produce some amount of non-optimal torque.

In order to make the motor turn optimally, we need therefore to know the angular position of the rotor in real time. Then apply voltage on the U V and W wires so that the magnetic field on the stator is 90degrees apart.

So going back to our example, if we measure the rotor to be at 90o, we need to create the magnetic field in the stator qt 180 degrees. The sine waves diagram shows that we must apply full negative voltage on U, and 50% voltage on V and W. Reading continuously the rotor angle, adding 90 degrees, and applying the corresponding U, V and W will make our rotor turn. But ... as typically is the case in electricity, there is a small catch: A magnetic field is created by current flowing through a coil, not voltage. And in AC circuits, current is not always in phase with voltage. Depending on the coils&#39; inductance, back EMF generated as the motor spin, and other factors, the current will be shifted more or less vs the voltage&#39;s phase as shown in the figure below. Back to our example, if the current follows the current as this chart shows, the magnetic field will not be 90 degrees apart from our rotor anymore but around 70 degrees. The rotor will not be pulled optimally. Part of the field will pull the rotor perpendicularly, thus creating torque, another part of the field will pull the rotor outwards. Since the magnetic field is the direct result of current in the coils, the current can likewise be decomposed into current that causes the perpendicular pull - called Quadrature or Torque current, and one that causes the outward pull - called Direct current or Flux current. Field Oriented Control is about measuring these two components and adjusting the phase of the voltage in order to bring the Direct current to 0, leaving only Torque current.

The figure below shows the classic representation of FOC found in all literature. Current is sensed on the motor leads. At this point the current is AC. While the field inside the stator is 3 phase rotating magnetic field, the rotor which rotates at the same speed as the rotating field sees a constant force. The Clarke &amp; Park block represent mathematical processing that, together with the angle information, that measures the Quadrature current Iq and Direct current Id &quot;as seen&quot; from the rotor point of view. Id and Iq are therefore slow-changing DC values, making them a lot easier to process by the other blocks.

Two Proportional-Integral (PI) regulators then work to control the phase and voltage to be applied to the coils so that the desired Quadrature (Iq) and Direct (Id) currents are met. The desired Direct current is typically set to 0, and so the regulator will work to totally eliminate the Direct current. The diagram below gives a simplified representation. The Direct and Quadrature current are measured from the rotor view point. The PI regulators adjust the controls to the PWM so that Direct current is eliminated and that the desired torque current is reached. Field Oriented Control produces remarkable results. Without it, in many case, current on the motor will grow to potentially very high or even damaging level, even though the battery current remains relatively low. Most of that current goes wasted in heat in the motor coils, motor wires and controller&#39;s transistors. Turning FOC on causes an immediate and automatic correction of the PWM phases and practically entirely eliminates the energy loss due to the Flux current. FOC is implemented on all Roboteq product supporting sinusoidal mode. 