Real-Time HIL Simulation of Nonlinear Generalized Model Predictive-Based High-Order SMC for Permanent Magnet Synchronous Machine Drive

,


Introduction
In the modern industrial world, permanent magnet synchronous motors (PMSMs) play a signifcant position in the regulation of processes, automation systems, and the development of renewable energy sources [1].All of this is attributable to their superior performance in terms of efciency, torque, and power density as well as their dependability and reduced bulk.In addition, their construction is simpler because they lack mechanical switches, which extends their lifespan and reduces the need for ongoing maintenance [1,2].Additionally, these engines have the beneft of releasing zero greenhouse emissions, which is particularly advantageous for environmental conservation [3].Te PMSM, on the other hand, operates like a nonlinear system with quick dynamics, variable operating parameters, and unidentifed disturbances [4,5].Te machine's control is made more difcult by these features.Numerous studies on the control of PMSM have been published in the literature and the business sector as solutions to the aforementioned issues.Te current research indicates that the controls based on linear and nonlinear techniques are controls that are both highly common and useful.
Te widely utilized proportional-integral (PI) control is a linear control technique.It generates a continuous reference output, which subsequently undergoes conversion into a digital format via pulse width modulation (PWM)a fundamental control strategy.Yet, when striving for heightened performance and precision in speed regulation, PI controllers fall short.Alternative methods gaining popularity include state feedback control [6] and impulse control [7].Remarkably, these approaches share a common requirement: the integration of PWM.Conventional linear control system design typically assumes operation within a linear region.However, the complexities and constraints within power electronics and drive systems, often unreported, introduce numerous limitations and nonlinearities [8].Such traditional control paradigms might prove insufcient for systems featuring nonlinearity or variable parameters.Teir susceptibility to fragility becomes pronounced, especially when stringent demands for accuracy and dynamic system attributes are at play.Consequently, the need arises for control strategies capable of resilience against parameter variations, disturbances, and nonlinearities.
Many methods have been tried to account for the permanent magnet synchronous machine's nonlinearities.In [9], direct control of the speed associated with a statedependent Riccati equation is described; two explicit limitations are the feld-weakening curve and the current amplitude.Te cost function at the controller arrival is known, and the problem is, therefore, formulated as a quadratic program with a quadratic constraint.A new extended state observer using sliding mode is proposed in [10] to enhance the disturbance compensation and rejection as well as the dynamical efciency of PMSM control systems.For a more precise comparison, an extended observer that is based on the fast terminal sliding mode control strategy is described.It has the beneft of greater robustness against load disturbances, fnite time integration, and a considerable reduction of the "chattering" phenomenon.An improved nonlinear fux observer is put forth in [11].Studying the method of rotor position estimate from fux monitoring comes frst.Te limitations of classic rotor fux variation estimation methods are then investigated, including classical integrator saturation, low-pass flter amplitude decreasing, and phase change.A fuzzy adaptive controller is provided in [12].Te Takagi-Sugeno fuzzy membership criterion allows you to convert the nonlinear PMSM model into equivalent linear submodels.Ten, in collaboration with a fractional sliding surface that has an integral criterion, an adaptive controller is developed in order to regulate the PMSM.Te authors of [13] expose a sliding mode control (SMC) based on an adaptive speed controller.Using a nonlinear disturbance observer (DO), the hybrid controller SMC is constructed in [14].Te most efective strategy for enhancing the drive systems' ability to reject disturbances is DO-based control.Its performance in dynamic control and load torque disturbance rejection capabilities is weak in the middle.As a result, although the sliding mode occasionally results in high-frequency shifts (chattering), these switches instead produce unwanted behaviors that have the potential to destabilize, harm, or even destroy the system under consideration.Another control strategy that is applied to PMSM control called the "passivity-based control (PBC)" strategy emerges as a distinctive approach that takes into account the intricate interplay between the motor's electrical and mechanical components, subject to specifc conditions [1].PBC manifests in several variants, such as passivity-based current control [15], voltage control [16], and interconnection and damping assignment PBC [17], each catering to precise control objectives within the PMSM system.Moreover, recent strides in PMSM control have introduced pioneering methodologies to elevate performance and resilience.For instance, a robust backstepping compensator, coupled with a nonlinear disturbance observer, fortifes the system against disturbances [18].Tis compensator ofers improved disturbance rejection capabilities, bolstering the motor's stability and robustness in the presence of external perturbations.Additionally, sensorless control strategies built upon a nonlinear fux observer [19] have gained prominence. Tese sensorless techniques enable accurate estimation of crucial rotor parameters, such as position and speed, without the need for additional sensors.While these advancements hold promise for simplifying system design and reducing hardware costs, they are not without their challenges.Implementing robust compensators may require careful tuning, and sensorless techniques are often sensitive to parameter variations and may have limitations in rapidly changing operating conditions.Nonetheless, these pioneering methodologies represent valuable contributions to the feld of PMSM control, addressing the need for improved performance and resilience in various applications.
Model predictive control (MPC), presently considered one of the most trustworthy control strategies by many researchers, is garnering a lot of interest due to its straightforward implementation, its capacity for direct management of constraints and nonlinearities of the systems, which guarantees satisfactory system performances [20].MPC is a feedback control algorithm that makes use of a model to forecast outputs over a given period of time.Tese forecasts are then used to choose the best control by solving a particular optimization problem while adhering to a predefned constraint (cost function) [21].Te three steps of the MPC approach are the feedback structure, the regressive optimization, and the predictive model.
Many composite algorithms based on MPC have been put out in recent years to improve PMSM control performance due to the rapid development of microcontrollers and advances in MPC research [22,23].In [24], a cascaded MPC structure with speed control as the outer loop and current control as the inner loop is presented for the PMSM.Te external-loop MPC design incorporates a disturbance model with signal generators for zerofrequency and frst-frequency modes to lessen the impact of periodic perturbation brought on by current sensor ofset inaccuracies in the velocity regulator of a PMSM.Te established torque-ripple models, however, are frequently erroneous and complex [23].To get a good estimate of the International Transactions on Electrical Energy Systems torque, a hybrid approach employing FCS-MPC with a lookup table is suggested [22].Duty cycle control [25,26] and quantitative search [27] are two more enhancements that have been suggested.Many of the aforementioned modifcations can lessen current ripple and torque.Additionally, some researchers [28] have put a control strategy that combines MPC and observer forth [29].Te authors of [30] study the use of continuous model-time predictive control (CTMPC) to train a PMSM.Te MPC problem with a nonlinear perturbation observer and an unknown load torque is solved by the CTMPC using an expansion of the Taylor series.Tese tests demonstrate the method's efectiveness.However, it is impossible to see ripples brought on by a mechanical component (such as cogging torque and load oscillations) [31].Te construction of a disturbance observer is not straightforward in the case of a PMSM, which makes the analysis of the closed-loop system extremely difcult [32].
Tis research introduces an innovative hybrid control approach that capitalizes on high-order sliding mode control (HSMC) to attain optimal torque and trajectory speed for the outer loop.Tis design choice not only enables efective suppression or elimination of the chattering phenomenon but also preserves the system's convergence and robustness attributes.Complementing this, the inner loop employs the robust generalized nonlinear predictive control technique to manage the current control aspect.Te proposed control strategy is designed with a holistic understanding of the complete dynamics of the permanent magnet synchronous motor (PMSM).Te development of the nonlinear generalized predictive control law is achieved by fne-tuning a newly formulated cost function.To enhance disturbance mitigation, the controller incorporates an integral action.A noteworthy aspect of this novel method is its inherent capacity to enhance system robustness without necessitating detailed knowledge of external disturbances or uncertainties in system parameters.
In this paper, a new design process of continuous modeltime predictive control is studied, and a robust nonlinear generalized predictive control law is formulated by optimizing a new cost function, where integral action is added to the controller to enhance disturbance rejection.Tis novel control strategy ofers an analytical solution for the control of multivariable nonlinear systems, eliminating the need for computationally intensive online calculations.An essential characteristic of this proposed control method is its robustness, as it does not depend on prior knowledge of external disturbances or uncertainties in system parameters to achieve superior performance.
Te following succinctly expresses this work's contribution and originality: (i) New nonlinear generalized model predictive-based high-order sliding mode control for permanent magnet synchronous machine with a new optimized cost function is proposed (ii) Te proposed controller guarantees setpoint tracking performance and robustness against sudden load torque variations (external disturbance) as well as parametric variations and eliminates the efects of disturbances without the need for a disturbance observer making it easy to implement (iii) Numerous numerical simulations are carried out to demonstrate the suggested technique's resistance to parameter changes and outside disruptions where the simulation results demonstrate the efciency of this control, which enables the system to maintain its stability in a closed loop Te structure of this document is as follows: Section 2 describes the permanent magnet motor system.Te calculation of the classical and proposed control strategy for the PMSM is discussed in Section 3. In Section 4, the simulation tests of the suggested approach are presented.Section 5 depicts the experimental results using OPAL-RT.Section 6 concludes with the key fndings.

