Torque Ripple Reduction of PMSMs Using a Novel Angle-Based Repetitive Observer

The angle-based repetitive controller (RC) has been applied successfully in the literature for torque ripple suppression in variable speed permanent magnet synchronous machines (PMSMs). The RC is preferred because of its learning capability, which allows the cancelation of all periodic ripples from multiple sources. However, its tuning method has not yet been proposed. Since the structure of the RC is found similar to the disturbance observer (DOB), which is convenient to tune through pole placement, this paper merges the angle-based RC and DOB into a novel angle-based repetitive observer (ARO) for the first time for the torque ripple reduction in PMSMs. ARO takes advantages of its DOB structure that it can be designed separately and can easily be added into an existing control loop. Taking advantage of its RC nature, ARO can tackle a wide frequency range of torque ripple even in the presence of measurement noise. The experimental test results have confirmed the robust performance of ARO under five conditions, including the ideal integral delay, the fractional delay, the load transient, the speed transient, and the detuned mechanical parameters conditions. The execution time of the ARO is less than 10$\,\mu$s.


I. INTRODUCTION
T ORQUE ripple reduction of the permanent magnet synchronous machines (PMSMs) has been studied for decades. Many traditional methods tend to reduce the torque ripple individually caused by every possible source. For example: The cogging torque can be reduced by skewing the stator lamination stack/rotor magnetization and many other machine design methods in [1], or by tailoring the current according to pre-measured cogging torque lookup table [2], [3]. The torque ripple caused by non-sinusoidal flux distribution can be compensated by tailoring the current according to off-line measured the back-emf and inductances of the motor [4], [5]. More adaptive reduction can be achieved if the online estimations of back-emf or flux harmonics are available [2]. The torque ripple caused by inverter voltage distortion can be suppressed by the uncertainty function proposed in [6] and the position-based memory space applied in [7]. The compensation approaches above, all aim to reduce some specific sources of ripple. However, ripple caused by the mechanical imperfections (misalignment), or sensor offset/scaling error [8] are difficult to predict. In fact, torque ripple reduction can be achieved without necessarily knowing its sources, the torque sensor is neither required. The periodic nature [9] [10] of torque ripple in PMSMs facilitates the use of a repetitive controller (RC) [11] or iterative learning control (ILC) [12], [13] for ripple suppression [4], [10], [14]- [16]. One of the main advantages of using RC is that only the frequency of target ripple is required for its design. Consequently, the main challenge is to achieve torque ripple suppression under variable speed/frequency, since the frequency of target ripple would vary accordingly. It would also bring challenges to the system stability if the sampling frequency is not integer multiple of the target ripple's frequency (known as fractional delay issue [17]).
Some useful techniques of solving the fractional delay issue and making RC adaptive to variable frequency are to apply variable sampling frequency [18], to estimate on-line the ripple's frequency [17], or to implement RC in a rotor position based fashion [16] [19]. An angle-based RC is proposed in [19] for torque ripple reduction in PMSM drives at any speed and even during speed and load transients. However, the tuning method of the angle-based RC has not yet been proposed.
Besides, disturbance observer (DOB) can also be used for the torque ripple detection since torque ripple in PMSMs [20] is generally modelled as a disturbance. According to [21], the frequency of the disturbance to be estimated is usually lower than the frequency of sensor noise, such that the filter in DOB can separate the useful information from noise properly, otherwise, the DOB may amplify the sensor noise and may not be implementable. For the same reason, in [20], the cut-off frequency of the filter in DOB is set to be 100 Hz. Consequently, only the low frequency torque ripple reduction are presented. DOB can be combined with RC in different structures to tackle a wider frequency range of periodic ripple. The authors in [22]- [24] locate the RC in the feedback path. The RC is in plug-in structure in [25]. Comparison works are presented in [23], [26].
Many works tend to add RC as supplement to DOB since they are functionally different. DOB is designed for estimating the disturbance with little delay, such that the feedback loop dynamics will not be compromised in the presence of disturbance. Whereas, RC requires a longer delay before it takes action. In return, RC will have more time to filter the noisy measurements, and a higher order filter with a sharper cut-off characteristic can be used to estimate disturbances of higher frequencies. In fact, RC and DOB are structurally similar. Authors in [27] have presented that by adding a correction term to the traditional RC, the RC can be tuned by the welldeveloped pole placement method of a DOB.
The aim of this paper is to propose a novel controller that performs as effective as the existing angle-based RC, but easier to tune. Hence, instead of keeping both RC and DOB, this paper merges the angle-based RC and DOB into a novel angle-based repetitive observer (ARO). The proposed ARO can easily be added into an existing control loop without interfering with system stability. Only two parameters need to be tuned in the ARO, and its execution time is less than 10 µs. The proposed ARO and many of the existing compensation schemes all require high bandwidth current controller for tracking the potential high frequency compensation current. In this paper, deadbeat current loop is chosen because it is not only high in bandwidth, but also provides fixed time delay, and therefore easy to be compensated, whereas the PI current controller will delay different frequency differently.
In this paper, similarities between RC and DOB are reviewed in section II. DOB and RC are merged into a repetitive observer (RO) from three aspects in section III. The stability criteria and tuning method are provided in in section III. The ARO implementation will be explained in section IV. Practical issues like the delay and quantization noise in the acquisition of speed and torque are discussed in section III-V. Experimental tests in section V show that the proposed ARO is able to reduce torque ripple under a wide range of speed even with detuned mechanical parameters. High performance is maintained during the load step and the speed step.

