This page is one of the first results that pops up on Google when searching the difference between FOC and sinusoidal but I think, while well intentioned, there’s some issues that warrant clarification.
-
There is no such thing as “trapezoidal FOC” or “Sinusoidal FOC” (as far as I’m aware). Trapezoidal control is what you seem to refer to as “BLDC commutation”. Although VESC tool refers to trapezoidal control this way, I think most EE’s would be confused by this term as it’s almost universally referred to as trapezoidal control.
-
The difference between trapezoidal and sinusoidal/FOC is that, in sinusoidal/FOC, you generate a “smooth” current waveform which creates less torque ripple and noise. In contrast, trapezoidal generates some strange shaped current waveforms. In theory, a lot of people draw them like modified square waves but in practice I usually find that they look more like curly "w"s.
-
The difference between sinusoidal control and FOC is that sinusoidal control controls phase current whereas FOC applies coordinate transformations to control “direct” and “quadrature” current.
Allow me to make a more organized comparison:
There are 3 primary methods of BLDC motor control:
- Trapezoidal - this is the easiest. It’s just a lookup table: for some hall sensor reading, apply a high voltage to one phase, low voltage to another phase, and float the third phase. Which phase gets what depends on the hall sensor readings. laurnts got this mostly correct. It only changes every 60° (I think he mistakenly said 45° but more or less the right idea. The reason there’s only 6 states and not 8 even though there’s 8 possibilities for 3 binary values is because two possibilities: 000/111 should never occur).
- Sinusoidal - this requires a continuous rotor angle estimate so rather than just knowing within 60° what the rotor angle is, you need to actually know exactly how many degrees the rotor angle is. Then, it’s basically a “look up table” again where, whatever the rotor angle is, there’s a specific current that each phase should be at and you try to make the currents match what they should be. The “look up table” in this case is actually just a sine function shifted in time.
- FOC (also called flux vectoring and variants of that) - laurnts actually got this pretty close to correct. You also need a continuous rotor angle estimation here. You use that in the Park transformation. In FOC, first you transform the 3 measured phase currents into a 2D representation using the Clarke transform (yes, linear algebra but it’s super simple I promise). Then, you transform these into a rotating coordinate frame with the Park transform using the rotor angle. This gives you a d and q component of the current (direct and quadrature). The q component represents the current which produces motor torque and the d component is the “flux” component. For now, we can just pretend the d current is “wasted” power. In actuality it becomes important for something called field weakening, but many motor controllers don’t implement this because it can cause states that are impossible to recover from without breaking your electronics if you aren’t careful. Anyway, in FOC we try to make the d current = 0 and make the q current = some user controlled value. To do this, we apply voltages in the d and q directions, use the inverse Park to get back to a non-rotating reference frame, then use the inverse Clarke to get to the three phase wires and finally we have the voltage we need at the three phase wires. Also I’ll quickly mention that the Clarke, Park, and their inverse transformations are actually really simple - just a couple multiplications and divisions and a sine/cosine here and there. Compared to Laplace and Z-transforms, they’re easier than cake.
Now as for “commutation” vs “PWM”, there’s some misunderstandings here. Almost every motor controller will use PWM. PWM just means, if you have a 10V battery but you need 5V, the way you do it is by turning the MOSFET on half the time and off half the time and switch on/off really really fast… On average, you get 5V. Trapezoidal control uses PWM so that you don’t have to go full throttle all the time. Sinusoidal and FOC use PWM to generate their roughly sinusoidal voltage waveforms which in turn generate roughly sinusoidal current waveforms. The difference between trapezoidal commutation and the other two is that trapezoidal commutation only changes voltages every 60° whereas sinusoidal and FOC is changing voltages continuously, but they all use PWM to generate voltages smaller than the battery voltage.
Finally, the last thing which wasn’t discussed in laurnts post but which I think is maybe what he was getting at calling trapezoidal FOC is the types of sensors you can use to apply these control schemes. There’s 4 main ways to sense rotor position:
- sensorless - you can read the back-emf of the phase wires to figure out the position of the rotor. Generally you get 60° resolution and it’s offset from the proper trapezoidal commutation by 30°.
- hall sensors - you get 60° resolution and it matches up correctly with the proper trapezoidal commutation.
- encoder - usually black/white lines and a light sensor that allow you to measure the rotor position to within, say, 1/4096 of a revolution. Some are better some are worse. With a bit of coding, these can give you the rotor position to within the resolution of the encoder. There also exist magnetic encoders, potentiometers, and probably some other encoders I’m forgetting about.
- resolver - I don’t totally understand how these work but it’s some magic with injecting a current and measuring the magnetic response or something weird like that. These are incredibly robust and accurate but they’re ridiculously expensive and difficult to install. Almost certainly out of the range of hobbyists.
Any 4 of these sensor methods can be used with trapezoidal, sinusoidal, or FOC!!! Though if using 1 or 2 for sinusoidal/FOC, you need to do some coding/math to extrapolate the rotor position in between the 60° resolutions.
In addition to rotor angle sensing, sinusoidal and FOC also require phase current sensors. These are usually pretty straightforward and inexpensive to include on a motor controller.
Regarding practical implementation considerations, FOC will always be superior if it has perfect PWM and perfect angle estimation, but PWM in the real world causes losses/noise and angle estimation is heavily dependent on the sensor you’re using. If you don’t have any sensors (sensorless) or use hall sensors, FOC will probably be pretty bad at low speeds because extrapolating position at low speeds from the 60° resolution of these methods is pretty hard. Stick with trapezoidal at low speeds if you have hall sensors. If you’re running sensorless, you need to run in “open loop” at low speeds but I’m pretty sure benjamin has already handled the hard work for you if you just use “sensorless” in the BLDC tab (I’m skeptical of sensorless and hall FOC at low speeds, I don’t use FOC unless I have an encoder). If you’re using an encoder, FOC should be superior at any speed unless the motor control hasn’t been coded optimally (but the VESC firmware is coded very well).
So, to sum up, there are 3 primary BLDC motor control schemes: trapezoidal, sinusoidal, and FOC.
All of these control schemes use PWM (though technically trapezoidal doesn’t require it, it’s almost always used to give throttle control as opposed to just on/off).
Each of these control schemes can use sensorless, hall sensor, encoder, or resolvers methods to detect rotor position, but in practice sinusoidal and FOC are pretty crap without an encoder or resolver.
edit: by the way, in terms of my qualifications, I’m about to finish my undergrad as an ECE major and I handle the electronics for the Duke Electric Vehicles team so I work with BLDC motors extensively. Feel free to reach out to us on our website, Facebook, or email (dukeecomarathon@gmail).
I hope I was able to set the record straight on some of these terminologies and help people figure out the differences between the different control schemes.