Toward an optimal twisting-sliding mode control of a three-phase PMSM for electric vehicles

This paper deals with an optimal twisting sliding mode controller (OT-SMC) for the operation of a three phase permanent magnet synchronous machine (PMSM) in an electric vehicle (EV). In order to drive these vehicles, optimal performance is needed with robust control against real-time disturbances such as the variable load torque, uncertainties such as the parameters variation and speed variations between medium, low, and high speed as well as good performance characteristics for enhanced drive quality and longer battery time. Several conventional techniques have been applied to PMSM but they suffer from the problem of uncertainties and disturbances due to the PI regulator. A hybrid approach comprising of a robust nonlinear and optimal controller to achieve these objectives is attempted for driving electrical vehicles. This advanced hybrid controller obtained after the merger of sliding mode control (SMC) and a linear quadratic controller (LQR) is found to outperform existing controllers due to their superb performance characteristics. Furthermore, SMC is designed based on the exponential reaching law for the twisting sliding mode control (T-SMC) in order to ensure stability of the system while reducing the chattering, accelerating the rate of convergence with higher accuracy of the control performance, and the LQR is developed using the steady-state error method (N-LQR) in order to obtaining better performance characteristics. In addition, the hybridization between a twisting SMC and an optimal LQR is characterized by stabilizing and minimizing the oscillations in the permanent regime thus optimizing the system’s performance. Extensive simulation results illustrate the effectiveness and validity of the proposed control for achieving the highest performance of the PMSM.


Introduction
Electric vehicles whether they are pure or hybrid (PEV/ HEV) require electric drives and rechargeable battery backup coupled with robust power electronics and control for their operation. 1The field of electrical drives is a multi-disciplinary area focused on the transformation of energy from electrical to mechanical form in order to drive an EV as shown in Figure 1. 2 Currently, researchers are aiming to design energy-saving industrial machines with more compact designs, categorized into three classes namely synchronous, asynchronous, and AC motors.In recent times, a significant challenge is found to exist between induction motors and permanent synchronous motors, as PMSMs are increasingly used in industrial applications owing to their higher power density, higher torque to inertia ratio, improved efficiency, low losses, excellent accuracy, simple structure, and strong performance advantages. 3Besides their significant role in driving electric vehicles (EVs), they are widely used in many other applications such as industrial traction automation, CNC machine tools, industrial robots, aerospace, computer peripherals, electric drives, and other precise position control for servo systems, which demands more power and better performance. 4][7] The control design approaches for PMSMs can be broadly classified into scalar and vector control.Scalar control is easy to implement and provide a relatively steady-state response but it pose the problem of slower dynamics.Therefore, in order to realize a higher accuracy and good dynamic and steady-steady response, closed-loop vector control approach is usually preferred. 8,9The vector control is the largest control group, which includes the conventional and advanced control.The conventional control is dependent on PID regulators like field-oriented control (FOC) and direct torque control (DTC) but these are not robust to the variation of the parameters, variation in torque, and in the speed.To overcome this problem, control engineers have devised some advanced techniques like nonlinear, optimal, predictive, and intelligent control for safety critical applications such as electric vehicles and aerospace. 10,11onlinear control consists of various techniques for example, Feedback linearization control (FBLC), sliding mode control (SMC), back-stepping (BSC), passivity-based control (PBC), and improved hybrid techniques such as combining DTC and SMC using wolf optimization algorithm. 12,13In literature, PMSM controllers widely use the FBLC, SMC, and BSC.Whereas, the FBLC control uses the linearization method, SMC or BSC are used for compensating the nonlinearity of the system, and this is what makes them popular for the control of PMSM. 14][22] Nowadays, hybrid control strategy is preferred in the EVs (where PSMS is a design element) due to its good performance and smooth operation for automotive control.Therefore, this paper propose an advanced hybrid control composed of the robust nonlinear and an optimal controller applied to PMSM whereas, the robust nonlinear control is based on twisting sliding mode control (T-SMC), and the optimal control is an LQR variant.Among the most extensive and popular categories of variable structure control, there exists a robust category for both linear and non-linear models to handle parameter variation and disturbances, called the sliding mode control (SMC).This nonlinear robust controller is quite effective in real world scenario and exhibits good performance.Whereas, it depends on the existence, convergence, and stability laws to find a switching surface, which can be realized by the state feedback through an appropriate adjustment of the structure of the control system.4][25] Due to the discontinuities applied to the control during the sliding surface, the phenomenon of chattering appears.Since an ideal sliding surface requires control that can switch with infinite frequency, this phenomenon appears around the sliding surface in the form of frequent and excessive oscillations due to the highly discontinuous nature of the signum function.Thus, the performance of the system is compromised, and this makes it a serious barrier to sliding mode control applications.Significant research effort has been directed to eliminate or at least reduce these undesirable effects, for example, replacing the signum function by a function characterized by a composite saturation function with one or two thresholds.Even this approach is not much effective.][28] The second controller based on linear-quadratic controller (LQR) is an optimal controller, which can be applied to a large range of MIMO systems.It is characterized by a quadratic cost function that provides the control designer ample freedom to compromise among various performance criteria.The goal of the LQR control is to minimize the energy and optimize the performance of the system. 29The rest of this paper is organized as follows: Section ''Mathematical modeling of PMSM'' describes the mathematical modeling of the PMSM.The design of the twisting sliding mode control for the speed loop of the PMSM is described in Section ''Design of a sliding mode controller for speed loop.''Whereas, in Section ''N-LQR control based on field oriented compensation of PMSM,'' the LQR regulation/tracking based on the field-oriented control (FOC) is applied on the current loop of the PMSM.In Section ''Simulation results and discussion,'' the detailed simulation results and discussion is covered followed by the conclusion, which is presented in the last section.

