Advanced Control of the Permanent Magnet Synchronous Motor Advanced Control of the Permanent Magnet Synchronous Motor

The electrical machines are the core of the electrical drives. By introducing the vector control techniques for the alternative current machines, the high performances in drive systems are attained. One on the alternative current machines is the permanent magnet synchronous motor (PMSM). Due to their advantages, it becomes a very popular solution in the electrical drive field. In this chapter, an optimal control solution applied on the PMSM based on the Riccati solution is developed by the author. The objectives of the optimal control drive system are regulation, stability, robustness to the load disturbance variation and the energy reduction. Comparative with the conventional cascaded control, the proposed solution conducts up to 10% to energy efficiency improvement in transient regimes. The efficiency improvement depends on the chosen weighted matrices. Both the conventional and optimal controllers are implemented in Matlab-Simulink. The real-time solution based on the dSpace platform is provided.


The origins of the optimal control
Variational calculus uses multivariable functions and has the objective of obtaining a function (maximum or minimum) of a functional. The optimal command consists of finding timevarying functions or gain factors placed on the state feedback in order to find the extreme point of a functional cost. Therefore, optimal control derives from variational calculus. Optimization is a collection of methods and techniques for obtaining optimal solutions to automation problems.
The issue of optimization has encountered several stages of development, marked by the emergence of research areas. The optimization problem has been initiated since antiquity, continuing in the Renaissance period (with remarkable progress in the development of the optimization problem through the variational calculus), respectively, and its expansion to the optimal command (born in 1697) by solving the brachistochrone problem [1]. The foundation of the optimal control theory has been done by Semionovici Pontryagin's maximum principle (1956).
Thus, Johann Bernoulli (1667-1748) launched a challenge to the problem of the minimum time ("brachistochrone problem", the problem of determining a curve to ensure the fastest descent of a mass on its surface). By using variational calculation, Johann Bernoulli solved this problem in 1697, originally formulated in 1638 by Galileo Galilei (1564-1642).
In June 1696, Bernoulli formulated the issue of the minimum time in Acta Eruditorum journal: two points A and B are to determine the AMB curve of a moving point M, with the initial velocity v A = 0, which under its own weight will move from A to B in the shortest possible time. The shortest distance is the straight segment AB, but it is not the one that can be traversed in the shortest possible time ( Figure 1).
The Pontryagin maximum principle led to the birth of optimal control, a wider theory than variational calculus.
The origins of the variational calculation, after Herman H. Goldstine (1980), originated in 1662, when Pierre de Fermat (1601-1665), by posturing the Fermat's principle by specifying that the fastest path of a light beam passing through a single optical medium is the one in which light passes "in minimum time" (Heron's interpretation).
In consultation with Leibniz (Gottfried Wilhelm Freiherr von Leibniz, 1646-1716), the founder of variational calculus alongside Newton, Bernoulli sets the deadline to refer to the solution in the summer of 1697. Thus, besides Johann's solution, the following mathematicians answer this challenge: (1) Leibniz presents his solution in a letter addressed to Bernoulli in June of the same year, (2) Jakob Bernoulli (1654-1705, with probabilistic theory distributions that bear his name) offers another solution to the larger brother's solution, (3) Tschirnhaus, (4) L'Hopital and (5) Newton presents his solution in February 1697 to the Royal Society.

Modern optimal control
The optimal command appeared with the publication of Bernoulli's solution in Acta Eruditorum. The optimal control theory started with the Pontryagin maximum principle (USSR, 1956). Jacopo Francesco Riccati (1676-1754) presented a scalar form of the equation that bears his name, an equation used to solve the linear quadratic problems of today. The varied engineering calculations were developed by Placido Cicara (Torino, 1957), G. Newton and Gould Kaiser (1957), Derek F. Lawden (London, 1963), Athans F. (1966) andD. McRuer (1973). The design of the control by using a quadratic performance index was studied by G. Newton and Gould Kaiser (the square error integrator); Kalman (1960) introduces quadratic penalty on control and output error, obtaining optimal control by solving the inverse Riccati equation; and Chang (1961) introduces a restriction, by a K2 weighting factor, into the composition of the quadratic performance index. Athans had named this control type, both for monovariable linear systems and for multivariable systems, as control based on a linear quadratic regulator.
Bellman (1950) developed dynamic programming by introducing optimal nonlinear control. Bellman used the Hamilton-Jacobi theory and discrete systems. The disadvantage of dynamic programming is the limitation of the variables used due to the need for an important memory space to determine the solution.
Numerical solutions of optimal control were determined by Kalman and Athans (1960) for linear dynamic systems. Moreover, Kalman (1963) determined solutions of multivariable, linear quadratic optimal problems using Riccati matrix equations.
An optimization of dynamic systems has been strongly developed in the field of frequencies by the emergence of robust H-infinite (H∞) and H2 control. Also their name, these optimal commands are more robust to disturbance (due to high-frequency unmodified dynamics) and variations in process parameters. Optimization research is growing fastly seeking to develop modern theories that began in the 1980s, establishing robust optimal control laws for process parameter variations and modeling uncertainties.