II. REVIEW OF SIMILARITIES BETWEEN RC AND DOB
This section aims to confirm the similarity between RC and DOB for the application of torque ripple reduction in PMSMs. Considering the control diagram in Fig.1, where, the plant for the PMSM drive system is simplified as the torque control loop P 1 (z) and the mechanical plant P 2 (z). Assuming a deadbeat current controller as presented in [28] is used, the dq-axis currents of the PMSM can reach the current references after one sampling period delay. Therefore, P 1 (z) equals z −1 . P 2 (z) can be expressed as in (1), where, the mechanical parameters B and J are the friction factor and the moment of inertia respectively, T s is the sampling period. The disturbance observer can be designed as below.
The plant is a single input single output (SISO) model. The input is the torque reference T ref e , and output is the mechanical angular speed ω m . T d is the disturbance torque, and it can be observed from the state space equation (2) for the plant and disturbance model.
where a 21 = a 23 = T s /J, a 22 = 1 − BT s /J. a 33 can be derived from the disturbance model, which will be discussed in the next section.
In fact, T d (k) can be estimated using the other two available states in (2), where T e (k) tracks the previous value of the torque reference thanks to the deadbeat current loop, so . ω m (k) is assumed to be directly measured here to simplify the problem, and the acquisition of speed will be discussed later in section IV-A. Hence, equation (3) is obtained by reordering the T d portion in (2).
The disturbance observer equation is derived as below, where L is the observer gain.
(a) the basic DOB in Fig. 1 (b) the traditional time-domain RC Equation (4) can be drawn in Fig.2a. As illustrated, the shadowed part of Fig.2a shares the same structure with the traditional RC drawn in Fig.2b. The input of RC is normally an error/ripple signal E(z), and its output Y (k) is a compensation action applied to the control plant for cancelling the target ripple in the plant. The length of the delay chain N is defined as the closest integer to the ratio between the period of the target ripple and the sampling period T s , such that, N samples are taken in every ripple period. The robustness filter Q f (z) affects the amplitude response of the RC at the target ripple frequency and its integral multiples. It needs to be tuned considering the trade-off between the robustness of RC against noises and the ripple rejection performance. In this paper, Q f (z) is selected to be a simple gain Q from zero to one, called forgetting factor. The stability filter G f (z) is used to compensate any phase shift (i.e. time delay) between the output Y (k) and the target ripple, such that they can cancel each other. It is called the stability fitler because, at worst cases, the misalignment between the output Y (k) and the target ripple leads to system instability.
On one hand, the tuning method of DOB is well established. On the other hand, RC is excellent in terms of periodic disturbance rejection, but relatively difficult to tune. If we can increase the dimension of the disturbance state T d to resemble the long delay chain z −N in the RC, update a 33 to include the robustness filter, and design the control law K to resemble the effect of the stability filter, it is possible to design and tune the RC as a DOB. These three modifications will be presented in section III.

