Go to start of banner

# Introduction

This technical note deals with the sensorless speed and position estimation of a Permanent Magnet Synchronous Motor (PMSM) with surface-mounted magnets.

First, the note introduces the different categories of sensorless methods. Then, the general principles of a Sliding-Mode Observer (SMO) are introduced.

A possible implementation of an SMO is presented and validated in simulation. It is intended to be re-usable with

Finally some experimental results are presented to asses the practical performance of a complete sensorless Field-Oriented Control.

# Software ressources

Context

## Sensorless control of a PMSM

Common control techniques for a Permanent Magnets Synchronous Machine (PMSM) such as Direct Torque Control (DTC) or Field-Oriented Control (FOC) require the knowledge of the rotor position and/or speed.

By definition, the position and the speed of the rotor are linked by the relation:

At least one of these two quantities must be known. The speed and/or position of a rotational machine can be measured with an encoder, a resolver or a tacho-generator. However, these devices increase the cost, the risk of failure and the mechanical complexity of the drive system.

In order to avoid the drawbacks of the aforementioned measurement devices, the position and speed of the rotor can be estimated from electrical measurements only. In this case, the machine is said to be sensorless. To be clear, sensorless only implies that there is no speed/position sensor: there is still a need for electrical measurements on the stator to deduce the speed/position of the rotor.

There are two families of sensorless methods: high-frequency component injection and SMO-based techniques. Thus, the two following sections briefly present these families and justify why this technical note focuses on a Sliding-Mode Observer (SMO).

## High-frequency component injection

A first way to estimate the speed and position is to use a high-frequency component injection method, as described in [1]. Essentially, the drive injects a high-frequency voltage component into the stator of the machine. If the frequency is high enough (several hundreds of Hz), the associated torque is null on average because the inertia of the machine prevents it from moving. As the maxima of the associated current vector are related to the alignment of the voltage vector with respect to the axes, the position of the rotor can be inferred from the high-frequency current amplitude. An example of implementation is presented in [1]. This kind of sensorless techniques are mainly aimed at PMSMs with interior magnets (IPMSM) because their anisotropy simplify the detection of the current maxima.

Let us consider the case of a PMSM with surface mounted magnets (SPMSM). In theory, the machine is isotropic and it is impossible to differentiate the d and q axes by looking at the current maxima. However, in reality, a PMSM is never truly isotropic. At the junction between two magnets, the magnetic flux tends to pass directly from one magnet to the other, rather than passing through the stator windings [2]. Therefore, the flux near the junction does not contribute to the torque generation. As a result, the rotor is always anisotropic, even if the magnets are surface mounted.

Theoretically, this would allow to use the high-frequency component injection method with an SPMSM. However, it is not trivial in practice to exploit this small anisotropy. Since this technical note focuses on SPMSM, high-frequency component injection methods are not well-suited.

## SMO-based sensorless techniques

The second family of methods relies on a Sliding-Mode Observer (SMO). SMO-based techniques start from the following observation: in a synchronous machine, the frequency of the counter electromotive force (back EMF) is directly linked to the rotor mechanical speed. Therefore, if one can determine the frequency of the back EMF - say with a PLL - the angular speed of the rotor is then:

where $//$ is the number of pole pairs, and where $//$ and $//$ are, respectively, the mechanical and electrical angular speed. However, there is a catch: the back EMF is not observable. Therefore, it must be estimated. A common way to achieve this is to use a Sliding-Mode Observer (SMO) due to its simplicity of implementation and its robustness to parameter variations. Some applications of the sliding mode control for electric drives are presented in [3].

Unlike the high-frequency injection methods, sliding-mode observers exist in several variants that are suitable for both SPMSMs [4] and IPMSMs [5]. Therefore, it makes sense to consider an SMO in this technical note rather than high-frequency injection methods.

###### Block diagram of an SMO-based sensorless control for a PMSM

The aforementioned SMO-based techniques suffer from a major flaw: the amplitude of the back EMF is proportional to speed of the rotor which means that at low speed, it is difficult to estimate the back EMF accurately. In particular, at standstill there is no back EMF at all, which makes it challenging to start the PMSM in the first place.

Since SMO-based sensorless techniques are not suitable for low speed control, there is a need to accelerate the PMSM until it reaches a rotational speed "high enough" to get an accurate speed estimation. What is deemed "accurate enough" depends on the application, therefore there is no strict criterion for the minimal operating speed.

The current technical note focuses only on the speed and position estimation with a Sliding-Mode Observer. The technical note TN137, however, presents a complete sensorless Field-Oriented Control implementation with a sliding-mode observer.

# General principles

## Sliding Mode Observer