The problem of optimal control
The problem formulation of the optimization of a dynamic system should include [2][3][4]: 1. The dynamics of the system.

2.
The objectives of the problem have to be formulated accordingly. Mandatory, one of the objectives should be related to the specific energy of the discussed system (mechanical or electrical in this case) to be related.

3.
Determining the set of allowable control.

4.
The performance criterion or index (mathematically is the functional cost), which integrates the proposed objectives by combining the states and controls of the dynamic system.
The problem of the optimal control is to find a solution, being an admissible control that minimizes or maximizes the chosen performance criterion. That solution is called optimal control.
Depending on the objectives imposed, the following types of optimal problems can be highlighted: A. Minimum time problem: the goal is to achieve the desired final state of a dynamic system in minimum time.
B. The minimum fuel consumption aims to minimize the fuel consumed by a system to move to the desired final state with minimum fuel consumption.
C. Minimum energy problem: if there is an electrical signal as control signal, part of the system energy, by applying this control, the system energy will be minimized.
D. The optimal control problem of the final state will contain the final state error in the chosen performance index. The resulting control will minimize the error.
Due to its applicability in the technique, the performance index based on quadratic energy criteria is highly used.
Linear quadratic problems lead to minimal energy consumption and can be of three types: state feedback control, output control problem and optimal tracking problem.
Linear quadratic problem leads to solving Riccati equations: algebraic and differential (continuous time and discrete time).
The optimal control of the dynamic system involves the synthesis of the optimal control directly from the extremes of the functional cost.
Depending on the final time, dynamic optimization problems can be: • Infinite final time (infinite horizon), for linear time-invariant systems with state constraints. In order to solve this problem type, the algebraic Riccati equation (ARE) is used.
• Finite final time (finite horizon) for linear time-variant systems. This type of optimization problem requires the solution of the matrix Riccati differential equation (MRDE).
By taking into account the process constraints, optimization can be without constraints or free state, with constraints or with free time.

Control of the synchronous machine with permanent magnets
The mathematical models of the PMSM in stator/rotor reference frame as well as a vector control solution are presented succinctly.

The mathematical model of the synchronous machine with permanent magnets in fixed reference frame
In order to determine the mathematical model of the PMSM in a fixed reference frame, the following hypotheses are considered: the iron core is non-saturated (applying the superposition effect is valid); the symmetrical three-phase stator windings, the infinite permeability of the air gap, constant air-gap width, the sinusoidal distribution of the magnetic field in the air gap and iron losses are neglected; the permanent magnets are placed on the rotor; and the isotropic machine is considered.
For the stator windings (Figure 2a), the second Kirchhoff Law conducts to where u A, u B and u C represent the phase voltages; i A, i B and i C the phase currents; ψ A, ψ B and ψ C the magnetic fluxes; and R 1 the resistance of the stator phase.
By taking into consideration the magnetic flux ψ 0 of the rotor permanent magnet, the magnetic flux of each stator winding is as follows (L AA self-inductance and mutual inductances L AB = L BC = L CA ): or in the form: The stator and rotor phasor equations: in which the connection between the fixed reference frame and synchronously one is described by the following transformation: By knowing the electromagnetic energy between the stator and rotor, the electromagnetic torque can be found: Taking into consideration that the stator windings are star connected: after some manipulations, the final form of the electromagnetic torque is obtained: The circular motion equation: where the combined inertia moment reduced to the rotor shaft J, the viscous torque T v , load torque T l and angular velocity Ω.
The significances of the specific PMSM angles from Figure 1(b) are as follows: • Angle of the stator current vector ωt.
Mechanical angular velocity: p-pole pair number.