Permanent Magnet Synchronous Motor Dynamic Description
Dynamic modeling of PMSM is an indispensable step for control design engineering.It involves the rigorous formulation of mathematical equations that encapsulate the intricate electromagnetic and mechanical dynamics inherent in PMSM.Tese models serve as a foundational framework for predictive analysis, afording us the capacity to prognosticate the system's response across a spectrum of operational parameters, such as load variations and diverse control algorithms.Te paramount utility of dynamic modeling manifests in its role as an enabling instrument for optimizing motor efciency, architecting high-fdelity control algorithms, and implementing robust fault detection mechanisms.Nevertheless, confronting the nonlinearities intrinsic to PMSM and iteratively refning parameter estimations remain formidable tasks.In spite of these complexities, dynamic modeling persists as a cornerstone of contemporary electric machines and drives research, propelling the frontier of energy-efcient and fault-tolerant motor systems [33,34].Assuming the rotor's position has no efect on the inductance and that the rotor's fux axis is parallel to the machine's d-axis.Te mathematical model of the PMSM is constructed by transforming the three-phase variables in the stator reference frame into two-phase variables in the rotor d-q reference frame [6].In this case, the nonlinear mathematical model of the PMSM is given by International Transactions on Electrical Energy Systems where R s , L d , and L q are the stator per phase (Ohm) and direct and quadrature axis stator self-inductances in the rotor reference frame (H), respectively.P is a number of poles-pairs, φ f is links between armatures fux created by rotor magnets (Wb), and J is the inertia moment (kg.m 2 ).T em is the electromagnetic torque (N-m), J is the inertia moment (kg.m 2 ), w r is mechanical rotor speed (rad/sec), and f represents the coefcient of viscous friction (N.m.s/ rad).Te synchronous machine model can be expressed as follows: where i dq � i d i q   is the stator currents vector in the dqframe, L dq � L d 0 0 L q   is the stator inductions matrix in dqframe, ψ f � φ f 0   is the fux linkages' vector in the dqframe, V dq � v d v q   is the voltage stator's vector in the dq- is the stator resistance matrix in the dq-frame, I � 0 −1 1 0  , and T em can be written as follows: Te dynamics of the current-controlled PMSM can be reduced to the following model:

Design of the Proposed Control Approach
Figure 1 illustrates the computational process of the explored strategy, which has two distinct components: the frst phase is to design the reference quadratic current using the electromagnetic torque calculated by the HSMC technique, and the required current is then calculated using the required torque.In the second part, the controller law is calculated using the robust generalized nonlinear predictive control technique.
If the direct current id is zero, PMSM runs at its maximum torque.Ten, in light of the relationship (4), the d-q axis desired fux is selected as follows [8]: Te desired torque is determined by the following relationship from equations ( 4) and ( 5): Tis results in Te desired fux along the quadratic axis q, according to equations ( 9) and (11), is defned by 3.1.Calculation of the Desired Torque.According to equation (12), the reference torque is formulated as follows: where ε � (w * r − w r ) represents the speed error between the reference and the PMSM velocity.Te appropriate dynamic is to reduce this velocity tracking error as much as possible.According to equation ( 12), the desired torque T * em has two drawbacks: the dependence of its convergence on the mechanical parameters of the PMSM (J, f ) and it is open loop.To address these issues, in [35], the (f ) term was removed and T * em was calculated by a PID controller.However, the authors mentioned that this strategy still has a drawback with the change of J due to the fxed gains of the PID.To address this drawback, SMC is proposed given its high stability, fast dynamic response, and robustness ability to replace PI loop [36].However, in reality, the sliding approach results in "chattering," which is a sort of highswitching frequency that leads to unintended dynamics, which can destabilize, deteriorate, or even destruct the 4 International Transactions on Electrical Energy Systems system under investigation.To overcome the chattering challenge, a high-order SMC is established, which operates on the assumption of avoiding singularities in the scheme's higher derivatives, in order to overcome the chattering challenge and compensate for the disturbance of the resistive torque in the speed response, and we propose to control the machine using the HSMC strategy to replace the PID and calculate the required torque as shown in the following equation: where a 1 > 0, a 2 > 0, and ε � (w * r − w r ) represent the speed error.Referring to a classic cascade control, the input quantity of the system is the reference speed which is compared to the real speed, to generate the setpoint of the transverse component of the current, using the HSMC control law described by the equation ( 14) and using equation (11), and the setpoint of the transverse component of the current is given by (15)