The purpose of the sliding mode observer is to estimate the back EMF. At this end, the first step is to identify the back EMF in the model of a PMSM. Let us consider the voltage balance equations at the stator and the expressions of the stator flux in the synchronous reference frame (SRF) [4]:

$//$, $//$ and $//$ are the stator phase voltages, phase currents and flux. $//$ and $//$ are the stator phase resistance and inductance. The rotor flux $//$ is constant and set by the permanent magnets. The equations are expressed in the stationary reference frame and $//$ is the position of the rotor in electrical radians.

After a few manipulations, (3) can be re-written as:

where $//$ is the back EMF. The rotor angle can be directly derived:

In (4), the unknown is $//$ and $//$ is its derivative, according to (1). $//$ and $//$ are measurable but the back EMF must be estimated in order to solve (4).

Here is common way to estimate the back EMF with a sliding mode observer [4]:

1. Compute an estimation of the current $//$ from (4)

2. Compute the estimation error $//$

3. Use the error as the input of a switching function [3] and multiply it by a finite gain in order to ensure the stability of the observer. The system is stable if the gain of the switching function meets the condition $// \max(|e_{\alpha}|, |e_{\beta}|)\end{array} //]]>$ [4].

Thanks to the feedback of the estimation error, the output of the switching function is a PWM-like signal $//$ that approximates the value of the back EMF. The SMO is robust against parameter mismatch since the feedback will automatically adjust the output of the switching function in order to obtain the value of $//$ that corresponds to the actual measured current.

The state variable $//$ is forced to “slide” towards the desired value $//$ by the control action of the switching function, thus the “sliding mode control”.

## Switching function and chattering effect

A basic switching function for the SMO is $//$ [4]. The output signal $//$ obtained with the sign function is highly discontinuous. Common control techniques such as DTC and FOC are based on continuous functions, which means that they cannot handle effectively the high frequency components of a discontinuous signal. Their control bandwidth is too narrow for that [3]. The excitation by the high frequency components leads to oscillations in the control: this phenomenon is called the chattering effect [3].

A first way to mitigate the chattering phenomenon is to use a low-pass filter (LPF) [4]. A first order LPF introduces a delay (i.e. an error on the estimated angle) that must be compensated [6]. If $//$ is the cut-off frequency of the filter, the compensation term is:

A second way to mitigate the chattering effect is to use a continuous switching function. The so-called sigmoid function is a continuous approximation of the sign function and can be used in SMO algorithms [4].

The parameter $// 0\end{array} //]]>$ defines the smoothness of the transition between $//$. Since the gain of the sigmoid function is smaller than 1 in the transition region, the stability condition of the SMO becomes $//$. The parameters $//$ and $//$ can be adjusted manually by comparing the real and estimated back EMF in simulation, for instance.

## Speed and position estimation

The position of the rotor can be computed directly from the back EMF, according to equation (5). From (1), the speed is then obtained by taking the derivative of the rotor angle. Since the output of the $//$ function is a sawtooth signal, the estimation of its derivative around the discontinuities needs special care, as explained in PN104.

The $//$ method is sensitive to noise because it computes the position directly from the estimated back EMF. A better alternative is to use a PLL since it has a low-pass characteristic by construction. Since the estimated back EMF from the SMO has αβ components in quadrature, a Q-PLL is particularly suitable.

In a PLL, the position of the rotor is obtained by integration of the speed, according to (1). However, the integrator introduces a constant phase error of $//$ that must be compensated.

## Effects of the position estimation error

The electrical angle is used by vector control methods to determine the position of space vectors in the synchronous reference frame (SRF), or to align the rotating reference frame (RRF) with the rotor flux. Therefore, an estimation error on the position will have an effect on the performance of the vector control.

In the case of a Field-oriented control (FOC), the stator current space vector is usually kept aligned on the q-axis to maximize torque production. However, if the estimated position of the RRF is wrong, the current will have a non-zero d-axis component and a smaller q-axis component. The q-axis error will be compensated by the speed controller, while the d-axis error will decrease the torque production per ampere and have an effect on the drive efficiency.

In the case of a Direct Torque Control (DTC), the rotor position is only used to determine in which sector the stator flux is located. The DTC selects the switching vector to apply from a lookup table, depending on the sector. If the rotor position is affected by an estimation error, the DTC may detect the wrong sector and thus, apply a sub-optimal switching vector.

In the case of a sensorless control, the error on the position estimation may come from the SMO, the optional LPF or the PLL. The delay due to the LPF or the integrator can be computed and compensated as in equations (6) and (8).

# B-Box Implementation