Mathematical modeling of PMSM
PMSM works analogous to a three-phase induction machine.A rotating magnetic flux is produced by the three-phase voltage source connected to the stator windings.The poles of the PMSM are equal between the stator and rotor as the rotor is a magnet; therefore, the rotor flux is considered constant, which contributes to reducing brush and rotor losses because it cancels the need for the source to provide an excitation current. 30The voltage imposed on the machines can be expressed in the d-q frame using the motor torque as given in equations ( 1) and (2) respectively 31,32 : di d dt À L q :i q :v e u q = R s :i q + L q : di q dt + L d : There are several methods used to model and simulate the PMSM dynamics as explained in the following subsection.

Transfer function representation
Based on the PMSM model represented in equation (1), the decoupling between the linear model of PMSM and the disturbances is used to find the transfer function of the PMSM model. 33Furthermore, the linear model is designed by using the internal and external model.Where, the first one represents the current loop equations and the second one depicts the speed loop equations after the linearization of the nonlinear electromagnetic equations of PMSM as represented in equation ( 2).Consequently, the internal and external linear model of the PMSM mentioned above is designed as follow: The disturbances are split into the internal and external disturbances.The first one is a non-linear expression, which is calculated by the difference between the nonlinear model represented in equation ( 1) and the internal model shown in equation ( 2).The second one is a linear expression and it is obtained by the load torque applied on the PMSM drive.The disturbances mentioned above are formulated as follow: Using the equation ( 3), the transfer function of the internal and external linear model is as follows: Where, a = 2:F Here, we use the linear state-space representation for both linear internal and external model of PMSM represented in equation ( 3) to describe the system as equation ( 6).This method is similar to the first method on the part of the decoupling to the linear model from the disturbances, but differs with it in terms of temporal or frequency variables, as this method depends on the temporal variable as follows: : : Karboua et al.
Where the disturbances are modeled as follow:

Nonlinear approach
In this representation, we use the following nonlinear equations to represent the dynamics of PMSM 34 : Where: Design of a sliding mode controller for speed loop Sliding mode (SMC) is one of the powerful variable structure nonlinear control techniques that can change structure and switch between two values according to a very specific switching logic S(x), applied to non-linear systems comprising of multiple fields like PMSM.6][37] This controller design is carried out in two steps: convergence toward the surface and then sliding along it, to force the system to reach a certain surface called the sliding surface and stay there until equilibrium. 38,39In this paper, the switching law is developed based on SMC and a speed control loop is designed accordingly.
To apply the SMC on the speed loop, three-step tracking control is designed which is as follows 12,40 :