Model Predictive Control Teory. Model predictive control (MPC
) is an advanced control strategy employed in various engineering applications, including the control of permanent magnet synchronous motors (PMSMs).MPC ofers a predictive approach to managing the operation of PMSMs by utilizing a dynamic model of the motor system.
Here is a detailed explanation of model predictive control in the context of PMSMs: model predictive control starts with a detailed mathematical model of the PMSM, which incorporates the electrical, mechanical, and magnetic dynamics of the motor.Tis model is used to predict how the motor will behave over a defned prediction horizon into the future.Te control objective is to optimize control inputs, typically voltage or current, over this prediction horizon while considering constraints on variables such as current limits, voltage limits, and motor speed.MPC continuously reevaluates and adjusts the control inputs at each control step, ensuring that the system closely follows desired trajectories and minimizes a predefned cost function [35,36].One of the key advantages of MPC for PMSM control is its ability to handle complex and nonlinear dynamics, making it suitable for high-performance applications.MPC also accounts for constraints, ensuring that the motor operates safely within its specifed limits, which can be crucial in real-world applications.However, MPC does come with some challenges.It requires an accurate dynamic model International Transactions on Electrical Energy Systems of the motor, which may be difcult to obtain in practice due to uncertainties or parameter variations.Additionally, the computational demands of MPC can be signifcant, especially for high-speed control loops, although advances in hardware and algorithms have helped mitigate this issue.In summary, model predictive control is a powerful strategy for achieving precise and dynamic control of permanent magnet synchronous motors, but its efectiveness depends on the quality of the dynamic model and the computational resources available [37].For more details about the theory of MPC and its applications, the reader is referred to [38,39].Te cost function in MPC for PMSMs serves as a cornerstone in achieving optimal motor control.It acts as the guiding criterion for the MPC controller, defning the performance goals and constraints for the system.By formulating a well-designed cost function, engineers can precisely specify the desired trade-ofs among various aspects of motor performance, including speed regulation, torque accuracy, energy efciency, and system stability.Additionally, the cost function plays a crucial role in handling operational constraints, ensuring that control inputs remain within safe limits while striving for optimal performance.MPC's ability to incorporate multiobjective optimization within the cost function enables engineers to balance conficting goals efectively.Furthermore, the adaptability of the cost function allows MPC to respond to changing operating conditions and disturbances, making it a valuable tool for achieving precise and robust control of PMSMs in diverse applications [40].

Classical Nonlinear Generalized Predictive Control Design (NGPC).
Te control approach proposed in this study is based on MPC, and it is currently regarded by many scientists as one of the most reliable control strategies and attracts a lot of attention due to its simple implementation and its ability to directly handle system constraints and nonlinearities, thus ensuring satisfactory system performance [15].MPC is a feedback control algorithm that uses a model to predict future outputs over a specifed period of time, and these predictions are then used to select the optimal control by solving a specifc optimization problem while satisfying a predefned constraint (cost function) [16,24].Te MPC method consists of three steps: the predictive model, the regressive optimization, and the feedback structure.In this paper, the robustness of the classical nonlinear generalized predictive control (NGPC), based on Taylor series expansion, is improved by revising its cost function.
In order to accommodate for the modularization errors and external disturbances comprehensively, the subsequent conditions have been delineated: Te electrical subsystem model for the synchronous machine, considering the infuence of ( 16), may be articulated in the following manner: Te components F d and F q correspond to fuctuations in parameters and are expounded as follows: In the absence of a precise understanding of the dynamics underlying various uncertainties, it is postulated that their progression occurs at a comparatively gradual pace in relation to the system's time constants.Consequently, we may express it as follows: Te bilinear system that represents the electrical subsystem could be written in the following form: with: the vector of disturbances caused by the parameter variations is F(t) � F d F q  .Te objective of the controller is the regulation of the current components, which means that the output vector is y(t) � y 1 (t) To surmount the challenge of real-time computation and attain a closed-form optimal nonlinear generalized predictive control (NGPC), a novel approach has been posited.Tis method involves the constraint of control order to zero, thereby ensuring the constancy of control efort within the prediction interval.An analytical solution can be derived by setting the prediction horizon to zero.Predictive control's fundamental objective lies in the computation of control u(t) such that the forthcoming motor outputs, denoted as y(t + τ) for 0 ≤ τ ≤ T r , converge towards y r (t + τ), all while taking into account the presence of perturbations.Tis objective is realized through the minimization of the cost function J over a prediction horizon of time T r [37]. with: , and T r signifes the prediction time horizon, wherein y r (t + τ) signifes the envisioned future reference trajectory, while y(t + τ) signifes the anticipated value of the system's output τ steps ahead.Consequently, the quadratic performance index embodied in the cost function J undergoes a modifcation as follows: Te prediction of the output is computed through the utilization of a Taylor series expansion: Let us denote ρ i the relative degree of each output y i (t): i � 1, 2, which determines the number of times the output must be diferentiated before the input u appears.Te Lie derivative of the functions h k (x) along a vector feld is denoted using the following notation: f(x) � (f 1 (x) . . .f n (x)) [32].
We allow ρ i to represent the relative degree associated with each output y i (t): i � 1, 2, a parameter that signifes the number of diferentiations the output y_i(t) must undergo prior to the input u becoming apparent: Employing equation ( 20): International Transactions on Electrical Energy Systems