A speed and position estimation based on a sliding-mode observer alone is not sufficient to control a PMSM because it cannot handle startup and low-speed operations. Therefore the Simulink model provided in this technical note is intended to be used in simulation only: a PMSM is driven by an ideal speed source and the estimated and measured speed/position are compared.

The technical note TN137: I-f startup for sensorless PMSM control presents a complete sensorless Field-Oriented Control implementation with a sliding-mode observer. More experimental results are available in this note.

### Plant model

In the Simulink implementation, the PMSM was modeled using the PLECS Blockset. The PMSM is driven by an ideal speed source in order to avoid the problematic of startup and low-speed operations. The machine is connected to a balanced resistive load and operates in generator mode.

### Overview

The figure below shows an overview of the sensorless speed/position estimation. The estimated back EMF is filtered with a 2nd order low-pass filter. The cut-off frequency was chosen empirically to 60 Hz. The speed and position are estimated with both the $//$ method and a Q-PLL for comparison purpose.

The gains of the PI controller inside the Q-PLL were determined empirically. Since the PI is of the first order, it has a permanent tracking error when the speed of the machine is not constant. The tracking error can be reduced by using the speed reference as the centering frequency of the PLL.

### Sliding mode observer

The back EMF is estimated with a sliding mode observer. The switching function is a sigmoid in order to reduce the chattering effect.

In a practical application, the machine would most likely be driven by an inverter. In this case, the stator voltage is not measurable because it is a switched signal. Instead, the SMO would use the voltage reference of the inverter.

### Arctan method

With this first method, the rotor angle is directly computed from the estimated back EMF with the $//$ function. Then, the speed is obtained by taking the derivative of the position, according to (1). With this approach, however, the accuracy of the discrete derivative depends strongly on the discretization period: the longer the period, the more inaccurate it becomes. This undesired effect can be mitigated by filtering the result of the derivative. For the proposed implementation, a low-pass filter with a 1kHz cut-off frequency was added.

### Q-PLL

With this second method, the rotor angle is computed with a Q-PLL. Notice that the PLL uses floating point variables with double precision, whereas the rest of the control is in single precision. The goal is to avoid truncated results due to the limited precision of single precision variables.

# Simulation results

### Machine parameters

The sensorless estimation was validated in simulation using the following PMSM parameters.

 Model: Control techniques 095U2B300BACAA100190 Parameter Value Unit Rated power 1.23 kW Pole pairs 3 - Rated phase voltage 460 V Rated phase current 2.7 A Rated mechanical speed 314 rad/s Rated torque 3.9 Nm Stator resistance 3.4 Ohm Stator inductance (d and q axis) 12.15 mH Flux from permanent magnets 0.25 Wb Moment of inertia (PMSM only) 2.9 kg cm2

### Test conditions

• Load torque: PMSM with 200 Ω resistive load on each phase

• Interrupt and sampling frequency: 20 kHz (unless otherwise specified)

• Speed reference: 3000 rpm

### Results

During the simulation, the speed of the PMSM is set to 3000 rpm by an ideal speed source. In addition, the resistive load is perfectly balanced. As a result, the stator current and voltage measurements required by the SMO are perfect sine waves. Under these ideal circumstances, the estimated back EMF practically fits the true back EMF, as shown below. The estimated back EMF is inevitably lagging behind the true value by design: the sliding-mode observer must first observe an error on the current estimation and then adjust the output of its switching function. In the experimental validation presented in TN137, the feedback is delayed by one control period.

In reality, the back EMF estimation by the SMO is also affected by the noise on the current measurements. As a result, it still necessary to filter the back EMF estimation, even if the chattering effect is already attenuated by the sigmoid function. The 2nd order LPF used by the control attenuates the amplitude of the estimated back EMF. However, it does not affect the speed estimation by the Q-PLL since only the frequency of the signal is relevant.

The difference between the measured and estimated speed/position is negligible, as shown below. This is true for both the $//$ and Q-PLL methods.

# Experimental results

The simulation is not very realistic because in practice the speed control is not perfect and the measurements are affected by noise. The following figure shows the speed estimations obtained experimentally with the complete sensorless field-oriented control implementation from TN137. The peak estimation error at nominal speed is in the order of 6% with the Q-PLL and 8% with the $//$ method. Qualitatively speaking, the PLL estimation is also "smoother" than with the $//$ method. The difference can be explained by the measurement noise on the current measurements: the PLL has a low-pass filter characteristics that partially attenuates this noise, whereas the $//$ method has no filtering at all. Therefore, even if the $//$ method seems to offer similar performance to the Q-PLL, the Q-PLL is more appropriate in practice due to it better immunity to measurement noise.