Vector control of the synchronous machine with permanent magnets
Vector control in a synchronous reference frame is the best way to control the permanent magnet synchronous machine (PMSM). The field-oriented control is used to control the spatial vectors of magnetic flux, stator current and voltage. As with field-oriented vector control of the three-phase asynchronous machine, the synchronous reference system chosen to drive PMSM allows the stator current vector to decompose into the field-generating component and torque component. The structure of the vector control leads to almost identical operation with the selfexcited DC machine, which simplifies the structure of the PMSM control. In order to achieve the high dynamic performances in the PMSM drive, the vector control has been chosen. In this way, the parameters of the PMSM become constant. The d-axis stator component determines the magnetic flux changes, and the q-axis stator component is responsible to control the mechanical units: torque and speed.
The block diagram for vector control of the permanent magnet synchronous machine is shown in Figure 3 [5].
In order to make the vector control, the following methodology should be applied: 1. Measurement of the three-phase stator currents.
2. By using the direct (forward) Clarke transformation (in order to obtain the equivalent twophase PMSM model in fixed coordinates): The above-deducted equation is based on the existence of the isolated stator windings neutral (8).
3. Direct Park transformation (based on the measured or estimated rotor angle) 4. The cascaded loop control of the two main axes: the mechanical and magnetic field.

5.
The inverse (reverse) Park (IPARK) and Clarke (ICLARKE) transformations in order to deliver the reference switching states to the three-phase power inverter: The voltage source power inverter supplies the stator windings of the PMSM with the adequate reference voltages such that the objectives of the control are attained.
The general mathematical model of PMSM in a synchronous reference frame (d, q) is as follows: with the electromagnetic torque T e ¼ 3pψ 0 Synchronous motors with permanent magnets (with permanent magnet rotor inside, anisotropic PMSM) have different inductances q and d (L sq > L sd ). For an isotropic PMSM, the inductances are equal: L sq = L sd .

Design of the current controller
In order to design the current control, the second Kirchhoff Law is applied to the stator equivalent circuit: The corresponding transfer function is as follows: By taking into consideration the step reference signal of the current loop, the proportional integral control is involved: The performance specifications of the PI control are: • The bandwidth of the current loop (Hz) f c .

