Control Engineering Practice 21 (2013) 1584–1593
Contents lists available at ScienceDirect
Control Engineering Practice journal homepage: www.elsevier.com/locate/conengprac
Model predictive control of a permanent magnet synchronous motor with experimental validation Shan Chai a, Liuping Wang a, Eric Rogers b,n a b
School of Electrical and Computer Engineering, RMIT University, Melbourne, Victoria, Australia Electronics and Computer Science, University of Southampton, Southampton SO17 1BJ, UK
art ic l e i nf o
a b s t r a c t
Article history: Received 7 August 2012 Accepted 23 July 2013 Available online 6 September 2013
This paper develops new results on the use of model predictive control to regulate the speed of a permanent magnet synchronous motor where the design is based on a linearized state-space representation of the nonlinear model that describes the dynamics. The model predictive controller employs integral action, resulting in zero steady-state error and load torque disturbance rejection. Design in the presence of constraints is considered, where a quadratic programming procedure is used to solve the resulting on-line optimization problem during experimental verification by application to an industry-sized motor. & 2013 Elsevier Ltd. All rights reserved.
Keywords: AC motor control Constraints Disturbance rejection Quadratic programming
1. Introduction Permanent Magnet Synchronous Motors (PMSMs) are widely used in various industries due to their high efficiency and dynamic performance. The standard controller for a PMSM is a vector-based cascade arrangement that uses Proportional plus Integral (PI) action as shown in Fig. 1. The two inner-loop PI controllers are used to regulate the d–q axis current and the outer-loop PI speed controller produces the q-axis current command for the inner loop q-axis current controller. This current command must be limited due to the constraints imposed by the motor characteristic and to protect the drive. Without a control law in place, performance will deteriorate when the q-axis current command is saturated (Shin, 1998) and an anti-windup compensation algorithm, such as those discussed in, for example, Peng, Vrancic, and Hanus (1996) or more recent results such as Kerr, Turner, Villota, and Postlethwaite (2011), may be required. An alternative to cascade PI control of electrical drives is Model Predictive Control (MPC), which is an optimization-based approach that computes the next control action by minimizing difference between the predicted output of a system and the specified reference. Many MPC design algorithms are available and, in general terms, can be categorized as: (i) transfer-function based, such as Generalized Predictive Control (GPC) (Clarke, Mohtadi, & Tuffs, 1987), (ii) step response model based, such as Dynamic Matrix Control (DMC) (Cutler & Ramaker, 1979), and (iii)
n
Corresponding author. Tel.: þ 44 2380 592197; fax: þ 44 2380 594498. E-mail addresses:
[email protected] (S. Chai),
[email protected] (E. Rogers). 0967-0661/$ - see front matter & 2013 Elsevier Ltd. All rights reserved. http://dx.doi.org/10.1016/j.conengprac.2013.07.008
state-space model based (Maciejowski, 2002; Wang, 2009). Moreover, the optimization required can be completed by solving a Quadratic Programming (QP) problem. In the absence of constraints, it is possible to obtain the optimal solution in an analytic form and hence the feedback gain matrix can be pre-calculated off-line. However, MPC where the QP problem is solved on-line in the presence of operational constraints has also been developed, motivated by many industrial application areas. In process control a relatively long sample time is often possible and the ability to solve the QP problem on-line is a major reason for the increasing popularity of MPC in the process industries. In contrast, MPC has been less commonly used in electric drive and power electronics applications due to the fast sampling requirement and the computational load required to solve the QP problem. The development of faster micro-controllers and advances in MPC research, especially in recent years, has made MPC a realistic candidate for application to electric drives, see, for example, de Santana, Bim, and do Amaral (2008) for Induction Motor (IM) control and Bolognani, Peretti, and Zigliotto (2009) and Ishida, Doki, and Okuma (2010) for PMSM. The reasons for applying MPC to electric drives are: (i) the model for the electrical parts of a PMSM/IM can be linearized as a Multi-Input and Multi-Output (MIMO) system, (ii) the phase currents and voltages of motor drives are usually limited by electrical constraints and (iii) MPC can be extended to handle periodic disturbances (Mariethoz, Domahidi, & Morari, 2009) and the completion of repetitive tasks (Wang, Chai, & Rogers, 2010). The MPC design in Bolognani, Peretti, et al. (2009) requires the addition of an extra integrator outside the controller to eliminate the steady-state error resulting from a load torque disturbance. In this paper a new design, starting from results in Wang (2009), for
S. Chai et al. / Control Engineering Practice 21 (2013) 1584–1593
1585
The cross-coupling terms ωe iq and ωe id in (1) are the nonlinear entries in the model and are therefore will be linearized to obtain a linear model approximation for use in MPC design, where this is most commonly completed by linearizing these product terms around an operating point. In this paper, the operating points of the state variables id, iq and ωe in (1) are denoted by id0 , iq 0 and ωe0 , respectively, and the following first-order Taylor series expansions are used to obtain the linear state-space model for the MPC design
Fig. 1. Schematic of the cascade PI controller for a PMSM.
application to a PMSM is developed where an integrator is directly embedded into the design and hence zero steady-state error is guaranteed in the presence of a load torque disturbance. Moreover, the design is extended to allow for physically relevant constraints to be imposed on-line. Finally, the experimental implementation of the new design on an industry-sized motor is described together with discussion of the results obtained and details of the encoder and the electrical tests for parameter identification and model validation. Another design in the same general area can be found in Bolognani, Bolognani, Peretti, and Zigliotti (2009). The next section gives the model of a PMSM and linearizes this model for MPC design. Section 3 and 4 gives the necessary background on MPC, control law design and the inclusion of constraints and Section 5 the parameter identification and model validation. Section 6 details the experiment setup using the MATLAB XPC host–target environment and Section 7 the experimental results obtained. Section 8 concludes the paper.
2. Electrical model of a PMSM In the d–q rotating reference frame (Pillay & Krishnan, 1988) did 1 ¼ ðv Rid þ ωe Lq iq Þ dt Ld d diq 1 ¼ ðvq Riq ωe Ld id ωe ϕmg Þ dt Lq d ωe p Bv T e ωe T L ¼ J dt p 3 T e ¼ p½ϕmg iq þ ðLd Lq Þid iq 2
ð1Þ
In this model ωe is the electrical speed, related to the rotor speed by ωe ¼ pωm where p denotes the number of pole pairs, vd and vq represent the stator voltages in the d–q frame and id and iq represent the stator currents in this same frame. Moreover, TL denotes the load torque that is treated as an unknown constant disturbance to be rejected. The electromagnetic torque Te consists of two parts: that produced by the flux of the permanent magnet, denoted by ϕmg , and the reluctance torque produced by id and iq, respectively. In the control of a PMSM, the set-point signal for the d-axis current is set to zero for energy efficiency (Pillay & Krishnan, 1988) in the steady-state. Maintaining id ¼0 allows the electromagnet torque Te to be controlled through iq directly, which is also the underlying idea of field-oriented control. Furthermore, for a surface mounted PMSM, which is commonly encountered in practical applications, the d–q axis inductance satisfies Ld ¼ Lq. This paper uses surface mounted PMSM and hence, independent of the value of the id current, the electromagnetic torque Te and iq are linearly related as T e ¼ 32pϕmg iq
ð2Þ
ωe ðtÞiq ðtÞ ωe0 iq0 þ iq0 ðωe ðtÞωe0 Þ þ ωe0 ðiq ðtÞiq0 Þ
ð3Þ
ωe ðtÞid ðtÞ ωe0 id0 þ id0 ðωe ðtÞωe0 Þ þ ωe0 ðid ðtÞid0 Þ
ð4Þ
Substituting the approximations of (3) and (4) into (1) gives the linearized state-space model x_ m ðtÞ ¼ Am xm ðtÞ þ Bm uðtÞ þ ϵ yðtÞ ¼ C m xm ðtÞ where 2
Lq Ld
LRd
6 6 Ld ω Am ¼ 6 6 Lq e0 4 0 Cm ¼
1
0
0
0
0
1
ωe0
LRq
3p2 ϕmg 2J
2
6 ϵ¼6 6 4
ð5Þ 3
Lq Ld iq 0
ϕmg Ld Lq id0 þ Lq
BJv Ldq ωe0 iq 0 L
Ld Lq
2
7 7 7; 7 5
1 L
6 d Bm ¼ 6 40 0
0 1 Lq
3 7 7; 5
0
3
7 ωe0 id0 7 7 pTJ L
5
The first two entries in ϵ A R3 are the selected operating points and the last entry is due to the load torque, xm ¼ ½id ðtÞ iq ðtÞ ωe ðtÞT A R3 is the state vector, y ¼ ½id ðtÞ ωe ðtÞT A R2 the output vector and u ¼ ½vd vq T A R2 the input vector. The control objective is to achieve the desired speed set-points subject to: (i) id ¼ 0 and (ii) d and q-axis voltages that remain within specified operational limits. In the state-space model (5) the outputs are the d-axis current id and the electric speed ωe . The iq current is one of the state variables that will be measured in the implementation. This paper considers discrete model based MPC and hence (5) is discretized with sampling period Ts using a zero-order hold, resulting in the discrete state-space model xm ðk þ 1Þ ¼ Ad xm ðkÞ þBd uðkÞ þ dϵ yðkÞ ¼ C d xm ðkÞ where Z dϵ ¼
0
Ts
eAm τ ϵ dτ;
ð6Þ Z
Ad ¼ eAm T s ;
Bd ¼
Ts 0
eAm τ Bm dτ;
Cd ¼ Cm
and dϵ has constant entries. 3. MPC design The MPC design used in this paper is from Wang (2009) and the following is a summary of the main steps, for an m-input, q-output, n-state model, where in the experimental results section these are specialized to the case of speed regulation for a PMSM when m ¼2, q ¼2, and n ¼3. In common with the PI control scheme, an integrator is embedded in the MPC design, which is also used for the following purposes: (i) elimination of the vector dϵ in (6), or ϵ in (5), which contains motor parameters that have a degree of uncertainty associated with them in applications, and (ii) removal of the load disturbance torque which is assumed to be an unknown constant. This is the first step and once complete the MPC design is
1586
S. Chai et al. / Control Engineering Practice 21 (2013) 1584–1593
undertaken using the incremental model where the defining vectors are the differences among the state, input and output vectors, respectively, for any two successive sample instants. Therefore, when the operating conditions change it is only necessary to update the set-point signals to reflect this change and the other steady-state values for the state variables are not required. However, the parameters in the system matrices (6) depend on the operating conditions and if these undergo a drastic change, parameter updating may be required, resulting in a gain scheduled predictive controller (Wang & Gan, 2013). Let Δxm ðkÞ ¼ xm ðkÞxm ðk1Þ and ΔuðkÞ ¼ uðkÞuðk1Þ denote the incremental state and input vectors, respectively, computed from the corresponding vectors in (5). Then, since the vector dϵ has constant entries, the state dynamics in the incremental model are described by
Δxm ðk þ 1Þ ¼ Ad Δxm ðkÞ þ Bd ΔuðkÞ
ð7Þ
Also yðk þ 1ÞyðkÞ ¼ C d ðxm ðk þ 1Þxm ðkÞÞ ¼ C d Δxm ðk þ 1Þ ¼ C d Ad Δxm ðkÞ þ C d Bd ΔuðkÞ
or yðk þ 1Þ ¼ C d Ad Δxm ðkÞ þ yðkÞ þ C d Bd ΔuðkÞ
ð8Þ
and the augmented state-space model for design is xðk þ 1Þ ¼ AxðkÞ þ BΔuðkÞ yðkÞ ¼ CxðkÞ where " xðkÞ ¼
Δxm ðkÞ
ð9Þ #
yðkÞ
" ;
A¼
Ad
0
C d Ad
I
"
# ;
B¼
Bd C d Bd
# ;
C ¼ ½0 I
and for the remainder of this paper 0 and I, respectively, denote the zero and identity matrices of compatible dimensions. One immediate advantage of this incremental description of the dynamics is that the constant vector dϵ has been removed from the design. The MPC design requires the predicted future outputs for a number of steps ahead, where these are generated from the statespace model at the current sampling instant. Let xðk þ ijkÞ, Δuðk þ ijkÞ and yðk þ ijkÞ denote the corresponding vectors in (9) at sample instant k þi given them at sample instant k. Then the state dynamics NP sampling instants ahead of k are given by 8 xðk þ 1jkÞ ¼ AxðkÞ þ BΔuðkÞ > > > > > > xðk þ 2jkÞ ¼ A2 xðkÞ þ ABΔuðkÞ þBΔuðk þ 1Þ > < ⋮ ð10Þ > > > xðk þ N p jkÞ ¼ ANp xðkÞ þANp 1 BΔuðkÞ > > > > : þ ⋯ þ ANp Nc BΔuðk þ N 1Þ c
where Np and Nc are termed the prediction and control horizons, respectively. Also the choice N c rN p assumes that the incremental control Δu has reached the steady-state after Nc instants, that is, after Nc samples the incremental control is assumed to be zero and Nc is a tuning parameter that decides the number of future control inputs to be included in the optimization. The predicted output vectors for the next Np instants can be written in the compact form: Y ¼ FxðkÞ þ ΦΔU where Y ¼ ½yT ðk þ1Þ yT ðk þ 2Þ ⋯ yT ðk þ N p ÞT
ΔU ¼ ½ΔuT ðkÞ ΔuT ðk þ 1Þ ⋯ ΔuT ðk þ N c 1ÞT F ¼ ½ðCAÞT ðCA2 ÞT ⋯ ðCANp ÞT T
ð11Þ
2
B
0
⋯
0
CAB ⋮
CB ⋮
⋯ ⋱
0 0
CANp 1 B
CANp 2 B
⋯
CANp Nc B
6
Φ¼6 6 4
3 7 7 7 5
Let r(k) be the reference that is assumed to have constant entries within the prediction horizon and introduce Rs ¼ R s rðkÞ qN p
zfflfflfflfflfflfflffl}|fflfflfflfflfflfflffl{ ¼ ½I I ⋯ IT rðkÞ. Then cost function used for the MPC design has the structure J ¼ ðRs YÞT Q ðRs YÞ þ ΔU T R ΔU
ð12Þ
where Q is a ðq N p Þ ðq Np Þ symmetric positive semi-definite matrix and R is a ðm N c Þ ðm N c Þ symmetric positive definite matrix. Of particular interest in the current application is the case when Q is a diagonal matrix with diagonal entries Qid and Q ω and the structure 2 3 0 0 ⋯ ⋯ 0 Q id 6 7 ⋮ 7 6 0 Qω 0 ⋱ ⋯ 6 7 6 0 0 ⋱ ⋱ ⋱ ⋮ 7 6 7 Q ¼6 7 ⋱ ⋱ ⋱ ⋱ 0 7 6 ⋮ 6 7 6 ⋮ 0 7 ⋮ ⋱ ⋱ Q id 4 5 0 ⋯ ⋯ 0 0 Qω and R has the 2 rw 0 6 6 0 rw 6 6 0 0 6 R ¼6 6 ⋮ ⋱ 6 6 ⋮ ⋮ 4 0 ⋯
structure 0
⋯
⋯
0
⋱
⋯
⋱ ⋱
⋱ ⋱
⋱ ⋱
⋱
⋱
rw
⋯
0
0
0
3
7 ⋮ 7 7 ⋮ 7 7 7 0 7 7 0 7 5 rw
where r w 4 0 is a scalar weighting. This choice of R is applicable to speed regulation for a PMSM, considered in the experimental results part of this paper, where both input signals are of equal importance. Under the receding horizon principle, the control vectors for the next Nc sampling instants are obtained by minimizing the cost function (12) but only the first of these is applied to the plant. In the absence of constraints the global optimal solution is given by ∂J ¼0 ∂ ΔU and solving this equation gives the global optimal control sequence as
ΔU ¼ ðΦT Q Φ þ RÞ1 ΦT Q ðR s rðkÞFxðkÞÞ Moreover, the control vector to be applied at the next sampling instant occurs when
ΔuðkÞ ¼ ½I 0 ⋯ 0ΔU or
ΔuðkÞ ¼ K y rðkÞK x xðkÞ
ð13Þ
where Ky is formed by the first m rows of ðΦ Q Φ þ RÞ1 Φ Q R s and T T Kx by the first m rows of ðΦ Q Φ þ RÞ1 Φ QF. The matrix R s forms the last q columns of the matrix F due to the special structure of the augmented state-space model matrices C and A. Consequently, Ky is given by the last q columns of the matrix Kx and, by using the relationship between Kx and Ky, the T
T
S. Chai et al. / Control Engineering Practice 21 (2013) 1584–1593
control law (13) can be written as " # " # Δxm ðkÞ Δxm ðkÞ ΔuðkÞ ¼ K y rðkÞK x ¼ K x yðkÞ yðkÞrðkÞ
ð14Þ
Hence the control law to be applied is uðkÞ ¼ uðk1Þ þ ΔuðkÞ
ð15Þ
and in this constraints-free case, Kx can be computed off-line and u (k) computed on-line using (14) and (15).
1587
and the constrained optimization problem can be solved by QP, see for example, Boyd and Vandenberghe (2004) and Luenberger (1984), that is, minimize the cost function (12) subject to a set of linear inequality constraints of the form given above. One of the methods available is based on an on-line search of the active constraints using Hildreth's QP algorithm (Hildret, 1957; Wang, 2009). This method uses Lagrange multipliers, in the form of a vector λ Z0, as the decision variables and the constrained optimization problem solved is minð12λ H λ þ λ K þ constantÞ T
4. MPC with constraints
C 1 ðumin uðk1ÞÞ r C 2 ΔU rC 1 ðumax uðk1ÞÞ
ð16Þ
C 1 Δumin r ΔU r C 1 Δumax
ð17Þ
where C1 and C2 are matrices of dimensions ðN s mÞ m and ðNs mÞ ðNc mÞ, respectively, with the structure 2 3 I 0 … 0 6 I I … 07 6 7 C 1 ¼ ½I I ⋯ IT ; C 2 ¼ 6 7 4⋮ ⋮ ⋱ ⋮5 I
…
I
If all future control signals were constrained by choosing Ns ¼ Nc, the computational load would increase and could become prohibitively expensive. Hence it is preferable in practical applications that Ns is treated as a tuning parameter depending on the sampling time of the micro-controller employed. In the case of the q-axis current iq(k) consider iq ðk þ 1Þ ¼ iq ðkÞ þ Δiq ðk þ 1Þ with
Δiq ðk þ 1Þ ¼ ½0 1 0 0 0ðAxðkÞ þ BΔuðkÞÞ where the system matrices A and B are from incremental system state-space model (9). The constraint on the next sample instant prediction of this current considered in this work takes the form max imin q r iq ðkÞ þ ½0 1 0 0 0ðAxðkÞ þ BΔuðkÞÞ riq
ð18Þ
and imax are the specified limits. Moreover, iq(k) and x(k) where imin q q are measured quantities and hence all terms in (18) are available. Hence ΔuðkÞ is formulated as a linear inequality constraint in a similar manner to that on uðkÞ. The constraints considered in this paper can be expressed in the compact form as M ΔU r γ
ð20Þ
where H ¼ MðΦ Q Φ þ RÞ1 M T and K ¼ γ þ MðΦ Q Φ þ RÞ1 F. Once λ is obtained the optimal ΔU vector is (Wang, 2009) T
Many different types of operational constraints often arise in the application of control algorithms to physical systems. In the case of a PMSM, the two input voltages to the motor, vd and vq, respectively, are limited by the d.c. bus voltage. Moreover, the maximum voltage that can be modulatedpby ffiffiffi the Space Vector Pulse Width Modulator (SVPWM) is V dc = 3. In the PI control structure, an anti-windup scheme is usually employed to compensate for constraints, but the success of MPC with constraints in, for example, process control applications makes it a natural alternative to be considered, particularly in the case of more than one input and output. The cost function of the previous section was optimized with respect to ΔU: Hence any constraints on, for example, the control inputs must first be translated into constraints on the incremental control vector Δu. Consider first constraints on the amplitudes of the d and q-axis voltages and their incremental changes and let N s ð r N c Þ denote the number of future sampling instants within the control horizon Nc where these are imposed. Then one form for them is
I
T
λZ0
ð19Þ
T
ΔU ¼ ðΦT Q Φ þ RÞ1 ΦT Q ðRs rðkÞFxðkÞÞ T ðΦ Q Φ þRÞ1 M Tact λact
ð21Þ
where Mact and λact denote the active linear constraint matrix and Lagrange multiplier vector, respectively, formed from M and λ in (19). 5. Parameter identification and model validation An adequate representation of the motor characteristics is necessary for MPC design to achieve, or get acceptably close to, desired performance. Models for the dynamics of a PMSM are well established in the field of electrical drive control (Vas, 1992). Table 1 gives the model parameters and their numerical values for the PMSM used to obtain the experimental results given in the next section. The mechanical parameters J and Bv in this table were obtained from the constant acceleration and velocity regions of an open-loop test, respectively, and next how the electrical parameters in this table were obtained is detailed. The inductance can be measured by conducting a block rotor test with a 50 Hz 3-phase voltage applied to the motor through a step-down transformer. As the rotor is blocked, the back-EMF voltage induced by the rotating rotor does not exist. Hence the phase inductance Ls can be calculated using (Vas, 1993) jVs j ¼ jR þ jωe Ls jjIs j where jVs j and jIs j are the amplitudes of the phase voltage and current vectors, respectively. The amplitude of the phase voltage is related to the measured line-to-line voltage (RMS values) as pffiffiffi 2 jVs j ¼ pffiffiffiV llðrms:Þ 3 The resistance R of the stator can be measured by a d.c. test and, since a surface mounted PMSM is used, the d–q axis inductance equals the phase inductance, that is, Ld ¼ Lq ¼ Ls . Finally, the flux linkage can be measured by coupling the PMSM to another motor running at a constant speed ωm . In this arrangement, the measured PMSM acts as a generator, and the flux linkage can be computed by measuring its line-to-line voltage and rotation speed and using jVs j ¼ ωe ϕmg ¼ pωm ϕmg Table 1 PMSM parameters. Symbol
Description
Value
p J Bv Ld ; Lq R ϕmg
No. of pole pairs Total moment of inertia Viscous coefficients d–q-axis inductance Stator resistance Rotor flux
2 2.35 kg cm2 1.1e 4 7.0 mH 2.98 Ω 0.125 Wb
1588
S. Chai et al. / Control Engineering Practice 21 (2013) 1584–1593
The identified parameters have been validated by comparing the open-loop simulation response against experimentally measured data, where the former has been developed in MATLAB/SIMULINK using the model (1). In the experimental validation, the desired input voltages, denoted by vnd and vnq , were implemented by dq/abc transformation and SVPWM control of a two level voltage source inverter, see Fig. 2. In the linear modulation range of the SVPWM with sufficiently high switching frequency, it is assumed that vnd vd and vnq vq . Figs. 3 and 4 give representative results from the model validation tests for the d–q-axis currents and the velocity, showing a
Fig. 2. MPC speed control of the PMSM.
Fig. 4. Model validation: vd ¼5 V and vq ¼20 V. (a) id, (b) iq, (c) ωe .
high degree of agreement between simulated and measured values in each case.
6. Control experimental setup
Fig. 3. Model validation: vd ¼ 0 V and vq ¼ 20 V. (a) id, (b) iq, (c) ωe .
The experimental results given in the next section were obtained using the MATLAB realtime workshop and XPC host– target environment, where the MATLAB real-time workshop compiler is installed on the host PC and the XPC target kernel and the quadrature encoder card on the target PC. After development in MATLAB/SIMULINK, the model is downloaded to the XPC target. This setup allows rapid prototyping and hardware-in-loop simulation functionality using PC hardware. To test the performance of the MPC design under a change in the load disturbance, a second PMSM is coupled with the controlled PMSM through a rigid coupler, as shown in Fig. 5. The generated phase voltages from the second PMSM are fed to resistor loads through an uncontrolled three-phase rectifier. In this arrangement, the equivalent load torque delivered by the electrical load is proportional to the speed of the motor shaft. Moreover, the encoder used in this case measures the speed of the motor and it is an open question as to whether or not the current design can be extended to cases where a mechanical sensor is not used (Zaltni & Ghanes, 2013). In the case when a mechanical
S. Chai et al. / Control Engineering Practice 21 (2013) 1584–1593
position sensor is not available, the position of motor could be estimated using an extended Kalman Filter (Bolognani, Oboe, & Zigliotto, 1999) or a Super Twisting Algorithm (STA) (Zaltni & Ghanes, 2013). Rotor position information is required to acquire the feedback speed and commutation angle for both the abc/dq and dq/abc transformations. In this work, a sine–cosine optical encoder with 512 cycles/rev was used to acquire high resolution position information. As output, the encoder produces sine and cosine signals that are converted to channel A and B pulses, respectively, as shown in Fig. 6. A quadrature counter card is employed to count both the rising and falling edges of a square wave and the high resolution position is computed by Staebler (2000)
θ¼
2π ϕ cnt b 2 þ N 2π
ð22Þ
where N is the number of cycles per revolution, cnt denotes the number of counts obtained by the quadrature counter card and ϕ is the phase angle determined from sampled values of both the
1589
sine, denoted by A, and cosine, denoted by B, signals using 8 A > > ; A Z0 > arctan < B ϕ¼ A > > > : arctan B þ π ; A o0 The sampling time of the sine–cosine signal may not be synchronized with the counter card and hence sudden variations in the position calculated by (22) can occur (Staebler, 2000) when 0 r ϕ r π =2 and cnt%4 ¼ 3 or 32π r ϕ r 2π and cnt%4 ¼ 0: In the first case, sampling ϕ leads to the counter increasing and its value should be increased by 1 to compensate for the resulting mismatch. In the second, sampling of ϕ lags the counter increasing and its value should be decreased by 1 to compensate for the resulting mismatch. A common method to obtain velocity is to calculate the derivative of a position measurement and one option is to use the following backward difference approximation:
ωm ðkÞ ¼
θðkÞθðk1Þ Ts
:
Use of this approximation would produce significant variation in velocity due to quantization error of the position measurements. An alternative is to pass θðtÞ through a filter with transfer-function s
FðsÞ ¼
ð23Þ
αs þ 1 to obtain ωmf ðtÞ by discrete implementation using the backward Euler method as
ωmf ðkÞ ¼
θðkÞθðk1Þ þ αωmf ðk1Þ α þTs
ð24Þ
Moreover, (24) can be directly implemented to obtain the velocity for use by the MPC design. The choice of α is a trade-off between filtering noise and the lag introduced. Another approach is to include filtered velocity as a state variable (Bolognani, Peretti, et al., 2009) by passing ωm ðtÞ through the filter with transferfunction GðsÞ ¼
Fig. 5. PMSM and loads.
1=α s þ 1=α
ð25Þ
to obtain ωmf ðtÞ and hence the effects of filter can be embedded into the MPC design.
Fig. 6. Encoder signal.
1590
S. Chai et al. / Control Engineering Practice 21 (2013) 1584–1593
7. Experiment results and discussion In this section, three representative sets of experimental results obtained by applying the MPC design to the PMSM of the previous section are given and analyzed. Particular emphasis is placed on performance in terms of the constraints, tuning of the controller feedback gain and load disturbance rejection. With a single MPC controller replacing the cascade control structure, a single sampling time has to be used and hence the current and speed controls share the same sampling time. In the implementation, the extra computational cost due to the increase in the system dimension and the complexity of the QP algorithm requires a much slower sampling time to be employed than that for the inner-loop current control in the cascade structure. For this reason, a sampling time of 200 μs is employed in the experiments in order to accommodate the extra expense of calculation. 7.1. Response to a staircase reference Fig. 7 shows the performance of MPC design in response to a staircase reference speed. The control objective is to regulate the motor to a different reference speed whilst maintaining id at zero. The controller gain for this case was selected to obtain a fast response whilst minimizing the noise level. Fig. 7(c) shows that the steady-state d-axis current is zero but corrupted by the noise and high frequency ripples. The high frequency ripples appear as pulsing torque (Jahns & Soong, 1996) in the controlled system for various reasons, such as current measurement errors (Chung & Sul, 1998), flux harmonics and cogging torques (Xu, Panda, Pan, Lee, & Lam, 2004). Fig. 7(c) also confirms that the frequency of oscillation increases with synchronous speed.
and this limitation can be imposed in favor of Vq priority as qffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi
V
vq r ϵV pdc ffiffiffi; jvd jr ð1ϵ2 Þ pdc ffiffiffi 3 3 where 0 r ϵ r 1. The performance obtained from the MPC design depends on the tuning of the cost function weighting terms rw, Qid and Q ω . Fig. 8 shows the results obtained when both Vq and ΔV q hit the following constraints at startup: 28:87 r V q r 28:87;
10 r ΔV q r 10
with the MPC and constraint parameters used given in Table 2. In this case, the same cost function weightings are used (Qid ¼ Q ω ¼1) and the response of id, as shown in Fig. 8(e), is slightly slower than that of Fig. 9(e) where the value of Qid is 100 times that of Q ω . 7.3. Tuning the MPC design The closed-loop performance of the MPC design depends on the weighting matrix Q in the cost function (12), where in the diagonal form of this matrix used the scalar Qid is the weighting applied to the d-axis current and Q ω that applied to the velocity ω. The relatively large values of these in the design of Fig. 8 result in the application of high controller gains that, in turn, amplify the noise and high frequency ripples in the drive. Hence the selection of these weights is a trade-off between response time and the attenuation of noise and high frequency ripples. The results of Figure 9 demonstrate (Q ω ¼ 0:01 and Q id ¼ 1) what can be achieved by varying the ratio of the weightings and, in particular, the magnitude of the noise is significantly reduced in the steadystate compared to Fig. 8, but at the cost of slower speed dynamics. 7.4. Response to load disturbances
7.2. Constraints The maximum voltages in the servo drive are determined by the d.c. bus voltage Vdc and the pulse width modulation techniques used in order to prevent over-modulation (Hava, Kerkman, & Lipo, 1998) occurring. Particular to the SVPWM technique employed, the linear modulation range limits the amplitudes of maximum achievable voltage by qffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi V ffiffiffi v2d þ v2q r pdc ð26Þ 3
The load disturbance is represented by TL in (1) and can be modeled as a slowly varying signal, such as the external friction forces arising when the motor is used in a grinding process. If it is assumed that the load disturbance mainly contains low frequency components, the MPC design with the embedded integrator can reject the impact of such external load disturbances. The capabilities of the MPC design in this case can be examined experimentally by suddenly switching on the resistor loads when the coupled motors of Fig. 5 are running at constant speed, resulting in an equivalent step load disturbance TL on the motor shaft. Fig. 10
Fig. 7. Performance of the MPC design in response to a staircase reference speed: (a) d-axis voltage (Vd), (b) q-axis voltage (Vq), (c) d-axis current (id), (d) motor speed.
S. Chai et al. / Control Engineering Practice 21 (2013) 1584–1593
1591
Fig. 8. Experimental results generated by the data of Table 2: (a) d-axis voltage (Vd), (b) q-axis voltage (Vq), (c) d-axis incremental voltage (ΔV d ), (d) q-axis incremental voltage (ΔV q ), (e) d-axis current (id), (f) motor speed.
Table 2 Design and constraint parameters used to generate the experimental results given in Fig. 8. Nc
Np
Qid
Qω
rw
ϵ
Vdc
5
20
1
1
100
0.5
100
confirms that the controller immediately brings the motor speed back to the steady-state with the design parameters of Table 2. Moreover, the d-axis current id and motor speed ωm are closely controlled to their set-points and the q-axis current iq and voltage Vq increase to compensate for the load change. In this case, the constraints on the qaxis voltage are relaxed by choosing ϵ ¼ 0:9, that is, 51:96 rV q r 51:96;
25:17 r V d r25:17
in order to return the speed to the set-point when the load torque is added. Otherwise, the constraints would not allow the application of a large enough q-axis voltage to return the speed back to the set-point and hence a steady-state error would result.
7.5. Robustness For applications, robustness against unmodeled dynamics is clearly of interest. As preliminary work for further research in the general area, one aspect of the robustness for unconstrained MPC is investigated. The starting point is application of the control law (14), resulting in controlled dynamics that can be written in the form xðk þ1Þ ¼ ðABK x ÞxðkÞ
ð27Þ
where the optimal control matrix Kx is obtained from (14) based on the discretizing the linearized state-space model (5) around a single operating point. One initial test for the robustness properties of this design is to compute Kx for a selected operating point and then apply the same control law at different operating speeds. Suppose that the selected operating point is ωe0 ¼ 15:7 rad=s (100 rpm), id0 ¼ 0 A and iq0 ¼ 0 A and r w ¼ Q id ¼ Q ω ¼ 1. Fig. 11 shows a plot of the eigenvalues of the matrix ABK x as the electric speed is increased from 100 to 2000 (rpm). The relevant part of the unit circle stability boundary is also shown and, expected, the eigenvalues move toward the stability boundary as the speed is increased but the plot does show a measure of robustness in the control law design. This first analysis provides support for a detailed investigation of robustness as further research. Such research should also include the constrained design and comparisons with PI controllers and parameter uncertainties.
8. Conclusions This paper has applied constrained MPC to a PMSM with the resulting QP problem solved on-line using Hildreth's procedure. In comparison to the classical cascade PI control structure, the MPC approach is a model-based single controller. The major advantage of MPC lies in the ability to impose constraints, as confirmed by the experimental results given in this paper with constraints imposed on the next input move. In addition, the choice of tuning parameters and their effects on velocity response and noise attenuation have been discussed and supported by experimental results. The emphasis in the paper is on the application of predictive control technology to AC motor control in the presence of
1592
S. Chai et al. / Control Engineering Practice 21 (2013) 1584–1593
Fig. 9. Experimental results for the data of Table 2 with the value Q ω replaced by 0.01: (a) d-axis voltage (Vd), (b) q-axis voltage (Vq), (c) d-axis incremental voltage (ΔV d ), (d) q-axis incremental voltage (ΔV q ), (e) d-axis current (id), (f) motor speed.
Fig. 10. Rejection of a step load disturbances: (a) d-axis voltage (Vd), (b) q-axis voltage (Vq), (c) d-axis current (id), (d) q-axis current (iq), (e) motor speed (ωm ).
S. Chai et al. / Control Engineering Practice 21 (2013) 1584–1593
0.2 0.1
0.08 Area B
Area A
2000 RPM
0.079
1500 RPM
0.078 0
1000 RPM 500 RPM 400 RPM 100 RPM
0.077
Area C
0.076
−0.1 −0.2
1593
0.075 0.9
0.95
0.901
1
2
0.1065 0.106 0.1055
1000 RPM
0.105
100 400 RPM RPM 500 RPM
1500 RPM 2000 RPM
0.1045 0.958
0.958
0.9015
0.902
0.9025
x 10−3
1 100
RPM
1500 RPM
1000 RPM
2000 RPM
0 −1 −2
0.9581 0.9581
0.901
0.902
0.903
0.904
Fig. 11. Plots of the locations of the eigenvalues of the closed-loop system (27) at different speeds from 100 to 2000 (rpm) with the same optimal control gain Kx: (a) eigenvalue locations, (b) zoom-in area A, (c) zoom-in area B, (d) zoom-in area C.
operational constraints with supporting experimental verification. The linearization strategy used is standard and very well established in the control of nonlinear systems with or without experimental verification. The only difference in this application is the assumption that Ld ¼ Lq , where is a standard property of surface mounted PMSMs. Areas for future research include gainscheduled predictive control and removing the mechanical sensor.
References Bolognani, S., Bolognani, S., Peretti, L., & Zigliotti, M. (2009). Design and implementation of model predictive control for electrical motor drives. IEEE Transactions on Industrial Electronics, 56(6), 1925–1936. Bolognani, S., Oboe, R., & Zigliotto, M. (1999). Sensorless full-digital PMSM drive with EKF estimation of speed and rotor position. IEEE Transactions on Industrial Electronics, 46(1), 184–191. Bolognani, S., Peretti, L., & Zigliotto, M. (2009). Design and implementation of model predictive control for electrical motor drives. IEEE Transactions on Industrial Electronics, 56(6), 1925–1936. Boyd, S., & Vandenberghe, L. (2004). Convex optimization. Cambridge University Press. Chung, D.-W., & Sul, S.-K. (1998). Analysis and compensation of current measurement error in vector-controlled AC motor drives. IEEE Transactions on Industrial Applications, 34(2), 340–345. Clarke, D. W., Mohtadi, C., & Tuffs, P. S. (1987). Generalized predictive control. Part 1: The basic algorithm, part 2: Extensions and interpretations. Automatica, 23, 137–160. Cutler, C. R., & Ramaker, B. L. (1979). Dynamic matrix control—a computer control algorithm. Presented at the Meeting of the American Institute of Chemical Engineers, Houston, TX. de Santana, E., Bim, E., & do Amaral, W. (2008). A predictive algorithm for controlling speed and rotor flux of induction motor. IEEE Transactions on Industrial Electronics, 55(12), 4398–4407. Hava, A., Kerkman, R., & Lipo, T. (1998). Carrier-based PWM-VSI overmodulation strategies: Analysis, comparison, and design. IEEE Transactions on Power Electronics, 13(4), 674–689. Hildret, C. (1957). A quadratic programming procedure. Naval Research Logistics Quarterly, 4(March (1)), 79–85.
Ishida, J., Doki, S., & Okuma, S. (2010). Fast torque control system of PMSM based on model predictive control considering overmodulation region. In International power electronics conference (pp. 1403–1406). Jahns, T., & Soong, W. (1996). Pulsating torque minimization techniques for permanent magnet AC motor drives—a review. IEEE Transactions on Industrial Electronics, 43(2), 321–330. Kerr, M., Turner, M. C., Villota, E., & Postlethwaite, I. (2011). A robust anti-windup design procedure for SISO systems. International Journal of Control, 84(2), 351–369. Luenberger, D. G. (1984). Linear and nonlinear programming (2nd ed.). AddisonWesley Publishing Company. Maciejowski, J. M. (2002). Predictive control with constraints. Essex, England: Prentice Hall. Mariethoz, S., Domahidi, A., & Morari, M. (2009). A model predictive control scheme with torque ripple mitigation for permanent magnet motors. In IEEE IECON (pp. 2943–2948). Peng, Y., Vrancic, D., & Hanus, R. (1996). Anti-windup, bumpless, and conditioned transfer techniques for PID controllers. IEEE Control Systems Magazine, 16 (August (4)), 48–57. Pillay, P., & Krishnan, R. (1988). Modeling of permanent magnet motor drives. IEEE Transactions on Industrial Electronics, 35(4), 537–541. Shin, H.-B. (1998). New antiwindup PI controller for variable-speed motor drives. IEEE Transactions on Industrial Electronics, 45(3), 445–450. Staebler, M. (2000). Tms320f240 dsp-solution for high-resolution position with sin/ cos-encoders. Technical Report, Texas Instruments. Vas, P. (1992). Electrical machines and drives—a space-vector theory approach. New York, USA: Oxford University Press. Vas, P. (1993). Parameter estimation, condition monitoring, and diagnosis of electrical machines. New York, USA: Oxford University Press. Wang, L. (2009). Model predictive control system design and implementation using MATLAB (1st ed.). London: Springer. Wang, L., Chai, S., & Rogers, E. (2010). Predictive repetitive control based on frequency decomposition. In American control conference (ACC), 2010 (pp. 4277–4282). Wang, L., & Gan, L. (2013). Gain scheduled continuous-time model predictive controller with experimental validation on ac machine. International Journal of Control, http://dx.doi.org/10.1080/00207179.2013.764019. Xu, J.-X., Panda, S., Pan, Y.-J., Lee, T. H., & Lam, B. (2004). A modular control scheme for PMSM speed control with pulsating torque minimization. IEEE Transactions on Industrial Electronics, 51(June (3)), 526–536. Zaltni, D., & Ghanes, M. (2013). Observability analysis and improved zero-speed position observer design of synchronous motor with experimental results. Asian Journal of Control, 15(4), 957–970.