⎧ ⎨ ⎩ (25)
Te relative degree of the outputs y 1 (t) and y 2 (t) is denoted as ρ 1,2 � 1. Tis signifes that the Lie derivatives of the functions h k (x) are nonzero and may be articulated as follows: In order to ascertain the optimal order, it is imperative to satisfy the following prerequisite conditions: By integrating equations ( 26) and ( 27) into equation ( 22) and subsequently minimizing the cost function (22), the resultant optimal nonlinear control can be elucidated as follows: With: Te matrixes K 1 , K 2 , and H 1 (x) are presented as follows:

Stability Analysis.
To analyze the stability of the closedloop system, it is necessary to determine the tracking errors at the origin.Tis can be achieved by obtaining the characteristic equation of the closed-loop system, which is derived by substituting equation ( 29) into equation ( 25): Te poles of the characteristic equation are as follows: s d � −3/2T r1 ; s q � −3/2T r2 .Te closed-loop system attains asymptotic stability owing to the presence of negative real parts in all of its poles.When knowledge of the disturbance is available, the dynamics of the tracking error are solely dictated by the prediction time, with a quicker response corresponding to a shorter prediction time.Nevertheless, even when the resistive torque is known, the identifcation of uncertainties and model variations remains a challenging task, necessitating the intervention of an observer.Te incorporation of disturbance compensation in the controller is intricate due to the relative degree of the disturbance being lower than that of the input [32].Furthermore, if the disturbance is neglected within the controller, it leads to a steady-state error in the closed-loop system, as delineated in the ensuing equation:

Robust Nonlinear Generalized Predictive Control Design (RNGPC).
Te principal limitation of the aforementioned classical predictive control resides in its reliance upon acquiring knowledge about disturbances, a task that proves challenging to procure and must be estimated through the expertise of an observer.Tis challenge escalates in situations where the perturbation rate lags behind that of the primary source, as exemplifed in the context of PMSM.
In such instances, crafting a precise disturbance observation 8 International Transactions on Electrical Energy Systems becomes an undertaking, leading to a heightened level of complexity in the design of the closed-loop system.
To improve disturbance mitigation, we have introduced an integral action within the controller.Te noteworthy attribute of this proposed control scheme is its capability to enhance robustness without the need for explicit knowledge of external disturbances and parameter uncertainties.Te research methodology employed comprises fve principal steps, as depicted in Figure 2.
Te quadrature criterion translating the objective of the internal loop that is proposed is written in the following form: where T r1 , T r2 are the prediction time for output 1 and 2, respectively.Te integral of the sortie error is Te sortie error with y ri the desired trajectory and y i the system output is e i (τ) � (y ri (τ ) − y i (τ))i � d, q, with y(t + τ), y r (t + τ) are the prediction at τ steps ahead of the system output and that of the desired trajectory in the future, respectively.Te predicted value of I i (t + τ) in this case is obtained by a Taylor series expansion with (ρ i + 1).
If we disregard the disturbance, the expression (25) leads to the following equation: Te predicted I i (t + τ) term is calculated by the following equation: with: ( Using the equation (37) in the cost function ( 34), we will have the following equation: with: In order to fnd the optimal order, we must satisfy the following necessary conditions: By directly applying the control law defned by (39), we obtain the following optimal control law in the sense of the criterion (41): International Transactions on Electrical Energy Systems Te control design methodology encompasses several key steps as shown in Figure 2. First, a state model is established for the PMSM in accordance with equation (1).Next, leveraging high-order sliding mode control, the optimal torque is calculated as outlined in equation (14).To address the infuence of unknown disturbances, a crucial step involves the selection of a suitable cost function that incorporates integral action within the optimal control expression, as described by equation (34).Employing Taylor series development, the integral of error outputs and their corresponding references are predicted, as detailed in equations ( 39)-( 42).Te culmination of these eforts involves the computation of optimal predictive control, achieved by optimizing the performance criterion articulated in equation (14).
Te proposed new controller incorporates integral action; therefore, if the closed-loop system is stable, the steadystate error is eliminated despite the unknown disturbances.Terefore, it is simple to construct the controller provided by (42) since no disturbances are included.

Te Closed-Loop System's Stability.
To assess the stability of the closed-loop system, it is necessary to look at the stability of the output tracking errors at the origin.Te following characteristic equation of the closed-loop system of the outer loop is produced by substituting ( 42) into (36): Te poles of the characteristic equation are as follows: Because every poll has a negative real portion, the closedloop system is asymptotically stable.In the case where the disturbance is known, the dynamics of the tracking error depend only on prediction time.Te smaller the prediction time, the faster the response.
In order to efectively mitigate the impact of unforeseen disturbances, a pivotal aspect involves the careful choice of a cost function that integrates integral action into the optimal control formulation, as elucidated by Equation (37).Tis objective is realized through the minimization of the cost function over a prediction horizon of time.
By employing the Taylor series expansion technique, we forecast the integral of error outputs and their respective reference values, as comprehensively elaborated in Equations ( 44) through (47).Tis approach involves a systematic mathematical procedure that facilitates the prediction of these integral components, enhancing our understanding and control of the system dynamics.
Te culmination of these endeavors entails the calculation of optimal predictive control.Tis is accomplished through the meticulous optimization of the performance criterion as defned in Equation ( 15).
First, create a state model is established for the PMSM in accordance with Equation ( 1) Utilizing advanced high-order SMC techniques, we compute the optimal torque according to Equation (15).
Step 5 Step 1 Step 2 Step 3 Step 4 Figure Control design methodology.
10 International Transactions on Electrical Energy Systems

Simulation results
Simulations were run using the Matlab/Simulink program to assess the efectiveness and performance of the suggested control.Te predictive times T r1 and T r2 are taken 0.7 ms.Te sampling time of the controller T C and the sampling time in the mathematical model of the PMSM T S are chosen equal to 10 −5 s.Te pole placement approach is used to determine the HSMC gains a 1 and a 2 .Te values used are a 1 � 13 and a 2 � 2000.Te reference trajectory tracking performances are studied under unknown load torque and parameter uncertainties.Te reference velocity passes through a flter so that the dynamics of the reference trajectory are adequate, and this avoids a strong phase current.Te motor is driven by a voltage inverter under PWM control, and the parameters of the investigated PMSM are specifed in Table 1.

Performance Evaluation for Constants Parameter Values.
Within the dedicated section, we engage in a comprehensive assessment of the proposed controller's performance while the PMSM operates with fxed parameters under varying load torque conditions.Tis rigorous evaluation is a critical component of our research, aiming to provide a deep understanding of how the controller responds to diferent load scenarios.
Troughout this section, we meticulously investigate the system's behavior across specifc time intervals, each representing a distinct phase of our analysis.Tese time intervals are denoted as tϵ [0 1] s, [1 3] s, [3 6] s, [7 9] s, and [9 12] s, and they play a pivotal role in our evaluation framework.Within each interval, we precisely defne the magnitude of the resistive torque applied to the PMSM.Te resistive torque profles are as follows: (i) In the initial time interval [0 1] s, the system operates under a constant resistive torque of 0 Nm (ii) Moving to the interval [1 3] s, the resistive torque is elevated to 0.5 Nm (iii) During the subsequent phase of [3 6] s, the resistive torque returns to 0 Nm (iv) As we progress to [7 9] s, the system experiences another episode of resistive torque, set at 0.5 Nm (v) Finally, in the concluding interval of [9 12] s, the resistive torque is once again reduced to 0 Nm Tis meticulous approach to performance evaluation enables us to gain in-depth insights into how the proposed controller reacts to varying load torque conditions.It empowers us to draw meaningful conclusions regarding the controller's efectiveness, stability, and adaptability across a spectrum of real-world operational scenarios.Tese fndings contribute signifcantly to the broader understanding of our research outcomes and the controller's potential applications.
Figure 3 showcases the simulation outcomes for the velocity trajectory tracking of RNGPC and the proposed control while accounting for varying load torque.Notably, the proposed controller efectively neutralizes the infuence exerted by the resistive torque.Remarkably, the speed signal demonstrates an impressively prompt response time, seamlessly maintaining its reference point with an exceptionally brief latency.
Figure 4 shows the simulation outcomes for the speed trajectory tracking error, measured in (pu), of both RNGPC and the proposed control, while accounting for varying load torque.As depicted in the graphs, in both control strategies, the error swiftly converges to 0 within a remarkably short timeframe and attains a steady state of zero for every change in load torque.However, it is worth noting that the proposed control exhibits superior error convergence to 0 compared to RNGPC across all variations in load torque.Figure 5 shows the simulation outcomes for the electromagnetic torque and load torque, comparing the performance of RNGPC and the proposed control under varying resistive torque conditions.From the depicted plots, it is evident that the electromagnetic torque progressively rises until it reaches a magnitude equivalent to the combined load torque and friction, thereby precisely tracking their values.
Figure 6 illustrates the simulation outcomes for the stator current components, i q and i d , under the infuence of varying load torque, specifcally with the implementation of the proposed control.Te fgure highlights that, with the proposed control, the i d component remains consistently aligned with its reference value of zero across all load torque variations.Additionally, the i q component aligns itself with its reference value, denoted as i qref , and impeccably tracks it for every change in load torque.It is worth noting that the oscillations observed in the signals are attributed to the motor supply inverter, while the peaks are a consequence of the form of the setpoint speed.Notably, the proposed method delivers commendable performance, ensuring stability across all signals.
Figure 7 exhibits the simulation outcomes depicting the evolution of the current i a for both RNGPC and the proposed control, considering variations in load torque.Notably, the proposed control demonstrates commendable performance, ensuring stability across all signals.Consequently, the observed peaks can be attributed to the specifc shape or form of the input.s, while a setpoint step of 120 rads/s was applied for each test.Figure 8 presents the simulation results for the velocity trajectory tracking of both RNGPC and the proposed control, considering fuctuations in both load torque and machine parameters.Te visual representations within Figure 8 lead to the conclusion that the motor speed adeptly tracks its desired trajectory, demonstrating a rapid response and efective rejection of disturbances for both control algorithms.Nonetheless, it is evident that the proposed algorithm exhibits enhanced stability attributes, characterized by a robust response and profcient disturbance rejection capabilities.International Transactions on Electrical Energy Systems RNGPC.Furthermore, the error converges rapidly to zero and eventually achieves a steady state.Figure 10 presents the simulation results for the electromagnetic torque and load torque of the machine under the infuence of variations in resistive torque and machine parameters.Both the proposed control and RNGPC are displayed in the graphs.As observed, the electromagnetic torque gradually increases until it reaches a magnitude equivalent to the combined load torque and friction, precisely aligning with these values.
Figure 11 shows the armature current components, i d and i q axis, for diferent variations in resistive torque and machine parameters, as observed in both RNGPC and the proposed control.Upon careful examination, it is evident that the i d axis component remains consistently at zero for all variations in load torque and machine parameters.However, it is noteworthy that the i q axis component fails to accurately track its reference value under these conditions.To assess the quality of the controlled responses, two commonly used metrics, namely, the integral time-weighted absolute error (ITAE) and integral squared error (ISE), were employed in conjunction with diferent control strategies.Te corresponding results are presented in Figures 12 and  13.Tese fndings clearly demonstrate that the responses obtained through the proposed strategy generally outperform those obtained by other techniques, including NGPC with observer and RNGPC.
Te fndings presented in this study support the objectives outlined in the introduction section, confrming the efcacy of the proposed technique.Specifcally, the suggested approach successfully achieves the goals of maintaining the motor speed at its designated reference value and ensuring the efcient, secure, and reliable operation of the id with RNGPC (+50%Rs at t=5 s) id with proposed control (+50% Rs at t=5 s) id reference iq reference iq with proposed control (+50% Rs at t=5 s) Axis currents id, iq (A) id with RNGPC (+5% f at t=5 s) id with proposed control (+5% f at t=5 s) id reference iq with proposed control (+5% f at t=5 s)   16 International Transactions on Electrical Energy Systems PMSM, even in the presence of potential electrical power disruptions.

Experimental Results
Te OPAL-RT system employs hardware-in-the-loop (HIL) simulation, bridging software-based simulations and realworld hardware.It integrates the OP 4510 board and related components into a real-time simulation environment.Tis board incorporates powerful feld-programmable gate array (FPGA) blocks for emulating and interacting with simulated systems.Te RT-Lab interface links MATLAB/Simulink to real-time hardware, enabling interactive feedback between virtual models and physical components.HIL simulation with OPAL-RT is valuable for testing control algorithms, validating designs, analyzing complex systems, and reducing the need for costly real-world testing [41,42].Te confguration of the real-time simulator setup is depicted in Figure 14.It involves several integral components, namely, (1) the MATLAB/Simulink software and RT-Lab platform for execution, (2) a host PC, (3) the OPAL-RT 4510 equipment, and (4) a digital oscilloscope.Te process unfolded with the decomposition and adaptation of the PMSM simulation system for integration into the RT-Lab platform, eventually culminating in the execution of realtime simulations.
Te experimental framework was further manifested through Figures 15-17, which show the results obtained from the proposed technique when subjected to perturbations in load torque.Remarkably, the outcomes derived from the discrete real-time simulator, RT-LAB, exhibit a remarkable proximity to the results anticipated from the simulation.Tis underscores the fdelity and accuracy of the real-time simulation process facilitated by the OPAL-RT system.
Figure 15 shows the simulation results pertaining to rotor speed trajectory tracking.Te plot clearly demonstrates the remarkable fdelity between the actual rotor speed and the reference trajectory.Even in the presence of load torque, the control system efectively eliminates steady-state errors, ensuring precise tracking.Moving to Figure 16, we delve into the evolution of electromagnetic torque.Here, the measured torque exhibits an impressive performance by closely tracking its reference with minimal ripple, even when dealing with abrupt trajectory changes.Tis observation underscores the robustness and accuracy of the control approach in maintaining torque control objectives.Te simulation results for the d-axis component of the armature current are presented in Figure 17.Notably, the d-axis current component remains consistently aligned with its prescribed reference, demonstrating the controller's ability to maintain desired current values accurately.International Transactions on Electrical Energy Systems Tus, these experimental fndings serve as compelling evidence of the validity and efectiveness of the proposed control approach.Te close agreement between simulation and experimental results attests to the robustness and realtime applicability of the control strategy, reafrming its potential for practical implementation in various motor control applications.

Conclusion
Tis paper introduces an innovative control approach that combines HSMC with generalized nonlinear robust predictive control (RNGPC) for the PMSM.Te primary control objective is to achieve accurate speed tracking and ensure robustness against external disturbances and parameter uncertainties.To accomplish this, the HSMC controller is frst employed to determine the current reference (i qref ), followed by the utilization of the RNGPC controller to determine the reference voltage.A key contribution of this work is the introduction of a novel fnite horizon cost function for RNGPC, which incorporates integral action in the control loop, thereby enhancing robustness against parametric uncertainties and external disturbances.
One notable feature of this method is its independence from a disturbance observer, yet it signifcantly enhances disturbance rejection and robustness against parameter variations.Tis unique aspect of the proposed approach sets it apart in the realm of motor control strategies.To thoroughly assess the efectiveness of the proposed controller, comprehensive testing is conducted under diverse operating conditions, including scenarios with mismatched parameters and external disturbances.To provide a clearer analysis and discussion of the presented results, we introduce performance indices and metrics that highlight the controller's capabilities: (i) Tracking Performance: Te tracking error, represented as the deviation between the actual speed and the reference trajectory, is a critical metric.Te results demonstrate that the proposed control approach exhibits minimal tracking errors, signifying its ability to accurately track desired speed profles.(ii) Robustness Evaluation * * : Robustness is evaluated by introducing external disturbances and parameter uncertainties.Metrics such as disturbance rejection ratios and parameter sensitivity analysis provide insights into how well the controller maintains performance in the presence of these challenges.(iii) Convergence Rate: Te speed at which the controller converges to the desired setpoints is a vital aspect of control performance.Convergence indices are used to evaluate the controller's speed of response.(iv) Simplicity of Implementation * * : Te ease of implementing the proposed control approach is considered.Tis aspect is discussed in terms of computational complexity and practical feasibility using OPAL-RT.
Evaluating these performance indices allows for a more detailed and comprehensive analysis of the presented results.It provides a clearer understanding of the controller's strengths in terms of speed tracking, reactive power optimization, disturbance rejection, and robustness against parameter uncertainties, ultimately afrming its suitability for a wide range of practical motor control applications.Te simulation results provide clear evidence of the controller's robustness, demonstrating its ability to handle parameter modifcations and changes in load torque.Te proposed control approach exhibits quick convergence, high stability, and minimal tracking errors while remaining simple to implement.

Figure 10 :
Figure 10: Te evolution of Cr and Tem with RNGPC and the proposed control.(a) +50% of Rs, (b) +20% of the fux, and (c) +5% of the coefcient of the viscous friction.

Figure 11 :
Figure 11: Te components of the i d and i q axes.(a) +50% of Rs, (b) +20% of the fux, and (c) +5% of the coefcient of the viscous friction.

Figure 17 :
Figure 17: Real-time response of the direct current.

Table 1 :
System parameters.To comprehensively examine the mathematical model of the PMSM, a series of simulations were conducted, encompassing various parameter variations.In each simulation, a single parameter was modifed within the time interval t ϵ [5 7] s.Specifcally, the robustness tests involved altering the stator resistance Rs by +100%, decreasing the magnet fux by −20%, and increasing the coefcient of viscous friction f by +5%.Furthermore, the load torque was set to 1 Nm within the time range of t ϵ [2 7] Te quantitative comparison for the ITAE metric.ITAE, integral time-weighted absolute error.