The open loop transfer function is
and the closed loop transfer function is The denominator of the closed loop transfer function could be written in the standard form of the second-order system: where the natural pulsation is denoted by ω 0 ( By comparing Eq. (21) with Eq. (22), the parameters of the PI current control are obtained: The calculated poles of the closed loop current system are as follows: The connection between the bandwidth and the natural pulsation is based on the belowmentioned equation:

Design of the speed controller
Taking into account that the reference speed signal is the ramp type, the speed control design is based on the symmetrical optimum, the PI controller can be deducted: with the specific constants [6]: The equivalent controller parameters are as follows:

Optimal control of the electrical drives with PMSM
The high-efficiency PMSM during steady state is obtained at the rated load. During the transient regime, the main loss component into the PMSM drive system is the stator copper losses. For the PMSM operating in often dynamic regimes, the optimal control based on the energetic criteria should be taken into account.

Optimal control problem statement
The optimal control problem statement consists of defining the dynamic system, the objectives, the initial and final conditions and the functional. The functional or the performance index includes the combination of the independent states weighted by the matrices defined by the designer of the drive system. In order to include the energy terms, the quadratic performance index is chosen. The optimal control problem consists in finding the control which minimizes the performance index. The optimal control problem is unconstrained. By adequately choosing the weighted matrices, the boundary restriction of the states is provided.
The objectives of the optimal electric drive based on the PMSM are regulation (by obtaining zero steady-state error), stability (admissible electrical and mechanical limits), rejection of the perturbation and energy reduction.
The dynamic regimes of PMSM drive (starting, braking and reversing) are characterized by the absorption of large currents, high slipping and a significant reduction in conversion efficiency (below 50%).
Other side effects are increased power loss in the PMSM, therefore worsening of its thermal regime, reducing life span and increasing the harmonic pollution of the power supply network.
For these reasons it is proposed an optimal control based on energy minimization. The optimal controller has in view the minimization of the absorbed energy necessary to fulfil the required dynamic regimes.

The dynamic system
The constant flux is considered. Therefore, the imposed reference of the d-axis stator current is fixed at zero: i * sd = 0. Taking into account that the speed of the magnetic field wave is the same as of the mechanical rotor in synchronous machine case, to implement the FOC, it is necessary only to measure the mechanical speed, delivering the necessary angle for inverse Park transformation ( Figure 3).
The state-space mathematical model of the PMSM is as follows [7]: By noting the state vector x t ð Þ ¼ , u is the control vector; u(t) = u sq t ð Þ Â Ã , and the perturbation vector is w(t) = T l t ð Þ ½ ; the mathematical model of the PMSM in the standard state space can be configured: The initial and final conditions are stated for a starting: The performance criterion is based on the quadratic functional having in view both the steadystate and dynamic-state performances.
The chosen performance criterion [8] is as follows: in which Λj t¼t1 is the terminal cost.
The weighting matrices are designed such that S ≥ 0 and Q ≥ 0 are positive semidefinite; S has in view the minimization of the square error between the obtained final state and the imposed one at the final time t 1 ; Q has in view the smooth angular speed without oscillations and minimization of the stator copper losses.
R > 0 is positive definite, in order to assure the minimum condition existence and to limit the magnitude of the control.
The optimal problem consists of determining the control, u * (t), which minimizes the quadratic functional (35): The electrical drive system based on the PMSM is completely controllable and observable. Therefore, the existence of the minimum is assured.
By taking into consideration the above-mentioned conditions, the optimal problem is unconstrained, fixed time and free-end point.

The solution of the optimal control problem
The solution of the optimal control problem exists, and it is unique thanks to the complete controllability and observability of the dynamic system by adequate choosing of the weighting matrices: Q, S ≥ 0 and R > 0 [8].

Hamiltonian of the optimal problem
By knowing the dynamic system and the integral part of the performance index, the Hamiltonian of the proposed problem can be determined: Through the Hamiltonian (37) the unknown co-state vector is introduced p(t)∈ℜ 2 .
By using the necessary conditions of the optimality: ∂Λ ∂x both the canonical system and the optimal control are obtained: By using Eq. (40), the optimal control is obtained: The canonical system can be solved by knowing the initial and final conditions: x(t 0 ) = x 0 and p(t 1 ).
The final condition for the co-state vector is obtained by the transversality condition: The co-state and state vectors are the solutions of the canonical system (41).
The adopted nonrecursive solution of the MRDE in numerical form [8] at any instant t has been found: where the feedback gain matrix P(t 1 À t) is computed as the solution of the nonrecursive MRDE, the matrix K 1 takes into consideration the zero steady-state error at the final time t 1 (i.e. to achieve the imposed reference x 1 at the final time t 1 ) and the matrix K 2 has in view the feedforward compensation of the load torque. The matrices K 1 and K 2 are calculated via P(t 1 À t), where t 1t means the time remaining until the final time [8].

Numerical results
Both the vector control and optimal control (45) of the PMSM drive system (31)  By using an elevator prototype, the experimental results are provided. The optimal control has been implemented on ControlDesk, the dSpace real-time interface.
The Matlab-Simulink vector control implementation of the PMSM is shown in Figure 4.
The performance of the speed controller is depicted in Figure 5 under a rated load torque ( Figure 6). The PMSM drive is tested in both dynamic and steady-state regimes. The starting, breaking and speed reversal are shown in Figure 5. In Figures 5-10, the appropriate signals of the PMSM drive system based on the vector control are shown.
In Figures 7 and 8, the stator current controller performances are shown. In Figure 9, the twophase stator currents are obtained. At the same time, in Figures 9 and 10, the appropriate d and q stator voltage components are depicted.    conducts to the specific speed reference as in Figure 11. At the same time, the performances of the speed controller are shown in Figure 11.
The performances of the speed and current (d-axis, q-axis) controllers are depicted in Figures 11-13. The shape of the stator phase current ( Figure 14) and the developed electromagnetic torque (Figure 15) depend on the reference speed ( Figure 11).      For the PMSM the same speed profiles have been implemented as in simulation tool. The optimal control has been implemented on the dSpace platform in order to control an elevator (Figures 16-18).

Conclusions
The field-oriented control of the PMSM has the main advantage of decoupling torque from the magnetization flux. Therefore, the parameters of the PMSM do not depend on the rotor position; the stator and rotor currents are treated as DC quantities. The PMSM control is in cascaded manner, the torque control and magnetic flux control being independent; the quick torque response is obtained.
The synchronous machine with permanent magnets is a serious contender for their use in specific applications: irrigation, wind turbines, conveyor belts and elevators.  It is noted that by introducing an optimal regulator, the state vector is limited due to the proper choice of the weighting matrices. By minimizing the quadratic performance index, energy saving is initiated.
In Figure 6, the removal of the system disturbance at t = 0.02 s in a relatively small period compared to the evolution of the process is shown.
The reduction of the energy assures either an increase of the operational period of the electrical drive components or the permanent magnet synchronous motor overload permission.