Renesas
Field-Oriented Control with Clarke and Park Transforms
-
Question 1 of 12
What problem does field-oriented control solve?
Reveal answerA brushed DC motor is easy to control. One current sets the magnetic field, and another sets torque. A permanent magnet synchronous motor, or PMSM, is harder. Its three currents are sine waves that have to stay lined up with a spinning rotor. Field-oriented control, or FOC, uses two math steps to split those currents into one part that makes torque and one part that sets the field. Each part can then be controlled on its own, just like a DC motor.
Renesas walks through a complete FOC design in its encoder vector control application note. It covers vector control software for a PMSM on RA MCUs (R01AN6841EJ0122, Section 1, p. 5).
-
Question 2 of 12
Why do you only need to measure two of the three currents?
Reveal answerA three-phase motor has three windings called U, V, and W, or a, b, and c. When the motor has no neutral wire, the three currents always add up to zero.
ia + ib + ic = 0
That means if you know two currents, you can calculate the third.
ic = −ia − ib
Measuring only two saves a sensor and an amplifier.
The FSP Motor Driver module handles this measurement in Renesas firmware. It supports one-, two-, or three-shunt current sensing, with two shunts as the default (FSP v6.6.0 User’s Manual, Motor Driver module, Features and Configuration).
-
Question 3 of 12
What does the Clarke transform do?
Reveal answerThe Clarke transform turns three currents into two. Because the three currents always sum to zero, two values hold all the information. The two new values are called alpha and beta, and they sit at right angles. With two measured currents, the math is short.
iα = ia
iβ = (ia + 2 × ib) ÷ √3Alpha and beta are still sine waves. The next step fixes that.
The flying start sensorless application note shows this step. It calculates iα and iβ from the three phase currents, which Renesas labels iu, iv, and iw (R01AN8230EJ0100, Section 7.10, p. 52).
-
Question 4 of 12
What does the Park transform do?
Reveal answerThe Park transform rotates alpha and beta to line up with the rotor. It uses the rotor angle, written as θ. The results are called d and q.
id = iα × cosθ + iβ × sinθ
iq = −iα × sinθ + iβ × cosθHere is why that matters. Viewed from the spinning rotor, the currents stop changing. A sine wave becomes a steady number. Steady numbers are much easier for a controller to hold on target.
The flying start application note builds its current control around this. The current control function performs coordinate transformation and feedback control on the measured currents (R01AN8230EJ0100, Section 7.6, p. 44).
-
Question 5 of 12
What do Id and Iq mean?
Reveal answerIq is the current that makes torque. Id is the current that strengthens or weakens the magnetic field. In most permanent magnet motors, the magnets already supply the field. So Id only adds heat, and controllers usually hold it at zero. At very high speeds, a small negative Id weakens the field so the motor can spin faster. This is called field weakening.
The FSP Motor Speed module turns a speed command into targets for Id and Iq. It also includes an optional flux weakening feature for high-speed operation, which is off by default (FSP v6.6.0 User’s Manual, Motor Speed module, Features).
-
Question 6 of 12
Can you walk through an example?
Reveal answerSay the sensors read ia = −1.0 A and ib = 2.0 A. The rotor angle is 30 degrees.
Clarke step:
iα = −1.0 A
iβ = (−1.0 + 4.0) ÷ 1.732 = 1.732 APark step, using cos 30° = 0.866 and sin 30° = 0.5:
id = (−1.0 × 0.866) + (1.732 × 0.5) = 0 A
iq = (1.0 × 0.5) + (1.732 × 0.866) = 2.0 AAll 2 A goes to torque, and none is wasted on the field. That is exactly what an FOC controller aims for.
You can watch these values on real hardware with Renesas Motor Workbench. Its Analyzer tool reads MCU variables while the program runs and shows them as live waveforms (R21UZ0004EJ0421, Section 1.1, p. 1).
-
Question 7 of 12
Why does the rotor angle need to be accurate?
Reveal answerBoth transforms depend on θ. If the angle is wrong, some torque current gets counted as field current. Here is the same example with a 10-degree error, using 40 degrees instead of 30.
id = 0.35 A
iq = 1.97 AThe controller thinks there is field current that isn’t really there. It pushes that value toward zero, and the real current drifts off target. The motor loses torque and wastes energy.
In the encoder vector control application note, the rotor angle comes from an encoder. The firmware adds up the encoder pulses counted between interrupts to track the angle (R01AN6841EJ0122, Section 7.6.1, p. 43).
-
Question 8 of 12
How does FOC work without a position sensor?
Reveal answerA spinning motor produces a voltage of its own, called back electromotive force, or back-EMF. Sensorless FOC estimates the rotor angle from that voltage. Back-EMF is very small at low speed, so it is hard to measure there. Sensorless systems usually start the motor without feedback and switch over once it is moving fast enough.
The flying start application note shows this handoff. A back-EMF observer estimates rotor position at 600 rpm and above, and open-loop control covers lower speeds (R01AN8230EJ0100, Section 7.11.1, p. 54).
-
Question 9 of 12
How does the controller hold Id and Iq on target?
Reveal answerFOC uses two proportional-integral, or PI, controllers. One compares the measured Id to its target. The other does the same for Iq. Each one outputs a voltage command that pushes the current toward its target. Because the targets are steady numbers, the PI controllers can remove the error completely over time.
The FSP Motor Current module runs this current control loop. It calculates each phase voltage from the current target, the measured current, and the rotor angle. It also includes decoupling control and voltage error compensation to improve accuracy (FSP v6.6.0 User’s Manual, Motor Current module, Overview and Configuration).
-
Question 10 of 12
How does the controller turn its commands back into motor voltages?
Reveal answerThe PI controllers output voltages in the rotating d and q frame. The motor needs real voltages on its three wires. Two reverse steps get them there. Inverse Park rotates the voltages back to alpha and beta. Inverse Clarke turns alpha and beta into three phase voltages. A PWM method then sets the switching pattern for each phase.
The FSP Motor Driver module converts the phase voltage commands into a PWM duty cycle for each phase. It offers space vector PWM, or SVPWM, and sine PWM, with SVPWM as the default (FSP v6.6.0 User’s Manual, Motor Driver module, Features and Configuration).
-
Question 11 of 12
How fast does the control loop need to run?
Reveal answerThe current loop usually runs once every PWM cycle. At 20 kHz, that gives the processor 50 µs to do everything. It has to read the currents, run both transforms, update both PI controllers, run the reverse transforms, and set new duty cycles. On a 100 MHz processor, 50 µs is 5,000 clock cycles.
The encoder vector control application note gives real numbers. It lists a 20 kHz carrier frequency with a 50 µs current control period on the RA6T2, RA6T3, RA8T1, and RA8T2. The RA4T1 uses a 100 µs period (R01AN6841EJ0122, Section 9, Table 9-1, p. 56).
-
Question 12 of 12
How does MCU hardware make FOC affordable?
Reveal answerThe slowest part of FOC is trigonometry. The transforms need sine and cosine every cycle, and sensorless designs often need arctangent too. Doing that in software eats up processor time. A trigonometric function unit, or TFU, does this math in dedicated hardware. That frees the CPU and lets lower-cost chips run FOC.
The RA4T1 datasheet lists a TFU that calculates sine, cosine, arctangent, and vector length (R01DS0415EJ0140, Table 1.10, p. 4). The RA6T2 datasheet notes that its TFU can calculate sine and cosine at the same time (R01DS0400EJ0150, Table 1.10, p. 5).