Choice of the sliding surface
The general formula of the sliding surface is determined according to the order of the system as follows 41 : Where l is a positive number chosen by the designer (scaling factor), S v e , t ð Þis the sliding surface, e(t) is the tracking error of the speed, and n is the system's order.Relying on the non-linear model represented in equations ( 8) and ( 9), we conclude that tracking error is the same as a sliding surface because the speed loop model is of the first order.So, the sliding surface represented in the equation ( 10) becomes as follows:

Determination of sliding conditions
The investigation of the existence of the sliding mode based on the Lyapunov method consists in establishing a scalar function L(x) defined positively for every output ''y'' and designing a control law according to this function such that its derivative decreases, hence assuring the stability of the system, which mathematically can be expressed as following 42 : The condition represented in equation ( 12) guarantees only approximate sliding surface convergence.Therefore, for convergence in finite time, it is replaced by a more restrictive condition called h-attractiveness and is given in the equation ( 13) represented below: where h is a positive number.
There are generally three steps called switching mode or reaching mode (RM), sliding mode (SM), and the steady-state mode (SS), over which, the control systems of variable structure operate.These three steps are illustrated in the Figure 2 below 43 :

Calculation of T-SMC law
The control law of SMC is designed in two stages; the first is called the approaching phase, which refers to the trajectories of the system pointing to the sliding surface S = 0, and the second is called the sliding phase, which maintains these trajectories on this surface.Using these two phases and satisfying the reachability conditions of the surface S(x), the control law is structured into two components.One of these two is continuous and related to the precise control and allows support and slip along the surface, called equivalent term u eq (t).The other is a discontinuous switching term u s (t), which makes it possible to bring the trajectories toward the sliding surface and to ensure robustness with respect to the external disturbances.As the quadratic current is the input of the speed loop, the control law is written as follows. 28,40q Depending on the sliding surface equation and the control law shown in equations ( 11) and ( 14) respectively, the sliding surface derivative can be given as: During the sliding phase, S v e , t ð Þ= 0 and _ S v e , t ð Þ= 0; therefore, the equivalent term i qÀeq t ð Þ is designed to keep the system on the sliding surface.So, the equivalent term i qÀeq (t) can be computed as follows 24,37 : In the approaching phase, where S v e , t ð Þ 6 ¼ 0 and _ S v e , t ð Þ= 0; the switching term i qÀs (t) is designed to satisfy the reaching condition (sliding condition).So, the switching term i qÀs (t) can compute as follows 28 : Where ''K'' is a positive constant and ''sign'' is the signum function defined by: There are system discontinuities in our control loop such as switching delay or actuator limitation during the sliding system, which can switch at an infinite frequency as per the ideal sliding regime.This abrupt response leads to the chattering phenomenon, which forms oscillations around the sliding surface of the system trajectories.
As this phenomenon is harmful to the control unit and leads to the deterioration of accuracy control, which causes overheating of electrical systems and premature deterioration of mechanical systems.To reduce this phenomenon, an interesting approach has been proposed by Gao et Hung, 44 in which the dynamic adaptation of the control component according to the change of the sliding function is proposed.Since, it adopts a non-linear convergence design, for reducing the high-frequency steady-state switching, without affecting the system error or the convergence time. 45By exploiting this proposed approach and replacing the signum function with a continuous approximation, called hyperbolic tangent, the switching law-based T-SMC becomes as follows: where k s1 and k s2 are positive constants.The scheme of a speed control loop based on the proposed SMC is expressed in Figure 3.

N-LQR control based on field oriented compensation of PMSM
In order to meet the objectives of the conventional control like field-oriented control (FOC), the LQR control is proposed for the current loop of the PMSM.Furthermore, the tracking error of the direct and quadratic current is chosen as the state variable, for assessment of the system's performance and minimizing the steady-state error.