III. MERGING DOB AND RC INTO RO
Following the previous discussions, this section proposes the time-domain RO by merging the DOB and RC from three aspects in the following subsections.

A. Plant and Disturbance Models
In RC, the delay chain z −N is equivalent to a memory chain which records the previous period of the target ripple waveform by N samples. In state space model, one sampling period delay can be modelled using one state [29]. Therefore, the disturbance is modelled using N states as in (5). The block diagram of the disturbance model is drawn in Fig.3, where, the active disturbance torque T d applied to the plant equals X d1 .
Substituting the state T d in (2) with the N states vector X d in (5), the updated PMSM plant and disturbance model can be expressed as in (6). a 33 and C d are defined in (5).

B. Equation for RO
Following the updated disturbance model in (6), the disturbance observer equation (4) can also be updated into (7), where, the dimension of the observer gain L increases from one to N . (8) can be derived. For comparison, transfer function of the traditional time-domain RC in Fig.2b is written in (9).
Comparing (8) and (9), if we regard the term [X d1 (k) − X d1 (k)] in the observer as the error input E(k) of the RC, we can see that the gain La 23 is equivalent to the gain L rc with increased dimension. The forgetting factor Q in (9) and a 33 in (8) can merge intoã 33 as in (10).
Combining (7) and (10), the equation of RO is as in , such that the disturbance in the current loop is also included in the observed disturbance torque. Equation (11) will be applied in the ARO implementation in section IV.

C. Stability Criteria and Tuning Method
Considering the speed loop control diagram in Fig.4, where, the RO gradually learns and cancels the disturbance, while the Proportional Integral (PI) controller is used to ensure transient dynamics. The control law in Fig.4 can be written as in (12).
It is worth noting that the effect of the delay P 1 (z) = z −1 should be considered in the control law. Therefore,T d (k) should be designed to cancel T d (k + 1). It can be known from Fig.3 and (5) that T d (k + 1) = X d2 (k). Hence, the control law can be translated asT d (k) =X d2 (k), and K in (12) can be derived as in (13).
The overall state space model of the speed loop in Fig.4 can be expressed as in (14), where the total number of states are (2N + 3) (including N states in X d and N states inX d ).
The dynamics of the speed loop and of the RO can be tuned now by choosing the eigenvalues of the matrix Φ. Hence, the gains K I , K P for the PI controller, the repetitive observer gain matrix L and the forgetting factor Q inã 33 can be tuned.
Given the (2N +3)×(2N +3) unity matrix I 2N+3 , the N × N unity matrix I N , the 3 × 3 unity matrix I 3 , the eigenvalues of the matrix Φ can be solved by the characteristic polynomial in (15), where, Φ p is the "plant portion" of Φ, i.e. the portion without the disturbance and disturbance observer.
The separation principle is proven from (15) since eigenvalues of Φ consist of the eigenvalues of the RO matrix [ã 33 − La 23 C d ], and the eigenvalues of Φ p . This indicates that solving the large matrix Φ can be avoided, and the RO and the speed loop PI can be tuned independently as below: 1) Tuning of RO: It can be further simplified by setting L 1 = L 2 = ... = L N −1 = 0, and Q = 1 to disable the forgetting factor. Although, it is still an open question how the performance of RO would be affected by the N gains in matrix L, the experimental tests later in section V can confirm that the performance is already good with such simplified settings. Besides, the reason for not using the forgetting factor is that additional filters (will be discussed in section III-D) have been used for filtering the noisy measurement, such that the RO can trust the measured information with no need to "forget" anything. After all, the solutions can be seen as in (16).
To guarantee the stability of the RO, λ need to be placed within the unity circle. As a result, the stability criteria for the gain L N is 0 < L N < 2 a23 . 2) Tuning of PI: K I and K P for the PI controller can be tuned by choosing the roots of (17).
To facilitate the placement of three poles using only two parameters (i.e. K I and K P ), the order of (17) can be further reduced to two by neglecting the torque control loop P 1 (z) delay. The delay is negligible since the dynamics of the mechanical plant P 2 (z) is far slower than the dynamics of the torque control loop. The stability criteria for K I and K P will not be given in this paper since the tuning of speed loop PI in field oriented control of PMSMs is the widely known.

