By Jia Li, Engineer, Monolithic Power Systems
Permanent Magnet Synchronous Motors (PMSMs) are widely used in electric vehicles, robots, home appliances and other products. For good dynamic response and motor performance, engineers normally use a form of vector control method to drive a PMSM.
Vector control requires a means to measure the speed and position of the rotor. Optical quadratic sensors or Hall effect magnetic position sensors are the most common types of sensor used for this function, but they are expensive components.
A promising alternative technique for driving a PMSM is to use a combination of a low-cost magnetic angular sensor and a dynamic observer to estimate the rotor speed. The motor control module from Monolithic Power Systems (MPS) implements this technique. It includes a motor-control ASIC, a magnetic angular sensor, and a three-phase MOSFET power stage and pre-drivers, all mounted on a single PCB to fit NEMA 23- and NEMA 17-format motors.
The motor-control ASIC provides excellent computation ability for applications such as electric motor drives. It works with the MA702, a 12-bit magnetic angular sensor which detects the absolute position of the rotor. The MA702 is cheaper than an optical quadratic or Hall effect sensor.
The motor’s speed can be calculated from continual rotor position measurements by a dynamic state observer. The ASIC uses the dynamic observer to filter out position measurement noise and to estimate the rotor speed, enabling the system to implement vector-based Field- Oriented Control (FOC) effectively.
The operation of FOC
Three-phase PMSM machine operation is expressed here as:
Where: v,i,and λ are the voltage, current, and flux respectively.
The subscripts a, b, and c represent the variables in phases a, b, and c. Subscript s is the stator variable, ρ represents the derivative of the certain value, and P is the number of poles in the motor.
The electromagnetic torque, Te, is produced by the three-phase current and the rotor flux. λ´m is the rotor flux sensed on the stator side of the motor. The angle θe is the electrical angle between the rotor flux and the stator’s a phase.
To perform FOC, a dynamic model under q-d is required to decouple the air gap-flux and electromagnetic torque. Following the Clarke-Park transformation, the PMSM model in equation set 1 under the synchronous rotating q-d frame is calculated with the equation:
Where: the subscripts q-d are the q-d axis variables. Ls is the self-inductance and Lm is the mutual inductance of the machine.
To further simplify control, the rotor flux should be aligned on the d-axis while there is zero rotor flux on the q-axis. The flux is calculated with the equation:
The electromagnetic torque is estimated with the equation:
Following the transformation steps performed in the four equation sets, the magnetic flux can be directly controlled by the d-axis current. With a constant ids, the torque, Te, can be controlled directly by manipulating the q-axis current. If ids = 0, then the electromagnetic torque is directly proportional to igs. Figure 1 shows the PMSM FOC technique in schematic form.
Fig. 1: PMSM FOC schematic
The outer loop reference makes a comparison with the measured variables, and feeds the error to a controller, a PI controller is the most common type, to generate the command torque current, IQref. The d-axis current reference, IDref, is set according to the magnetic flux requirement. The output of the current regulators/controllers, VDref, VQref, VDref and VQref, are the input for the space vector PWM. The PWM block generates the gate signals for the inverter to drive the motor.
Driving the motor with no speed sensor
The MA702 detects the position of a permanent magnet, θe. The speed of the rotor can be calculated as ωe = ρθe. A digital sensor, the MA702 inevitably introduces noise into the position measurement: this calls for the addition of a digital filter/estimator.
The system estimator can be based on the mechanical PMSM model using the equation:
Where: Te is the electromagnetic torque and Tl is the load torque. ωm and θm are the mechanical rotor speed and position, compared to the electrical rotor speed and position ωe and θe. ρ is the pole number of the PMSM. The parameters J and B represent the PMSM inertia and the combined viscous friction of rotor and load respectively.
The MA702 feeds the absolute rotor position to the motor-control ASIC, making the mechanical model system matrix A a simple 3x3 matrix with only two non-zero elements. A simpler system matrix helps to decrease the computation burden on the microcontroller, making the algorithm easier to implement and faster to execute.
The state variables x, Є, and Rn, are the states of a system process that can be expressed in discrete time with the equation:
Where: u is the input variable and y is the output measurement. w and v are the process and measurement noise with noise co-variance of Q and R respectively.
Following classic control theory, a state estimator with estimator gain k can be calculated with the equation:
The notation an|m represents the estimation of a at step n up to the observation of step m and m ≤ n. The carat^ denotes that the variable is estimated.
Unlike the classic state observer using a constant gain k, a dynamic observer recursively updates its estimator gain k with each iteration.
Compared to the FOC schematic shown in Figure 1, the dynamic speed observer schematic uses machine measurements as the system input, as shown in Figure 2. The dynamic observer outputs the filtered/estimated rotor speed.
Fig. 2: Dynamic observer-based FOC
Measured performance on reference motor design
To validate its algorithm, MPS measured its performance on an example motor system. The MPS Motor Control Module, designed for 57mm NEMA 23 motors, can be directly mounted on the motor, as shown below in Figure 3.
Fig. 3: The MPS Motor Control Module (left) and MPS Smart Motor (right)
Because the MA702 angular sensor feeds absolute rotor position measurements to the motor-control ASIC, the implementation of the dynamic observer’s recursive iteration is easier, and places a low computation burden on it. Since the measurement is only of one variable, the observer’s gain calculation is a simple division. The entire dynamic observer calculation takes less than 20μs for each iteration.
Figure 4 shows a wide range of reference speeds, from 1,000rpm to -500rpm, fed to the motor-control system’s simulator in step changes. The dynamic observer estimated speed can still track the motor speed accurately in real time at each different speed step. The algorithm can also give a stand-still reference.
Fig. 4: Step-speed response in real time
This article presents a promising solution for PMSM FOC based on a combination of a low-cost magnetic angular sensor and a dynamic observer to estimate the rotor speed accurately. The algorithm is implemented in a motor-control ASIC from MPS.
The MA702 angle sensor provides a high-resolution, on-board angle measurement, so the algorithm avoids the need to perform a complex inverse calculation. This eases code development and reduces the time that the ASIC spends on calculations.
Real-time validation test results show the proposed solution has good dynamic performance and is able to control the PMSM at different reference speeds.