Design of the internal linear model based on tracking error dynamics
The state-space model is based on the tracking error, which is represented in equation (3) as: where; x(t) is the state vector, u(t) is the input vector, y(t) is the output vector, e(t) is the tracking error vector, A is the state matrix, B is input matrix, C is output matrix, and D is a matrix of direct transmission as per standard state space notation.Based on the equations ( 3) and ( 20), we can describe the internal linear model of PMSM in equation ( 21): The full state internal linear model of PMSM has been described.Now, its output equation can be written as under: In addition, the tracking error is represented in the equation ( 23): From the equations ( 21) and ( 23), we have: Where ''I'' is the identity matrix.The goal of the design of the state-space model based on tracking error is to force the steady-state error to zero and to make the system tracking asymptotically stable, this means x('), e ' ð Þ, and u(') all approach constant values.Moreover, the steady state of the equation ( 24) is given in the equation (25) shown below: The reference vector is the step vector, which means that: Finally, the error dynamics are obtained by subtracting state and error values at (') from those values at (t) as: We put: Where, u t ð Þ = v d v q ½ T In order to track a constant reference, the output y(t) should reach r(t) and the state derivative should reach to zero in finite time as follows: From equations ( 27) and ( 28), we have: After that, the error vector is represented as: From the equations ( 30) and ( 31), the error dynamics in generalized form are as follows: Where: It is evident that the control law for the error dynamics represented in equation (32) as: However, from equations ( 32) and ( 33), the closed-loop error dynamics are as follows:

Controllability of the error dynamics
Before applying a control based on a state-space model, the controllability of the state-space must be studied.Therefore, if the rank (r) is equal to the system's order that is, degree (n), then the state-space model is controllable.The controllability matrix is obtained by equation (35). 46 Since, the error dynamics presented in equation ( 31) is a fourth-order; therefore, the controllability matrix is depicted as follows: It is straightforward to demonstrate that the rank of Pc is 4, which is the same as the order of the system in equation (31).This indicates clearly that the error dynamics of equation ( 31) are always controllable for input values of v d and v q (Figure 4). 41

Analysis of LQR control with integral action based on full state feedback
The linear quadratic regulator (LQR) based on optimal control provides a systematic method of designing a control law for optimal performance of the linear multivariable systems.It is based on the principle that a feedback gain matrix is calculated through the cost function represented in equation (34) to render the MIMO's error dynamics asymptotically stable by the Q matrix while minimizing the expenditure of energy of the control signals by the R matrix. 10,47= where R and Q are both positive definite matrix.The feedback control law for the internal linear model is expressed in equation ( 39) as: where ''P'' is a positive-definite matrix and is the solution of the reduced-matrix Riccati equation is represented below: A T :P + P:A À P:B:R À1 :B T : Where: T , represent reference input vector (2 3 1); e(t) = e d e q ½ T , represent error variable state (2 3 1); e(t) = x(t) e(t) h i T , represent error vector (4 3 1) and A, B, C are the constant state matrix, input and output matrix respectively; k is an optimal feedback matrix (2 3 2); while kr is the optimal reference matrix (2 3 2).

Simulation results and discussion
The hybrid control strategy for the control of PMSM in an electric vehicle (EV) is proposed in this article.A robust T-SMC controller is applied to the speed control loop and the optimal LQR control is used for the internal linear model of the PMSM's current loop.Thus, the objective of this design framework is to test the PMSM performance and ensure a robust control under parameter variation, disturbances, and variation of PMSM's speed reference in order to verify the performance.The contribution of this research is thoroughly verified in the simulation as per the design framework shown in Figure 5, which establishes its efficacy by using Matlab/Simulink platform.Moreover, some reference scenarios are specifically designed for the validity of the control algorithm.This study simulates three important aspects of the EV operation, which play a fundamental role in the PMSM control performance characteristics, and studies the robustness to both disturbances effect and parameter uncertainties as they occur in real life.In summary, four scenarios are presented to demonstrate the effectiveness of the proposed control.The first scenario examines the most important aspect of the PMSM control, that is, tracking control of speed commands.The reference speed is varied from the low speed (20 rad/s), medium speed (80 rad/s), high speed (300 rad/s), and a complete stop (0 rad/s) with load torque applied from 5 to 10 N m during 0.5 s.
Furthermore, the variation of the load should not affect the performance of the PMSM's speed significantly, as seen from the performance characteristics resulting in overshoot and undershoot on the speed levels.
In addition, regarding the rest of the characteristics, the proposed control strategy shows excellent results.
In terms of the time response characteristics, the results show that the settling time is very small (~5 ms) during both the zero speed and low-speed, it is around 3 ms during the medium speed and 2 ms during the highspeed operation.The steady-state error is almost nonexistent whereas, the estimated overshoot is 0.5% during the low speed.Figure 6 illustrates the validity of these scenarios.
In order to prove the robustness of the proposed control under the disturbance effect, the load torque is varied between 0 and 5 N m at different time instants.Figure 7 shows the simulation results for the PMSM's performance, where the robustness of the controller is proven by the minimal undershoot or overshoot which  is projected at 0.15% of the peak value in Figure 7(a) and (b).Moreover, regarding the tolerance band of the direct and quadratic current, it is estimated as a negligible value as shown by the performance curves of the currents in Figure 7(c) and (d).
The third scenario studies the robustness of the controller against the parameter variation, where the PMSM model parameters (L d , L q, and J) are changed to 250%, + 50%, and + 100%.Figure 8(a) illustrates the performance curves where no oscillations or even any overshoots are visible in the speed tracking.Only a slight overshoot appears when applying a load torque at 0.6 s, where, the steady-state error has slightly changed to 0.04%, and the largest settling time is 3 ms  as shown in Figure 8(b).The electromagnetic torque is also affected by a very small percentage, the d-q currents have optimal results within a small tolerance band, a fast and stable response with a very small steady-state error as in Figure 8(c).
To summarize the results of the proposed control scheme, and to highlight the contribution of this paper, a comparative study is presented for the proposed controller that is, novel optimal twisting SMC (OT-SMC), Twisting SMC with exponential reaching law (T-SMC), and classical SMC (C-SMC).The comparative results of the three controllers are shown in Figure 9.The simulation plots depicts that the proposed control scheme works well as compared to the T-SMC and C-SMC, where it ensures the advantage and efficiency through the optimal performance characteristics.The comparative results of Figure 9(a) and (b) are numerically expressed in Table 1, which shows a small steady-state error (SSE) and settling time for T-SMC as compared to C-SMC.
As observed, OT-SMC outperforms the two controllers by showing the lowest settling time and SSE in addition to the robustness to the changing parameters and variable load torque.Furthermore, the harmonic analysis of the current of the three controllers (OT-SMC, T-SMC, and C-SMC) that shown in Figure 10 illustrates the advantage of the proposed controller as it results in the lowest value of total harmonic distortion

Conclusion
This paper presents a hybrid controller scheme for the control of the PMSM to drive an Electric Vehicle stably and effectively under varying operating conditions.The prime objective is to improve the performance of the PMSM in the presence of real-world disturbances and modeling uncertainties.The Twisting SMC (T-SMC) is applied on the speed loop, which gives the reference quadratic current with excellent performance characteristics.After that, the LQR optimal controller is used as an internal linear model of the current loop of the PMSM.Moreover, the error dynamics are added as the state variable, which contributes in enhancing the accuracy of the optimal control performance.Finally, simulation results demonstrated the validity and feasibility of this contribution for good performance and robust

Figure 2 .
Figure 2. System trajectory on the phase plane.

Figure 3 .
Figure 3. Scheme of speed loop based on proposed T-SMC.

Figure 4 .
Figure 4. Current decoupling model of the PMSM based on optimal LQR control.

Figure 7 .
Figure 7. Second scenario: Effect of load torque on speed control: (a) Speed following, (b) Torque variation, (c) d-q currents, and (d) abc currents.

Figure 8 .
Figure 8. Third scenario: Robustness against the parameter variation: (a) Speed following with parametric uncertainty, (b) Torques, and (c) d-q currents.

(
THD) as compared to the T-SMC and C-SMC respectively.A comprehensive comparison of these three control schemes are presented in Table1to demonstrate the advantage of the proposed control in this paper.The simulation parameters of PMSM include R s = 0.6 O, L d = 1.4 3 10 23 h, L q = 2.8 3 10 23 h, j = 0.0011 kg m 2 , F = 0.0014 M m s 21 , [ f = 0.12 Wb, Ks 1 = 0.1, p = 4 as derived from Hussain.23

Table 1 .
Control performance comparison of the three schemes.