D. Impact of Delay
Authors in [29] have presented two types of delay that may affect the design of an observer in different ways. Taking Fig.4       as an example, the delay P 1 (z) = z −1 can be categorized as the actuator delay, which is the delay after the input T ref e , but before the disturbance T d . Consequently, the state T e has been added in the system state space model for this delay. Similarly, another additional state can be added to include the computational delay. Since the deadbeat loop presented in [28] is robust against electrical parameter variations in normal operation, the torque control loop delay is considered to be stable in this paper.
The other type of delay is called the sensor delay which describes system output sampling delay. In previous sections, the delay in the ω m samples is not yet considered. If M T s of sensor delay is added to the system as shown in Fig.5, the RO can easily adapt to this change by including the same delay to the input T ref e of the RO. Consequently, this delay will also be present in the observed disturbanceX d , such thatX d (k) = X d (k − M) andX dM +2 (k) = X d2 (k). As discussed in section III-C, the control law requiresT d (k) equal X d2 (k). Therefore,T d (k) = K MXd (k) =X dM +2 (k). As a result, only the (M + 2) th value in K M should equal one, and the rest are zeros. All the equations presented in the previous subsection in terms of tuning should still be valid since the eigenvalues as in (15)(16)(17) will not be affected by the change in K M . Another interesting finding is that the K M is effectively equivalent to a phase lead compensator z M +1 . The phase lead compensator is a common choice for the stability filter G f (z) of the RC as shown in Fig.2b.

E. Summary for the Tuning of RO
Till now, for each parameter in the RC, an equivalent parameter can be found in the RO, among which, it is not necessary to use the forgetting factor Q to filter the signal, thanks to the use of FIR filters, therefore, Q can be disabled by setting it to one. After all, only two parameters (L N and K M ) need to be tuned: K M can then be determined according to the overall sensor delays as shown in Fig.5. L 200 can be tuned from (16). This conclusion is valid for both the time-domain RO and the angle-domain ARO in the next section. The choice of N is not discussed here because the meaning of N is different in RO and ARO. In the time-domain implementation, N is the length of delay determined by the ratio between the sampling frequency and the motor speed, which will vary with speed. In the angle-domain implementation, ARO records N disturbance torque samples in one mechanical rotation, so N is independent from the rotational speed. Generally, a larger N would not increase the computation burden (see the next section for more details), but would increase the memory size required by the ARO, and can improve the resolution of the recorded disturbance torque profile. However, good performance is achieved in this paper with N equals to only 200.

IV. ARO IMPLEMENTATION
The procedure consists of four parts: 1) acquisition of position, speed and torque; 2) time to angle conversion; 3) memory update; 4) angle to time conversion. For clarity, all the equations in the four subsections are for the computation in the k th sampling period with respect to the time sequence plot in Fig.6. The overall control diagram is as in Fig.7a. The equations for the last three parts will not be given in this paper since they are almost the same as in [19]. The flowchart of the ARO has been drawn in Fig.7b.

A. Acquisition of Position, Speed and Torque
In this work, the position of the PMSM is measured directly using a 17-bit encoder. Therefore, the quantization error in the mechanical speed ω m calculated from the derivation of the position can be as large as 2π/2 17 /T s = 0.479 rad/s= 4.58 rpm. The noise will be further amplified when calculating the torque from the derivation of speed. For reducing the quantization noise, two Finite Impulse response (FIR) filters are used for speed and torque calculation. Taking advantages of the long delay nature of ARO, high order FIR filters are chosen to achieve sharp cut-off characteristic. The unfiltered speed is calculated as in (18).
Then, the speed is filtered by a 9 th order FIR filter of which the cut-off frequency is 1 kHz, such that the newest available filtered speed in the k th period is ω m (k − 10). The sum of the electrical torque and the disturbance torque is computed by the reverse of the mechanical plant as in (19).
Another 10 th order FIR filter is used for filtering the torque, such that the newest available filtered torque is T sum (k − 21). The disturbance torque can therefore be indirectly "measured" as in (20).

B. Time to Angle Conversion
In the time to angle conversion phase, the time-based disturbance torque samples are rearranged according to the corresponding rotor locations. The location index k 1 = floor( θm(k− 21) 2π/N ), k 1 ∈ [0, N − 1]. A memory array mem of length N is assigned to memorize the disturbance torque when the rotor is at the N chosen positions (which are θ m = 2π N · i, i = 0, 1, 2, ..., N − 1). Therefore, interpolation is necessarily required to estimate the disturbance torque at the nearest chosen position (i.e 2π N · k 1 in the case of positive rotation). T d ( 2π N · k 1 ) denotes the disturbance torque when the rotor position is exactly 2π N · k 1 . 1 st order interpolation is used to keep the computation effort light.

C. Memory Update
After the aforementioned interpolations, the (k 1 +1) th value in the memory array mem can be updated by mem{k 1 } = in the case of positive rotation. The memory only needs to be updated when the location index k 1 is different from its previous value k prev 1 , and only one value in the memory array needs to be updated each time. Hence the computation burden is low.

D. Angle to Time Conversion
In the angle to time conversion phase, the disturbance torque at the future position θ f ut m (t k+2 ) is interpolated and outputted since the output at t k+1 will be reached in the future at t k+2 . The future position can be predicted using the speed feedback for the PI controller and assuming the speed is constant for 2T s . Again, 1 st order interpolation is used to keep the computation effort light.

V. EXPERIMENTAL SET-UPS AND TESTS
The experimental rig as in Fig.8 has been set-up. The machine and the control parameters are shown in Table I. Where, the PI speed loop bandwidth and the value of N are kept the same as in [19]. The encoder resolution is 17bit. The rig has been set-up in two ways. In Rig1, a torque sensor (HBM T20WN) is mounted. In Rig2, there is no torque sensor to keep the inertia of the rig low. The controllers are implemented using Texas Instruments TMS320c6711 DSP and ProASIC A3P400 FPGA. The execution time of the ARO itself is within 10 µs. The overall execution time including reading sensors/encoder feedbacks, all the control loops and modulation is around 18.2 µs. In all tests, there are no additional compensations for the inverter harmonics since they will be compensated by the proposed method. The test results will be discussed from four aspects in the following four subsections.
A. Accuracy of Speed and Torque Acquisition 1) Speed: The speed ω m calculated in ARO with a FIR filter is as accurate as the commercial drive. As shown in Fig.9b, Fig.9d and Fig.9e, the same speed profiles are acquired from the DSP and from the load side Yaskawa drive, where the speed from load is negative due to opposite definition of the positive direction.
2) Torque: In ARO, torque disturbance or torque ripple is observed from position feedback. With ARO, both the torque and speed ripple should be reduced since speed ripple is produced by the torque ripple. The torque measured from the torque sensor in Fig.9c and the torque estimated in the load drive (in Fig.9d and Fig.9e) are both smoother with ARO. This proves indirectly that the acquisition of torque in ARO is accurate enough to achieve appreciable compensation on torque ripple.
B. Operating Range 1) Multiple sources: ARO can reduce torque ripple from multiple sources. For example: It has been proven in literature that the current sensor offset and current scaling error will produce the 1 st and 2 nd (with respect to the electrical frequency) torque ripple [30]. As shown in Fig.9a, 10% offset and 14% scaling error are added in the phase A and phase C currents respectively. As a result, the first two peaks in the speed FFT in Fig.9b are exceedingly high. With ARO, such ripple is reduced effectively.
The impact of cogging torque and inverter harmonics is strong for low inertia and low speed applications. The test results with Rig2 in Fig.10 show that the main ripple components are the 12 th , 24 th and 36 th . These components are caused by the cogging torque since the number of slots and tooth are 12 in the PMSM. Other harmonics (i.e. the 10 th , 20 th and 30 th ) are actually the 2 nd , 4 th and 6 th harmonics with respect to the electrical frequency, which are produced by the odd harmonics from the inverter.
For applications with higher speed, the frequency of cogging torque and torque ripple sourced from inverter increase. Since the mechanical system is like a low-pass filter, the impact of such ripple reduces. Fig.9f shows the speed waveforms with/without ARO when controlled at 1000 rpm. Where, the main speed ripple is at mechanical frequency due to mechanical misalignment. As shown, the peak to peak speed ripple is reduced significantly by 76%.
2) Variable speed: The integer delay condition in Fig.10 defines the condition when the sampling frequency is integral multiple of the rotational frequency of the rotor, otherwise, it is known as the fractional delay condition. The x-axis of Fig.10 is the "Order of Harmonics" which is defined as the ratio between the harmonic frequency and the mechanical frequency, hence the order does not vary with speed. The results confirm that the proposed ARO is adaptive to variable speed.
C. Transient Response 1) Load transient: The speed waveforms under load transient with/without ARO are recorded in Fig.11. As shown in Fig.11a, the low ripple speed is maintained under load condition. The load step is applied from the load side by the Yaskawa drive (SGDV-180A01A) and the Yaskawa motor (SGMSV-20ADA61), of which the rated torque is 6.36 Nm. 2) Speed transient: The speed waveforms under speed transient with/without ARO are recorded as in Fig.12. As shown, a "ripple-free" speed transient performance is achieved.

D. Robustness Analyse
The variation of the electrical parameters do not effect the ARO itself since no electrical parameters are used in the ARO. The inner current loop is assumed to be robust against electrical parameter variation since the design of the current loop is not the focus of this paper. It is worth pointing out that the rated torque of the drive side PMSM is 2.9 Nm, when the 4.4 Nm load torque is applied in Fig.11, the inductances should have varied, and the proposed ARO still works effectively.
The mechanical parameters (i.e. moment of inertia J and friction factor B) are required in the proposed ARO. Tests have been carried out in the case that these parameters are wrong. Fig.13a confirms that the proposed ARO can still reduce the speed ripple effectively with wrong inertia J used in the controller. The zoom-in in Fig.13b illustrates that an underestimated J results in higher speed ripple. Before the explanation of this behaviour is given, it is worth demonstrating how the parameters J and B take effects in the proposed control.
Reviewing the angle-domain implementation, the mechanical parameters are actually only used in (19) when calculating T sum , meanwhile, J would affect the gain L N a 23 in the memory update procedure and thus influence the poles of the ARO. The latter impact is limited according to (16), since the poles or roots will not move far when J varies from 0.5J real to 2J real . Overall, parameters J and B mainly affect the calculated T sum .
The transfer function (21) below can be derived. In fact, the right side of the equation in (21) can be seen as the inverse of the mechanical plant P 2 (z) times a delay z −1 (where, P 2 (z) = Ts J real z−(J real −B real Ts) ). Thus, when the correct values are used in control (i.e. J = J real , Fig.14.
The main harmonics as shown in Fig.13a are the 12 th and 24 th harmonics. According to Fig.14, the mismatch in J has little effect on the phase response of such harmonics. However, when J = 0.5J real , the amplitudes of the 12 th , 24 th harmonics are attenuated by −6dB. Consequently, it becomes difficult for the ARO to observe correctly the amplitude of the sum torque T sum and eventually the disturbance torque T d . Therefore, the proposed ARO performs worse when J = 0.5J real .
The bode diagram is drawn assuming the J real and B real values equal the identified J and B values in Table I. These parameters are identified by feeding the torque reference with a low-frequency pseudo random binary signal (PRBS) [31]. Summarising the results in Fig.13, the performance of the proposed ARO has no significant differences when J ∈ [0.5J real 2J real ] and B ∈ [0.1B real 10B real ].

VI. CONCLUSION
A novel angle-based ARO for the torque ripple reduction in variable speed PMSM drives has been proposed in this paper. It is structurally a DOB, but performs like a RC. Taking advantages of its DOB structure, the proposed ARO can be tuned easily using the well-known pole placement method, only two parameters need to be tuned. It has also been proven that separation principle of the DOB still valid for ARO, such that the ARO can be easily added to an existing control loop without interfering the system stability. Taking advantages of its RC nature, the passband of the ARO do not need to be compromised due to the measurement noise. Only one ARO is required for cancelling periodic ripple of multi-orders from multiple sources. The ARO expands the use of RO for variable speed applications. The proposed method is suitable for applications where a long learning period is allowed at the first time of operation. Experimental test results have verified the robust torque ripple reduction performance under