# Robust nonlinear control of permanent magnet synchronous motor drives: An evolutionary algorithm optimized passivity-based control approach with a high-order sliding mode observer

Youcef Belkhier, Siham Fredj, Haroon Rashid, Mohamed Benbouzid

<figure><img src="image_1.png" /></figure>

## To cite this version:

Youcef Belkhier, Siham Fredj, Haroon Rashid, Mohamed Benbouzid. Robust nonlinear control of permanent magnet synchronous motor drives: An evolutionary algorithm optimized passivity-based control approach with a high-order sliding mode observer. Engineering Applications of Artificial Intelligence, 2025, 145, pp.110256. 10.1016/j.engappai.2025.110256. hal-05373555

HAL Id: hal-05373555

https://hal.univ-brest.fr/hal-05373555v1

Submitted on 19 Nov 2025

HAL is a multi-disciplinary open access archive for the deposit and dissemination of scientific research documents, whether they are published or not. The documents may come from teaching and research institutions in France or abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est destinée au dépôt et à la diffusion de documents scientifiques de niveau recherche, publiés ou non, émanant des établissements d'enseignement et de recherche français ou étrangers, des laboratoires publics ou privés.

<figure><img src="image_2.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
# Robust nonlinear control of permanent magnet synchronous motor drives: An evolutionary algorithm optimized passivity-based control approach with a high-order sliding mode observer

Youcef Belkhier<sup>a,*</sup>, Siham Fredj<sup>b</sup>, Haroon Rashid<sup>a ID</sup>, Mohamed Benbouzid<sup>a ID</sup>

## ARTICLE INFO

### Keywords:

- Evolutionary algorithms

- Nonlinear control

- Passivity-based control

- Nonlinear observer

- Permanent magnet synchronous machines

## ABSTRACT

Permanent Magnet Synchronous Machines (PMSMs) have revolutionized motor design by replacing traditional components like rotor windings, brushes, and sliding contacts with permanent magnets. This innovation has significantly improved operational efficiency and reduced maintenance needs. However, controlling PMSMs remains challenging due to the changing dynamics of the machine over time and its sensitivity to different environmental conditions.

To tackle these challenges, this study presents a novel nonlinear control approach called passivity-based control (PBC). Unlike conventional methods, PBC manages both the electrical and mechanical dynamics of the system, focusing on energy flow and dissipation to maintain stability. To make the control more robust, the approach combines a nonlinear observer and a high-order sliding mode controller (HSMC), which enhance the system's ability to handle disturbances and parameter changes. Additionally, the study uses Genetic Algorithm (GA) optimization to fine-tune the parameters of the PBC, observer, and HSMC. This optimization improves the motor's tracking accuracy and robustness against external disruptions.

The result is a control framework that preserves the natural dynamics of PMSMs while improving their stability and performance. Experimental validation using the platform for real-time simulation (OPAL-RT) and real world on a PMSM using dSPACE DS1202 board demonstrates that this method outperforms existing techniques under a variety of operating conditions, highlighting its effectiveness and reliability.

## 1. Introduction

With the progress made in the field of power electronics on the one hand, linked to the appearance of fully controllable, powerful, robust and fast semi-conductor components and on the other hand the development of microelectronics and computer engineering and the evolution of control techniques, have allowed reciprocating machines, in particular the synchronous machine, to acquire the flexibility of control and the dynamic performance naturally obtained (Ma et al., 2021), (Djouadi et al., 2024). Hence, choosing a much more advanced control structure is now possible. The robustness, the low cost, the performance and the ease of maintenance make the permanent magnet synchronous motor (PMSM) interesting in many industrial applications (Li et al., 2023a), (Li et al., 2023b). The lack of natural decoupling between the field and the armature makes the control of the PMSM more complex than that of the

DC machine, because it is difficult to obtain the effective decoupling of the two control parameters, which are the magnetic flux and the mechanical torque, which must be regulated independently of each other (Kasri et al., 2024). The control of Permanent Magnet Synchronous Machines (PMSMs) is crucial in many industrial and commercial applications, owing to their high efficiency, compact size, and reliability. However, the intrinsic nonlinear dynamics of PMSMs present a significant challenge to achieving robust and efficient control.

Among control methods in technical literature, "flux orientation" vector control is notable. A linear cascade control structure successfully manages magnetic state while decoupling control variables to meet industrial demands. Internal control directs current through two loops, while an external loop manages speed and position. However, the dynamic nature of the PMSM parameters makes control difficult. Classical linear controllers, which rely on linear models near operating points,

<footnote><sup>a</sup> University of Brest, UMR CNRS 6027, 29238, Brest, France</footnote>

<footnote><sup>b</sup> Laboratoire de Technologie Industrielle et de L'Information (LTII), Faculté de Technologie, Université de Bejaia, 06000, Bejaia, Algeria</footnote>

<footnote>* Corresponding author.
E-mail address: youcef.belkhier@univ-brest.fr (Y. Belkhier).</footnote>
struggle with electrical nonlinearities (Wu et al., 2019). Nonlinear controllers are robust under varied conditions. While state feedback and impulse control are popular (Alfehaid et al.), they may miss power electronics, increasing system complexity. Traditional methods may not be enough for nonlinear systems or those with variable parameters, needing robust control solutions that are resistant to parameter changes, disturbances, and nonlinearities (Smídl et al., 2018).

Numerous scientific papers on PMSM control exist, offering various approaches. A speed controller coupled with Riccati equation (Xu et al., 2021), robust backstepping with nonlinear disturbance observer (Wu et al., 2019), robust sensorless control-based nonlinear flux observer (Xu et al., 2019), hybrid control (Wang et al., 2024), investigates finite-based model predictive current control (Junejo et al., 2020), current control using disturbance-observer (Nguyen et al., 2020), model predictive control (Niu et al., 2020). Despite these approaches, the dynamic control and handling of load disturbances remain unsatisfactory. Additionally, as noted in (Belkhier et al., 2022a), many of these methods do not adequately consider the characteristic features of PMSM during control system design. However, the conventional aforementioned control methods are signal based and often aim to linearize the system, which can lead to limitations in stability, increased computational complexity, and reduced resilience to disturbances and parameter variations.

To address these challenges, this study proposes a novel Interconnection and Damping Assignment Passivity-Based Control (IDA-PBC) methodology, integrated with a nonlinear observer. Passivity-based control (PBC) offers a transformative approach by leveraging the system's inherent energy dynamics, reconfiguring the energy flow, and injecting appropriate damping to ensure stability and performance. Unlike traditional methods, PBC addresses nonlinear properties in a damped manner rather than eliminating them, maintaining the system's inherent characteristics while achieving the supervisory control objectives. Despite its potential, research on PBC for PMSMs remains limited, both in academia and industry. Existing studies often fall short of providing comprehensive solutions: some lack experimental validation, others neglect critical aspects like stability analysis, parameter variations, or external disturbances, and some propose methodologies that are computationally prohibitive due to overly complex controller structures. The greater resilience and absence of (controller calculation) singularities that arise from avoiding system non-linearities removal are major benefits of this technique (Nicklasson et al., 1994) - (Belkhier and Oubelaid, 2024). In (Ramirez-Leyva et al., 2013), a PBC with using a nonlinear observer-based only on the position and stator voltage measurements is developed. However, this control method lacks experimental results. A PBC using speed control is developed in (Khanchoul et al., 2014). However, Stability analysis, parameter variations, and outside perturbations weren't considered. A sliding approach paired with PBC is examined in (Wang et al., 2018). However, parameter variations, and outside perturbations weren't considered as well. In (Liu et al., 2019), another PBC paired with a sliding approach together with fuzzy system is investigated. However, due to computational limitations, the controller structure of the proposed methodology is difficult. The novelty of this research lies in the development and simulation of an IDA-PBC approach with a simple structure and reduced computational requirements. By coupling this methodology with a nonlinear observer, the proposed framework relies solely on position and stator voltage measurements, making it practical for real-world applications. This study addresses key limitations in existing works by providing a comprehensive analysis of stability, accounting for parameter variations, and assessing robustness against external perturbations.

The IDA-PBC method controls nonlinear dynamic response by assigning a desirable port-controlled Hamiltonian (PCH) infrastructure to the closed-loop. Obtaining the long-term unemployed force elements that occur in the system design but do not impact on its dynamics is indeed the critical challenge. In contrast to the "conventional" PBC proposed in (Belkhier and Oubelaid, 2024) - (Wang et al., 2018), the

IDA-PBC is not only a method based on energy-reshaping idea but also emphasizes the system's interconnection and damping mechanisms (Belkhier et al., 2022b; Ortega and Canseco, 2004). The nonlinear observer must rebuild the observed signals in order to induce the PMSM to follow the reference velocity, whereas the recommended PBC is tasked with producing the system's desired dynamic, so generating a parallelism concept between the observer and the IDA-PBC.

The primary uniqueness and contribution of the current work over the relevant published articles are outlined as follows:

* A novel optimized IDA-PBC using genetic algorithm for performance improvement of a PMSM fed by grid power is investigated. The proposed strategy is adopted to design the controller law utilizing just rotor position and current measurement, in order to guarantee a fast convergence and global stability of the closed-loop system.

* Analytical proofs the exponential convergence and global stability of the system have been given demonstrated, as the controller approximates the unstructured dynamics of the PMSM and compensates for the plant's nonlinearities to preserve stability.

* Additionally, experimental validation of the proposed control system is conducted on a PMSM using both the dSPACE DS1202 board and the OPAL-RT platform, demonstrating its effectiveness.

The paper is organized as follows: Section 2 outlines the permanent magnet motor model. Sections 3 and 4 cover the calculation of the proposed control strategy for the PMSM. Section 5 focuses on the optimization process, while Section 6 presents the simulation results. Finally, the key findings are summarized in the conclusion.

## 2. Synchronous motor description

The PMSM modelling according to dq-fram expressed by (Belkhier and Oubelaid, 2024):

$$v_{dq} = R_{dq}i_{dq} + L_{dq}\dot{i}_{im} + n_{p}\omega_{m}\delta L_{dq}\dot{i}_{dq} + n_{p}\omega_{m}\delta\psi_{f} \quad (1)$$

$$J_{m}\dot{\omega}_{m} = C_{em} - \tau_{L} - f_{fv}\omega_{m} \quad (2)$$

$$C_{em} = \frac{3}{2} n_{p} ((L_{d} - L_{q})i_{d}i_{q} + \varphi_{f}i_{q}) \quad (3)$$

where $n_p$ depicts pair pole number, $J_m$ depicts the inertia, $i_{dq} = \begin{bmatrix} i_d \\ i_q \end{bmatrix}$ denotes the stator current vector, $C_{em}$ indicates the electromagnetic torque, $R_{dq} = \begin{bmatrix} R_s & 0 \\ 0 & R_s \end{bmatrix}$ depicts the resistance, $f_{fv}$ indicates the viscous coefficient, $v_{dq} = \begin{bmatrix} v_d \\ v_q \end{bmatrix}$ depicts stator's voltage, $\psi_f = \begin{bmatrix} \varphi_f \\ 0 \end{bmatrix}$ is the flux linkages vector, $L_{dq} = \begin{bmatrix} L_d & 0 \\ 0 & L_q \end{bmatrix}$ indicates the induction matrix of the stator, $\omega_m$ denotes the PMSM speed, $\varphi_f$ are the flux linkages due to the permanent magnets, $\delta = \begin{bmatrix} 0 & -1 \\ 1 & 0 \end{bmatrix}$, and $\tau_L$ is the load torque.

## 3. IDA-PBC principle and computation steps

The IDA-PBC was developed for controlling physical structures that can be described using the PCH model given below:

$$\begin{cases} \dot{x} = [\mathcal{F}(x) - \mathcal{R}(x)] \frac{\partial H}{\partial x}(x) + \mathcal{G}u \\ y = \mathcal{G}^T(x) \frac{\partial H}{\partial x}(x) \end{cases} \quad (4)$$

where, $x \in \mathbb{R}^n$ depicts state vector, $\mathcal{R}(x) = \mathcal{R}^T(x) \ge 0$ depicts the dissipation matrix, $\mathcal{F}(x) = -\mathcal{G}^T(x)$ depicts the interconnection matrix,
$H(x) : \mathbb{R}^n \to \mathbb{R}^m$ depicts total energy stored by the system, $u \in \mathbb{R}^m, m < n$ depicts the control input, the multiplication of $u$ and $y \in \mathbb{R}^m$ gives units energy. The primary distinction among IDA-PBC and traditional PBC is that the latter obtains (rather than proposes) the power function of the closed-loop (CL) via the resolution of a partial derivative equation (PDE), which is the outcome of a matrix choice. Solving a PDE can be quite challenging, but selecting appropriate matrices that account for the device's physical properties can help achieve a solution (Belkhier et al., 2022b). The IDA-PBC method involves first calculating the PCH configuration of the PMSM to select the desired storage function by determining the appropriate damping and interconnection matrices. With these matrices, the PDE is then solved, followed by computing the control input uuu, which generates the CL dynamics of the PCH system with dissipation.

This paper is related to previous work concerning the IDA-passivity based sensorless speed control of a non-salient PMSM (Belkhier et al., 2021). In our work, the proposed IDA-PBC has been combined with Genetic Algorithms (GAs) for optimizing its parameters, as traditional control parameter tuning methods, such as manually adjusting fixed gains, often fall short in addressing the complexities of modern control systems. IDA-PBC, being a sophisticated control technique, requires precise calibration of its parameters to ensure effective control action. GAs excels in global optimization, effectively exploring the complex search space of control parameters to identify near-optimal solutions, which is crucial in control system design where the objective function can be highly nonlinear and have multiple local optima such as for our application. Another improvement is that, the proposed optimized IDA-PBC designed using the dq model of the PMSM, because the dq model does not directly depend on the rotor angular position, the structure of the model is spared from being destroyed by singularities.

### 3.1. PMSM PCH model

Neglecting $f_{fv}$ and using the model (1)–(3), the following rearanged model is formulated:

$$ 
\left\{ 
\begin{aligned}
\frac{d(L_d i_d)}{dt} &= -R_s i_d + \omega L_q i_q + v_d \\
\frac{d(L_q i_q)}{dt} &= -\omega L_d i_d - R_s i_q - \omega \varphi_f + v_q \\
\frac{d}{dt} \left( \frac{J_m}{n_p} (n_p \omega) \right) &= -(n_p L_q i_q) i_d + (n_p L_d i_d + n_p \varphi_f) i_q - \tau_L
\end{aligned}
\right.
\quad (5) $$

The power function in open-loop (OL) is expressed by:

$$ H(x) = \frac{1}{2} \left( \frac{1}{L_d} x_1^2 + \frac{1}{L_q} x_2^2 + \frac{n_p}{J_m} x_3^2 \right) \quad (6) $$

where $x$ can be computed as:

$$ x = [x_1 \quad x_2 \quad x_3]^T = [L_d i_d \quad L_q i_q \quad (J_m/n_p)\omega]^T \quad (7) $$

Thus, the PMSM's PCH form is given as (Ortega and Canseco, 2004):

$$ 
\left\{ 
\begin{aligned}
\dot{x}(t) &= [J(x) - R(x)]\nabla H(x) + g(x)u(t) + \xi \\
y(t) &= g^T(x)\nabla H(x)
\end{aligned}
\right.
\quad (8) $$

According to the model (5)–(7) it yields the terms below:

$$ J(x) = \begin{bmatrix} 0 & 0 & x_2 \\ 0 & 0 & -(x_1 + \varphi_f) \\ -x_2 & (x_1 + \varphi_f) & 0 \end{bmatrix}, R(x) = \begin{bmatrix} R_s & 0 & 0 \\ 0 & R_s & 0 \\ 0 & 0 & 0 \end{bmatrix}, g(x) = \begin{bmatrix} 1 & 0 \\ 0 & 1 \\ 0 & 0 \end{bmatrix}, \xi = \begin{bmatrix} 0 \\ 0 \\ \frac{\tau_L}{n_p} \end{bmatrix} $$

$$ u = \begin{bmatrix} v_d \\ v_q \end{bmatrix}, \nabla H = \begin{bmatrix} \frac{\partial H}{\partial x_1}(x) \\ \frac{\partial H}{\partial x_2}(x) \\ \frac{\partial H}{\partial x_3}(x) \end{bmatrix} = \begin{bmatrix} x_1 \\ x_2 \\ x_3 \end{bmatrix} \quad \text{and} \quad y = \begin{bmatrix} y_1 \\ y_2 \\ y_3 \end{bmatrix} = \begin{bmatrix} x_1 \\ x_2 \\ x_3 \end{bmatrix} $$

where, $J(x) = -J^T(x)$, $H(x) \ge 0$, et $R(x) = R^T(x) \ge 0$, $J(x)$ depicts the states of interconnections matrix, and $R(x)$ depicts the system's natural damping matrix.

### 3.2. Controller dynamics

The aim is to compute the control law given as:

$$ u = [v_d \quad v_q]^T = \beta(x) \quad (9) $$

which allowed us to select the following PCH model for the system:

$$ 
\left\{ 
\begin{aligned}
\dot{x} &= [J_d(x) - R_d(x)]\nabla H_d \\
y &= g^T(x)\nabla H_d
\end{aligned}
\right.
\quad (10) $$

This maintains $x$ around the equilibrium position $x^*$, which corresponds to the lower limit of $H_d(x)$, which yields:

$$ 
\left\{ 
\begin{aligned}
\frac{\partial H_d}{\partial x}(x^*) &= 0_{3 \times 1} \\
\frac{\partial^2 H_d}{\partial x^2}(x^*) &\ge 0
\end{aligned}
\right.
\quad (11) $$

In consideration of the PMSM's physical limitations as well as the following criteria, the different matrices for the PCH framework (11) are selected:

$$ 
\left\{ 
\begin{aligned}
J_d(x) &= -J_d^T(x) \\
R_d(x) &= R_d^T(x) \ge 0 \\
H_d(x) &> 0, \forall x \ne 0
\end{aligned}
\right.
\quad (12) $$

$H_d(x)$ must match up with this PCH configuration in CL. One effect of the PCH configuration is that the interactions between the system matrices in CL and the ones in OL, via the control system, are linear:

$$ J_d(x) = J(x) + J_a(x) \quad (13) $$

$$ R_d(x) = R(x) + R_a(x) \quad (14) $$

$$ H_d(x) = H(x) + H_a(x) \quad (15) $$

Where $H_a(x)$ depicts the added energy by the control part, $R_a(x)$ depicts damping matrix, and $J_a(x)$ depicts interconnection matrix. From equations (13)–(15) and equalizing (10) and (8) it yields:

$$ [J_d(x) - R_d(x)] \frac{\partial H_a}{\partial x}(x) = [J_a(x) - R_a(x)] \frac{\partial H}{\partial x}(x) + g(x)\beta(x) + \xi \quad (16) $$

The solutions of (16) are $\nabla H_a = \frac{\partial H_a}{\partial x}(x)$ and $\beta(x)$, where its solvability's condition is given as:
$$ \frac{\partial^2 H_a}{\partial x^2}(x) = \left( \frac{\partial^2 H_a}{\partial x^2}(x) \right)^T \quad (17) $$

### 3.3. $J_d$ et $R_d$ matrices selection

By changing the desired energy function via new internal IDA matrices, and PCH model in CL control which seeks to maintain the wanted equilibrium $x^*$. Making the best choice for the desired damping and interconnection matrices is a critical step for achieving the IDA-PBC design. (Belkhier et al., 2022b), (Ortega and Canseco, 2004). Condition (11) and the physical limitations of the PMSM affect how the matrices are chosen. The solutions $\nabla H_a$ and $\beta(x)$, along with the energy $R(x)$, significantly influence the performance of the IDA-PBC. Making the matrices $R_d(x)$ and $J_d(x)$ equal with those of the device in OL is a straightforward option, i.e., $J(x)$ and $R(x)$. This decision enables the IDA-PBC to be defined with normal interaction, which yields:

$$ J_a(x) = R_a(x) = 0_{3 \times 3} \quad (18) $$

The above matrices are calculated in CL:

$$ J_d(x) = J(x) = \begin{bmatrix} 0 & 0 & x_2 \\ 0 & 0 & -(x_1 + \varphi_f) \\ -x_2 & (x_1 + \varphi_f) & 0 \end{bmatrix} \quad (19) $$

$$ R_d(x) = R(x) = \begin{bmatrix} R_s & 0 & 0 \\ 0 & R_s & 0 \\ 0 & 0 & 0 \end{bmatrix} \quad (20) $$

Thus, after $H_a(x)$ computation, the PCH model in CL will be fully established.

### 3.4. Partial derivative Equation's solution

From Eqs. (15) and (17), it yields:

$$ [J(x) - R(x)] \frac{\partial H_a}{\partial x}(x) = g(x)\beta(x) + \xi \quad (21) $$

The PMSM's control law u can be found using the following formulation (Belkhier et al., 2022b):

$$ u = [g^T(x)g(x)]^{-1} g^T(x) \{[J_d(x) - R_d(x)]\nabla H_d - f(x)\} \quad (22) $$

According to Eqs. (21) and (22), it yields above control signals structure:

$$ \left\{ \begin{array}{l} v_d = -R_s \frac{\partial H_a}{\partial x_1}(x) + x_2 \frac{\partial H_a}{\partial x_3}(x) \\ v_q = -R_s \frac{\partial H_a}{\partial x_2}(x) - (x_1 + \varphi_f) \frac{\partial H_a}{\partial x_3}(x) \end{array} \right. \quad (23) $$

$$ -x_2 \frac{\partial H_a}{\partial x_1}(x) + (x_1 + \varphi_f) \frac{\partial H_a}{\partial x_2}(x) = -\frac{\tau_L}{n_p} \quad (24) $$

$H_a(x)$ is produced by the PDE's resolving (24). As a result, the control signals' explicit forms (23) are calculated. The function "solver symbolic" of the Matlab environment realizes the solution of (24), and the aforementioned overall result is found:

$$ H_a(x) = \frac{\tau_L}{n_p} \arctan \left( \frac{x_1 + \varphi_f}{x_2} \right) + F(x_2^2 + x_1^2 + 2\varphi_f x_1) + h(x_3) \quad (25) $$

where $F$ and $h$ are two unknowns spatially separated features. To begin, we should ascertain the wanted equilibrium position $x^*$.

### 3.5. Computation of the reference equilibrium point $x^*$

Controlling the mechanical speed $\omega_m$ is our aim. According to the

reference value $\omega_m^*$, the desired state $x_3^*$ is computed as:

$$ x_3^* = J_m \omega^* \quad (26) $$

In case the reference current $i_d^*$ is set to zero, then the device can operate at maximum torque. According to (7), $x_1 = L_d i_d$, therefore:

$$ x_1^* = 0 \quad (27) $$

At $x^*$, the third part of (3) is rearranged as:

$$ n_p \varphi_f i_q^* - \tau_L = 0 \quad (28) $$

From (7) and (28), $x_2^*$ is computed by:

$$ x_2^* = \frac{L_q}{n_p \varphi_f} \tau_L \quad (29) $$

Thus, $x^*$ is formulated as:

$$ x^* = \left[ 0 \quad \frac{L_q}{n_p \varphi_f} \tau_L \quad J_m \omega^* \right]^T \quad (30) $$

### 3.6. F and h functions determination

The functions $F$ and $h$ are calculated in accordance with the specified conditions using equations (11) and (15):

$$ \left\{ \begin{aligned} \frac{\partial H_a}{\partial x}(x^*) &= -\frac{\partial H}{\partial x}(x^*) \\ \frac{\partial^2 H_a}{\partial x^2}(x^*) &> -\frac{\partial^2 H}{\partial x^2}(x^*) \end{aligned} \right. \quad (31) $$

Since, $\partial H_a / \partial x_3$ only relies on $x_3$, finally, utilizing Eqs. (6) and (31), it yields:

$$ h(x_3) = -\omega^* e_3 + \frac{\alpha}{2} e_3^2 \quad (32) $$

where, $e_3 = x_3 - x_3^*$ and $\alpha$ depicts a gain that need to be computed. Let's define the function $f(z)$ formulated by:

$$ f(z) = \partial F(z) / \partial z \quad (33) $$

with:

$$ z(x) = x_2^2 + x_1^2 + 2\varphi_f x_1 \quad (34) $$

According to (31) at $x^*$ the above relationships is formulated:

$$ \left\{ \begin{aligned} f(\bar{z}) &= -\frac{1}{2L_q} \frac{\bar{z}}{\bar{z} + \varphi_f^2} \\ \frac{\partial f}{\partial z}(\bar{z}) &> \frac{1}{4L_q} \frac{\bar{z} - \varphi_f^2}{(\bar{z} + \varphi_f^2)^2} \end{aligned} \right. \quad (35) $$

where,

$$ \bar{z} = \tau_L \quad (36) $$

Conditions (35) are met if the above formula for $f(z)$ is selected as:

$$ f(z) = - \frac{1}{2L_q} \frac{\bar{z}}{z + \varphi_f^2} \quad (37) $$

### 3.7. Gradient $\nabla H_a$ calculation

From Eq. (26), it yields the formula of $\nabla H_a$ as given below:
<figure><img src="image_3.png" /><figcaption>Fig. 1. Proposed IDA-PBC overall diagram.</figcaption></figure>

$$ \nabla H_a = \begin{bmatrix} \frac{\partial H_a}{\partial x_1}(x) \\ \frac{\partial H_a}{\partial x_2}(x) \\ \frac{\partial H_a}{\partial x_3}(x) \end{bmatrix} = \begin{bmatrix} \frac{\tau_L}{n_p} \frac{\partial \left( \arctan \left( \frac{x_1 + \varphi_f}{x_2} \right) \right)}{\partial \left( \frac{x_1 + \varphi_f}{x_2} \right)} \frac{\partial \left( \frac{x_1 + \varphi_f}{x_2} \right)}{\partial x_1} + \frac{\partial F(x_2^2 + x_1^2 + 2\varphi_f x_1)}{\partial (x_2^2 + x_1^2 + 2\varphi_f x_1)} \frac{\partial (x_2^2 + x_1^2 + 2\varphi_f x_1)}{\partial x_1} \\ \frac{\tau_L}{n_p} \frac{\partial \left( \arctan \left( \frac{x_1 + \varphi_f}{x_2} \right) \right)}{\partial \left( \frac{x_1 + \varphi_f}{x_2} \right)} \frac{\partial \left( \frac{x_1 + \varphi_f}{x_2} \right)}{\partial x_2} + \frac{\partial F(x_2^2 + x_1^2 + 2\varphi_f x_1)}{\partial (x_2^2 + x_1^2 + 2\varphi_f x_1)} \frac{\partial (x_2^2 + x_1^2 + 2\varphi_f x_1)}{\partial x_2} \\ \frac{h(x_3)}{\partial x_3} \end{bmatrix} \quad (38) $$
Using (35), (36), and (38), the following vector is obtained:

$$ \nabla H_a = \begin{bmatrix} \frac{\tau_L}{n_p} \frac{1}{x_2^2 + (x_1 + \varphi_f)^2} \left( x_2 - \frac{L_q}{n_p} \varphi_f^2 (x_1 + \varphi_f) \right) \\ -\frac{\tau_L}{n_p} \frac{1}{x_2^2 + (x_1 + \varphi_f)^2} \left( \frac{L_q}{n_p} \varphi_f^2 x_2 + (x_1 + \varphi_f) \right) \\ -\omega_m^* + \alpha e_3 \end{bmatrix} \quad (39) $$

**Remark 1.** The denominator of the input signals $v_d$ and $v_q$, " $x_2^2 + (x_1 + \varphi_f)^2$" depends on the states $x_1$ and $x_2$, as a result of the first two components $\nabla H_a$. The signals may diverge as a result of this. The initial values $x_1(0)$ and $x_2(0)$ must fulfill the following requirement in order to solve the singularity issue:

$$ x_2^2(0) + (x_1(0) + \varphi_f)^2 \ge \sigma_{AIA}, \text{ avec } \sigma_{AIA} > 0 \quad (40) $$

As shown in (Nguyen et al., 2020) and (Nicklasson et al., 1994), a PI voltage controller is designed to track the velocity of and closely follow its desirable speed. The PI control, however, is typically not resistant to parameter changes and uncertainties due to its fixed gains (Ortega and Canseco, 2004). A high order sliding-mode controller (HSMC) is introduced to substitute for the PI loop. The sliding mode control, which switches between several different control laws, is actually a member of the family of variable structure controllers. However, a significant drawback of sliding mode control is the occurrence of 'chattering,' characterized by high-frequency switching. This chattering can introduce undesirable dynamics that may weaken, degrade, or even damage the system under investigation. To mitigate the chattering phenomenon, high-order sliding mode control has been implemented, which aims to reject discontinuities in the higher derivatives of the system input. This approach operates under the premise of avoiding singularities in the higher derivatives of the control scheme (Junejo et al., 2020), (Nguyen et al., 2020). In HSMC, ensuring smooth transitions between control laws is crucial due to the inherent switching nature of sliding mode control. Standard sliding mode control can cause chattering due to abrupt switching between control actions. However, HSMC mitigates this issue by extending the sliding surface to higher derivatives, allowing for more gradual changes in the control law. This smoother transition is achieved by considering not only the first derivative of the sliding surface but also higher-order derivatives, which reduces the abruptness typically associated with first-order sliding mode control.

This algorithm ensures that the system trajectories evolve in a continuous manner by focusing on the evolution of the sliding surface over time, rather than discrete switching between control laws, which results in more stable and smoother control actions, even in the presence of system uncertainties or external disturbances. A nonlinear observer is employed alongside the HSMC to enhance system robustness. The nonlinear observer estimates the system states, providing necessary feedback to the controller even in the presence of model uncertainties and external disturbances. This estimation ensures that the controller operates on accurate state information, facilitating smooth control transitions and improving the overall performance of the system. The observer plays a critical role in reducing the reliance on precise model knowledge, which is essential for real-world applications where exact system parameters may be uncertain. The next representations for the input signal are determined by substituting the elements of the vector $\nabla H_a$ with their values in (24) and understanding that $\alpha > 0$:

$$ \begin{align} v_d &= -\frac{R_s}{n_p} \frac{1}{x_2^2 + (x_1 + \varphi_f)^2} \tau_L + \frac{L_q}{n_p \varphi_f^2} (x_1 + \varphi_f) \tau_L + \nonumber \\ & \quad \left( -\omega^* + k_1 |(\hat{\omega} - \omega^*)|^{0.5} \operatorname{sign}((\hat{\omega} - \omega^*)) \right) x_2 \nonumber \\ & \quad + k_2 \int_0^t \operatorname{sign}((\hat{\omega} - \omega^*)) d\tau \nonumber \\ v_q &= \left( \frac{R_s}{n_p} \frac{1}{x_2^2 + (x_1 + \varphi_f)^2} \tau_L - \omega^* + k_1 |(\hat{\omega} - \omega^*)|^{0.5} \operatorname{sat}((\hat{\omega} - \omega^*)) \right) \nonumber \\ & \quad + k_2 \int_0^t \operatorname{sat}((\hat{\omega} - \omega^*)) d\tau \nonumber \\ & \quad (x_1 + \varphi_f) + \frac{L_q}{n_p \varphi_f^2} x_2 \tau_L \tag{41} \end{align} $$

Where, $k_1 > 0$ and $k_2 > 0$ are the damping gains, which are parameters directly influencing the performance of the control system. Thus, their accurate computation is of utmost importance. It should be noted that the $\tau_L$ measurement is necessary for the IDA-PBC and $x_2^*$ calculations. However, since this total amount is unspecified in reality, forecast is necessary.

## 4. Speed observer and load torque synthesis

It is created a non-linear observer of the load torque $\tau_L$, velocity $\omega_m$, or electric pulsation $\omega$ ($\omega = n_p\omega_m$). In actuality, a velocity sensor or differentiation of the mechanical position are used to determine the velocity. Given the measurement vibration on the location or speed, these techniques produce a low-quality signal (Belkhier et al., 2021). The characteristics of $\hat{\tau}_L$ rely on this amount because the load has an impact on the velocity error. The PMSM mechanical formula is used to derive the expression for the velocity estimator $\hat{\omega}$, and the resulting dynamics for the observer of $(\hat{\omega}, \hat{\tau}_L)$ are as follows:

$$ \begin{cases} \dot{\hat{\omega}} = \frac{n_p}{J_m} \left( \left( \frac{1}{L_q} - \frac{1}{L_d} \right) x_1 + \frac{\varphi_f}{L_q} x_2 - l_1 (\hat{\omega} - \omega) - \frac{1}{J_m} \hat{\tau}_L \right) \\ \hat{\tau}_L = k_1 |(\hat{\omega} - \omega)|^{0.5} \operatorname{sat}((\hat{\omega} - \omega)) + k_2 \int_0^t \operatorname{sat}((\hat{\omega} - \omega)) d\tau \end{cases} \quad (42) $$

with, $l_1$ and $l_2$ are gains that need to be defined, according to the conditions below:

$$ l_1, l_2 > 0 \quad (43) $$

The flow chart for the IDA-PBC that has been optimized utilizing GA and a speed torque observer is shown in Fig. 1.

### 4.1. Load torque computation

The observer's gains $l_1$ and $l_2$ of the are designed using OL. The third part of (8) is then deducted by the first formula of (42) and knowing that:

$$ \hat{\tau}_L = \tilde{\tau}_L + \tau_L \quad (44) $$

The next characteristics of the uncertainty are derived under the assumption that $\tau_L$ is constant:

$$ \left[ \begin{matrix} \dot{\tilde{\omega}} \\ \dot{\tilde{\tau}}_L \end{matrix} \right] = \underbrace{\left[ \begin{matrix} -l_1 & \frac{1}{J_m} \\ l_2 & 0 \end{matrix} \right]}_{A_{obs}} \left[ \begin{matrix} \tilde{\omega} \\ \tilde{\tau}_L \end{matrix} \right] \quad (45) $$
<figure><img src="image_4.png" /><figcaption>Fig. 2. Genetic algorithm optimization cycle.</figcaption></figure>

where $\tilde{\omega} = \hat{\omega} - \omega$ and $\tilde{\tau}_L = \hat{\tau}_L - \tau_L$ describe the connections that establish the observation inconsistencies. The $A_{Obs}$ matrix's pole placement strategy is used to calculate $l_1$ and $l_2$. The next solution is permissible for Eq. (45):

$$ \begin{bmatrix} \tilde{\omega}(t) \\ \tilde{\tau}_L(t) \end{bmatrix} = \begin{bmatrix} \tilde{\omega}(0) \\ \tilde{\tau}_L(0) \end{bmatrix} e^{A_{Obs}t} \quad (46) $$

$\tilde{\omega}$ and $\tilde{\tau}_L$ will go to zero only if $A_{Obs}$ must be positive.

## 4.2. Stability analysis of the observer

The analysis of stability is carried out by the Lyapunov concept. Choosing the first quadratic equation is the next step:

$$ V_{\text{AIA}}^{\text{Obs}}(x, \tilde{\omega}, \tilde{\tau}_L) = H_d(x) + \frac{1}{2} [\tilde{\omega} \quad \tilde{\tau}_L] I_2 [\tilde{\omega} \quad \tilde{\tau}_L]^T \quad (47) $$

Deriving $V_{\text{AIA}}^{\text{Obs}}$ along Eqs. (13) and (45), it yields:

$$ \begin{aligned} \dot{V}_f = \frac{\partial V_f}{\partial x} \dot{x} + \frac{\partial V_f}{\partial \tilde{\omega}} \dot{\tilde{\omega}} + \frac{\partial V_f}{\partial \tilde{\tau}_L} \dot{\tilde{\tau}}_L = & P(x-x^*) \left[ \frac{n_p}{J_m} \left( \left( \frac{1}{L_q} - \frac{1}{L_d} \right) x_1 + \frac{\varphi_f}{L_q} x_2 - l_1 (\hat{\omega} - \omega^*) - \frac{1}{J_m} \hat{\tau}_L \right) + \tilde{\omega} \left[ \frac{n_p}{J_m} \left( \left( \frac{1}{L_q} - \frac{1}{L_d} \right) x_1 + \frac{\varphi_f}{L_q} x_2 - l_1 (\hat{\omega} - \omega^*) - \frac{1}{J_m} \hat{\tau}_L \right] \right. \\ & \left. + \hat{\tau}_L \left( k_1 |(\hat{\omega} - \omega^*)|^{0.5} \text{sat}((\hat{\omega} - \omega^*)) + k_2 \int_0^t \text{sat}((\hat{\omega} - \omega^*)) d\tau \right) \right] \end{aligned} \quad (52) $$

$$ V_{\text{AIA}}^{\text{Obs}}(x, \tilde{\omega}, \tilde{\tau}_L) = \dot{x} = - \nabla H_d^T R_d(x) \nabla H_d + \frac{1}{2} [\tilde{\omega} \quad \tilde{\tau}_L] A_{\text{Obs}} [\tilde{\omega} \quad \tilde{\tau}_L]^T \quad (48) $$

Eq. (48) is reorganized into the compact form shown below:

$$ \dot{V}_{\text{AIA}}^{\text{Obs}}(x, \tilde{\omega}, \tilde{\tau}_L) = - \left[ \nabla H_d^T \quad \tilde{\omega} \quad \tilde{\tau}_L \right] \underbrace{\begin{bmatrix} R_d(x) & 0_{3 \times 2} \\ 0_{2 \times 3} & -A_{\text{Obs}} \end{bmatrix}}_{A_{\text{AIA}}^{\text{Obs}}} \begin{bmatrix} \nabla H_d^T \\ \tilde{\omega} \\ \tilde{\tau}_L \end{bmatrix} \quad (49) $$

For the equilibrium position $[x \quad \tilde{\omega} \quad \tilde{\tau}_L] = [x^* \quad 0_{1 \times 2}]$ to be constant, the matrix $A_{\text{AIA}}^{\text{Obs}}$ must be positive definite, i.e., with steady poles, considering that $x^*$ negates $\nabla H_d$. This condition is supported by the fact

that $R_d(x) = R(x)$ is a steady diagonal matrix, and the gains $l_1$ and $l_2$ are picked in such a way that $(-A_{\text{Obs}})$ is constant.

## 4.3. Stability analysis of the controller-observer

Let's define the Lyapunov function $V_f$ as follows:

$$ V_f(x, \tilde{\omega}, \tilde{\tau}_L) = \frac{1}{2}(x - x^*)^T P(x - x^*) + \frac{1}{2} \tilde{\omega}^T \tilde{\omega} + \frac{1}{2} \tilde{\tau}_L^T \tilde{\tau}_L \quad (50) $$

where $P$ is a positive definite matrix. Time derivative of $V_f$ along the system trajectories, yields:

$$ \dot{V}_f = \frac{\partial V_f}{\partial x} \dot{x} + \frac{\partial V_f}{\partial \tilde{\omega}} \dot{\tilde{\omega}} + \frac{\partial V_f}{\partial \tilde{\tau}_L} \dot{\tilde{\tau}}_L \quad (51) $$

where $\frac{\partial V_f}{\partial x} = P(x - x^*)$, $\frac{\partial V_f}{\partial \tilde{\omega}} = \tilde{\omega}$, and $\frac{\partial V_f}{\partial \tilde{\tau}_L} = \tilde{\tau}_L$. Substituting Eq. (30) and Eq. (42) into Eq. (51), gives:

It can be deduced that, if $\dot{V}_f$ is negative definite or negative semi-definite for all $(x, \tilde{\omega}, \tilde{\tau}_L)$ except at the equilibrium point, then the equilibrium point is asymptotically stable.

# 5. Genetic algorithm optimization

Among the most popular optimization computation are genetic algorithms. They are founded on the idea of biological evolution (Aviles et al., 2022), (Cruz-Miguel et al., 2020), much like the deep learning model (Xing et al., 2023) and the diverse generation model (Wu et al., 2023). Genetic algorithms, inspired by natural evolution, offer a robust approach to solving optimization problems, particularly in scenarios
<table><caption>**Table 1**
Chromosome Binary coding.</caption><thead><tr><th colspan="6">Chromosome</th></tr><tr><th></th><th>Variable1</th><th>Variable2</th><th>Variable3</th><th>Variable4</th><th>Variable5</th></tr></thead><tbody><tr><th>Binary coding</th><td>1001</td><td>1110</td><td>0111</td><td>0001</td><td>0010</td></tr><tr><th>Value of each variable</th><td>9</td><td>14</td><td>7</td><td>1</td><td>2</td></tr></tbody></table>

<table><caption>**Table 2**
Chromosome Real coding.</caption><thead><tr><th colspan="6">Chromosome</th></tr><tr><th></th><th>Variable1</th><th>Variable2</th><th>Variable3</th><th>Variable4</th><th>Variable5</th></tr></thead><tbody><tr><th>Real coding</th><td>9</td><td>14</td><td>7</td><td>1</td><td>2</td></tr></tbody></table>

where the solution landscape is complex, nonlinear, or multi-modal. These features make GAs particularly suitable for fine-tuning control parameters, as such problems often exhibit these characteristics. First off, GAs are superior than gradient-based techniques like Gradient Descent or Newton's methods because of their versatility in handling a broad range of objective functions without the need for gradient information. As is frequently the case with control systems like PBC and HSMC, this is particularly relevant when working with systems where the parameter tuning involves non-differentiable or discontinuous areas. GAs investigate a wider search space and lessen the possibility of becoming stuck in local optima, a common hazard of other algorithms like Simulated Annealing or simple hill-climbing techniques, by mimicking evolutionary processes like selection, crossover, and mutation. Second, GAs perform well in multi-objective optimization scenarios, which is important for control systems where it's necessary to balance trade-offs between competing goals like energy efficiency, responsiveness, and stability (Torres-Salinas et al., 2022). Multiple regions of the search space can be explored in parallel because to GAs' capacity to maintain a population of viable solutions. In addition to increasing the likelihood of discovering the global optimum, this feature provides flexibility in managing extra limitations or goals that can arise along the tuning process. Additionally, the genetic algorithm is more adaptable than algorithms that need previous domain-specific modifications due to its flexibility and domain-agnostic nature. For example, while techniques such as Ant Colony Optimization (ACO) and Particle Swarm Optimization (PSO) work well in some situations, they might need to be modified in order to work effectively with the dynamics and limitations of control parameters. On the other hand, GAs are a dependable option for fine-tuning tasks because of their demonstrated performance in a variety of technical fields, such as robotics and adaptive control systems.

On a population of genetic material, GAs functions during every generation, each chromosome-named individual will be assessed and granted a value of an objective function that symbolizes the issue to be optimized. This is the core of the GAs approach. After each person has been evaluated, the most effective ones will be chosen based on the criteria of the optimization problem that were previously identified. In the upcoming generations, these chosen individuals will have a higher probability of procreating. To create new progeny, the fusion process manages to combine the traits of the parents. It is utilized in conjunction with a combination prediction pc that is tuned and is typically high. The selection function randomly modifies one or many elements of a selected gene. It is employed to diversify the solutions throughout the search area (Xing et al., 2023) and prevent the mistaken identification of a local optimum as a global optimum.

The phases shown in Fig. 2 can serve as a general definition of the GA: The creation of a population of N randomly selected people (N solutions) is the first stage in genetic algorithms. The gene, which contains all of an individual's details, is the foundation of that person. The

<table><caption>**Table 3**
Genetic algorithm characteristics.</caption><thead><tr><th>Parameter</th><th>Value</th></tr></thead><tbody><tr><td>Probability of mutation</td><td>0.01</td></tr><tr><td>Probability of crossover</td><td>0.65</td></tr><tr><td>Maximum generation</td><td>3000</td></tr><tr><td>Chromosome length</td><td>500</td></tr><tr><td>Population size</td><td>40</td></tr></tbody></table>

efficiency of every person in the population is then assessed using an independent decrypting methodology when utilizing a programming that differs from the coding stage. The most successful people will be picked, and each pair of parents will be reached to create a unique child that combines elements of both the first and second parents. A mutation procedure is performed to increase the search area and decrease the likelihood of hitting the local optimum by setting the number of a chromosome from a chosen at random location by some other value with a small chance that is equivalent to 1/L or 1/(P.L), under which P is the number of individuals and L is the bandwidth of the genetic code sequence. If the halt requirement is reached, the youth group will be approved as the best possible solution; if not, the search for a different population will grow.

### 5.1. Genetic algorithm operator

The steps involved serve as the foundation for how the GA operates:

a) **Initialization:** Initially, N people (or the "N solution") are obtained at random.

b) **Coding:** There are various ways to code people, but numeric programming and real programming are the most common. The implementation at hand determines which operator to use. Depending on the coding parameter's variation range and the necessary accuracy, the string's size is fixed.

* **Binary coding:** Each of the five dimensions on a gene are programmed using four bits (characteristics between 0 and 15), and Table 1 provides an example of such a programming. Chain length = $N^{br}$ of factors × $N^{br}$ of bits, where L = 4 and P = 20. The most common issue with this type of programming is shape (the quantity and quality of the different factors are large), which results in a quite huge string shape.

* **Real coding:** It is the most basic type of programming; for such a sort, every gene consists of n parameters, each of which can have a real benefit more than a specified range. For instance, if we experience the issue f (x1, x2, x3, x4, x5), it refers to a chromosome which has five of the different factors listed in Table 2. It is distinguished by simple structure as well as a quick computational efficiency, all of which are caused by the lack of a decryption phase.

c) **Decoding:** Each factor should always be decrypted because it is necessary to calculate each person's fitness value in to assess their efficiency.

d) **Evaluation:** In order to assess each person's performance in light of the user-defined adjustment function f, this step includes determining their function value. A specified function's reduction or enhancement can be the issue that should be addressed. Typically, Eq. (50) contains the function f, in which the conversion function g is present. h is the problem-dependent optimization problem. For the combination of two features, o is utilized:

$$f=goh \qquad (50)$$

e) **Selection:** Following evaluation of each individual's performance, N/2 of the latter could be chosen to create additional generations. Numerous selection methods have been developed; we list the most
<figure><img src="image_5.png" /><figcaption>Fig. 3. Different steps of observer optimization using GA.</figcaption></figure>

**Algorithm 1: Genetic Algorithm**

1 initialization;.
2 Random generation of the initial population=Pop;
3 Evaluation of individuals by calculating the objective function ITAE;
4 Selection of individuals by tournament;
5 Random crossing of individuals selected in one point;
6 Random mutation in one point of new individuals;
7 **for** [n,m]=size(Pop$_{new}$) **do**
8 **for** i=1:n **do**
9 **for** j=1:m **do**
10 a=rand;
11 if a ≤ P$_{m}$ then
12 mat(i, j) =
13 mat(i, j) + unifrnd(-1, +1, 1)λ;
14 end
15 end
16 GA-RN Training;
17 Evaluation of individuals;
18 Selection of individuals;
19 Random crossing of individuals selected;
20 Random mutation;
21 until stop criterion;
22 end

<caption>Fig. 4. GA programme.</caption>

popular ones here: i) The Goldberg roulette wheel selection, invented in 1994. It is the most widely used and recognized technique. Although it is not the preferred approach, the main issue with it is the emergence of a super-individual that replicates itself all the time. ii) This feature selection technique, known as random selection, was developed to address the issue with roulette selection. No one of the people is a super-person. The guiding philosophy is to select two

<table><caption>**Table 4**
Comparison between the proposed and similar methodologies.</caption><thead><tr><th></th><th>Proposed</th><th>PBC</th><th>NGPC</th><th>MPC</th></tr></thead><tbody><tr><td>Transient response</td><td>0.09 s</td><td>0.12 s</td><td>0.5 s</td><td>0.35 s</td></tr><tr><td>Steady-state error</td><td>±0.3 rad/s (0.2%)</td><td>±1 rad/s (0.66%)</td><td>±4 rad/s (2.66%)</td><td>±2 rad/s (1.33%)</td></tr><tr><td>Load torque error</td><td>±2.5 N m</td><td>±5 N m</td><td>±6 N m</td><td>±3 N m</td></tr><tr><td>Robustness</td><td>High</td><td>Low</td><td>Low</td><td>High</td></tr></tbody></table>

<table><caption>**Table 5**
PMSM parameters.</caption><thead><tr><th>PMSM parameter</th><th>Value</th></tr></thead><tbody><tr><td>Viscous friction coefficient (Nm/rd/s)</td><td>0.0085</td></tr><tr><td>Flux amplitude of the permanent magnets (Wb)</td><td>0.1112</td></tr><tr><td>Quadratic inductance Lq (mH)</td><td>0.9515</td></tr><tr><td>Direct inductance Ld (mH)</td><td>0.8524</td></tr><tr><td>Stator phase resistance Rs (Ω)</td><td>0.17377</td></tr><tr><td>Weight (kg)</td><td>25</td></tr><tr><td>Inertia moment (kg.m²)</td><td>0.0048</td></tr><tr><td>Number of pole pairs (p)</td><td>4</td></tr><tr><td>Rated current (A)</td><td>31</td></tr><tr><td>Nominal torque (Nm)</td><td>22</td></tr><tr><td>Rated voltage (V)</td><td>310</td></tr><tr><td>Rated speed (tr/min)</td><td>3000</td></tr></tbody></table>

<table><caption>**Table 6**
Inverter parameters.</caption><thead><tr><th>Inverter parameter</th><th>Value</th></tr></thead><tbody><tr><td>Inverter guard time [s]</td><td>0.00000325</td></tr><tr><td>Modulation index</td><td>21</td></tr><tr><td>PWM control coefficient</td><td>0.9</td></tr><tr><td>Power supply voltage [V]</td><td>270</td></tr><tr><td>PWM frequency [kHz]</td><td>10</td></tr></tbody></table>
<figure><img src="image_6.png" /><figcaption>Fig. 5. The objective function.</figcaption></figure>

<figure><img src="image_7.png" /><figcaption>Fig. 6. PMSM speed.</figcaption></figure>

parents at a time and contrast them in order to pick the most suitable one that emerges in the population group. The benefit of this kind of choice is that performance index is taken into consideration, which implies that the most qualified candidates will replicate themselves.

f) **Crossover**: In order to form a better number of individuals known as the youth population, a path is implemented to the chosen parents.

g) **Mutation**: it is used to maintain individual uniqueness by changing genetic code details with a small chance while maintaining the effectiveness of genetic algorithms.

<figure><img src="image_8.png" /><figcaption>Fig. 7. Electromagnetic torque.</figcaption></figure>

<figure><img src="image_9.png" /><figcaption>Fig. 8. PMSM speed of +20% of $R_s$.</figcaption></figure>

<figure><img src="image_10.png" /><figcaption>Fig. 9. Electromagnetic torque of +20% of $R_s$.</figcaption></figure>

<figure><img src="image_11.png" /><figcaption>Fig. 10. PMSM speed of +50% of $J_m$.</figcaption></figure>

## 5.2. IDA-PBC optimization by GA

The goal of optimizing the IDA-PBC using a Genetic Algorithm (GA) is to fine-tune the observer parameters to achieve effective motor control. The parameters to be optimized are $k_1, k_2, l_1, l_2$ and $\alpha$, which are critical for the observer's performance. These parameters influence the observer's ability to track the motor's velocity and minimize the discrepancy between the model's desired velocity $W_{ref}(t)$ and the actual motor velocity $W_{out}(t)$. The observer's effectiveness is evaluated using the Integral of Time Absolute Error (ITAE) criterion, expressed as:

<figure><img src="image_12.png" /><figcaption>Fig. 11. Electromagnetic torque of +50% of $J_m$.</figcaption></figure>

<figure><img src="image_13.png" /><figcaption>Fig. 12. PMSM speed +20% of $R_s$ and of +50% of $J_m$.</figcaption></figure>
<figure><img src="image_14.png" /><figcaption>Fig. 13. Electromagnetic torque of +20% of $R_s$ and +50% of $J_m$.</figcaption></figure>

<figure><img src="image_15.png" /><figcaption>Fig. 14. PMSM speed +20% of $R_s$, +50% of $f$, and of +50% of $J_m$.</figcaption></figure>

<figure><img src="image_16.png" /><figcaption>Fig. 15. Electromagnetic torque +20% of $R_s$, +50% of $f$, and of +50% of $J_m$.</figcaption></figure>

$$ITAE = \int_{0}^{2} t |(W_{ref}(t) - W_{out}(t))| dt \qquad (51)$$

The genetic algorithm characteristics are given in Table 3 and the procedures used to create the ideal observer are shown in Figs. 3 and 4 as follows:

1) **Initialization of population:** The observer's variables to optimize are contained in the initialization, $pop = [P1, P2, P3, P4, P5, P6]$, which is created at random utilizing MATLAB's unified function, which is a 10*6-dimensional matrix.

2) **Selection method:** A quantity of the first population's members are chosen via a tournament technique (those who fit a fair and accurate function), providing them with the opportunity to procreate in the coming generations.

3) **Crossover:** Following the identification of the population's top performers, two parents were crossed at a predetermined point at irregular intervals to combine their genetic material and share data, resulting in the creation of new population.

4) **Mutation:** Using a randomly generated mutation, a gene trait can be modified with a slim chance of success. The mutation chromosome is selected in order to broaden the area of research and prevent the local optimum in order to maintain the effectiveness of GA.

# 6. Results and discussion

To evaluate the effectiveness of the theoretical study described above, the control systems for the PMSM drive were simulated using MATLAB/Simulink software. Additionally, to validate the numerical simulation results and assess the real-time performance of the proposed control system, a hardware-in-the-loop (HIL) setup was implemented using the OPAL-RT platform. Table 4

## 6.1. Simulation results

The analysis shows that the optimized IDA-PBC is effective in handling electrical disturbances and utilizing a load torque observer, as outlined in equations (41)–(43). The parameters for the PMSM and the inverter under investigation are detailed in Tables 5 and 6. The motor is driven by a voltage inverter that utilizes pulse width modulation (PWM) technology. Numerical simulations based on the pole placement method are employed to determine the gains for the controller and observer. The observer and HSMC gains $k_1, k_2, l_1, l_2$ and $\alpha$ are computed using the GA.

<figure><img src="image_17.png" /><figcaption>Fig. 16. OPAL-RT testing platform.</figcaption></figure>
<figure><img src="image_18.png" /><figcaption>Fig. 17. RT-Lab PMSM speed.</figcaption></figure>

<figure><img src="image_19.png" /><figcaption>Fig. 18. RT-Lab PMSM torque.</figcaption></figure>

The values used are: $\alpha = 10, k_1 = 1500, k_2 = 1000, l_1 = 80$, and $l_2 = 7.68$. To evaluated the efficacy and resilience of the proposed optimized strategy to its traditional counterpart, many scenarios of parameter modifications and measurement noise were investigated. The objective function generated by the optimized IDA-PBC is shown by Fig. 5.

Fig. 6 depicts the PMSM responses for a reference speed of 300 rad/s and a load torque of 22 N m between 0.6s and 1.2s for both the suggested optimized method and the traditional IDA-PBC. As shown, the suggested method neutralizes the impact of the load. Since the speed signal reacts more quickly to the load torque impact than the conventional one, which is relatively slow and vulnerable to it, as demonstrated by the at 0.6 and 1.2 s. This is caused by the line current's amplitude increasing under applied load. This setup supplies the energy necessary to support the load and sustain the maximum speed. The results clearly indicate that the proposed control system delivers a higher line current compared to the established system.

Fig. 7 shows that both the conventional and proposed control systems result in the torque increasing to a level comparable to the voltage and load. However, even with the load impact, the new technique demonstrates faster convergence to the specified value than the standard

method. The fluctuations in the outputs are caused by the regulated power supply converter, and the spikes are caused by the operating point speed's form.

Figs. 8–15 depict, in both, the outcomes of the robustness checks for variations of +20% of $R_s$, +50% of $J_m$, simultaneous changes of +50% of $J_m$ and +20% of $R_s$, and changes of +50% of $J_m$, +50% of f and +20% of $R_s$. Fig. 8 demonstrates that the device interaction for the proposed methodology, which yields the same speed response as Fig. 6, is unaffected by the variations of +50% $R_s$, as opposed to the classical control, which exhibits perturbations owing to the change of the load torque between 0.6s and 1.2s. Fig. 9 depicts the torque response as a function of $R_s$ variation, which exhibits the same behavior as in Fig. 7. As a result, the variance has no effect on either control strategy.

Fig. 10 depicts the PMSM's speed response as a result of significant fluctuations of +50% of $J_m$. According to the stated response, the recommended method is unaffected by this variance for either control. However, as can be seen in the at 0.6s and 1.2s, achieves its breakpoint with a rapid response time, in contrast to the traditional system, which is relatively slow and highly sensitive to variations in load torque. Fig. 11 depicts the torque response as a function of $J_m$ variation, which exhibits

<figure><img src="image_20.png" /><figcaption>Fig. 19. RT-Lab direct current.</figcaption></figure>
<figure><img src="image_21.png" /><figcaption>Fig. 20. dSPACE Experimental test bench.</figcaption></figure>

<figure><img src="image_22.png" /><figcaption>Fig. 21. Experimental speed response.</figcaption></figure>

the same behavior as in Fig. 7.

For both the proposed and traditional controls, the electromagnetic torque grows to a value equivalent to the load and friction. However, even with the load impact, the new technique demonstrates faster convergence to the specified value than the standard method.

In contrast to the traditional control, which exhibits perturbations caused by changes in the load torque among 0.6s and 1.2s, simultaneous variants of +50% of $J_m$ and +20% of $R_s$ have no impact on the Drive system dynamic for the suggested technique, as shown in Fig. 12. Fig. 13 depicts the torque response to variations of +50% of $J_m$ and +50% of $R_s$, that have no influence on the dynamic of torque for both controls.

In contrast to the traditional IDA-PBC, which exhibits high perturbations due to changes and the load torque along 0.6s and 1.2s, simultaneous changes of +50% of $J_m$, +20% of $R_s$, and +50% of f have no impact on the device velocity answer as seen in Fig. 14. Fig. 15 depicts the torque answer to variations, that also yields the same result as Fig. 7.

To emphasize the advantages of the proposed control system, a detailed comparison was made with two other well-established benchmark techniques: Nonlinear Generalized Predictive Control (NGPC) and Model Predictive Control (MPC). The results of this comparison are provided in Table 4, which clearly illustrates the superior performance

<figure><img src="image_23.png" /><figcaption>Fig. 22. Experimental torque response.</figcaption></figure>

<figure><img src="image_24.png" /><figcaption>Fig. 23. Experimental voltage in the dq moel.</figcaption></figure>

of the proposed control system. In terms of transient response, the proposed method demonstrates faster settling times and smoother responses, minimizing overshoot and oscillations when compared to NGPC and MPC.

Moreover, when assessing the steady-state error, the proposed control system achieves a remarkable error of just 0.2%, significantly outperforming the other techniques. Specifically, the Proportional-
<figure><img src="image_25.png" /><figcaption>Fig. 24. Experimental voltage in the dq moel.</figcaption></figure>

derivative-based Control (PBC) method exhibits a steady-state error of only 0.66%, whereas NGPC and MPC show much higher steady-state errors of 2.66% and 1.33%, respectively. This substantial difference in steady-state performance highlights the efficiency and precision of the proposed control strategy in minimizing error over time. Additionally, when considering the response under applied load torque variations, the proposed control system demonstrates a more robust and stable speed regulation. In contrast, NGPC, MPC, and PBC all face challenges in maintaining a stable speed under load perturbations. These results confirm the proposed control system’s superior ability to handle dynamic disturbances and maintain system stability, which is crucial for high-performance applications.

The overall superior performance of the proposed control system can be attributed to its ability to better manage both transient and steady-state behaviors, offering a significant improvement in both tracking accuracy and robustness compared to the well-known benchmark techniques of NGPC and MPC.

The comparative analysis of the optimized IDA-PBC using Genetic Algorithms (GA) and the standard IDA-PBC, NGPC and MPC demonstrates that the proposed method achieves faster convergence, improved stability, and lower tracking errors compared to the benchmark method evaluated. Therefore, based on the previous findings, the proposed scheme effectively meets the objective outlined in the introduction: regulating the velocity to its pre-fault value, supplying reliable and stable power to the device, and minimizing any potential fluctuations in power generation.

## 6.2. Experimental results with OPAL-RT

The OPAL-RT system provides an advanced platform for Hardware in the Loop (HIL) simulation, which combines real-world hardware with virtual models to enable real-time interaction. This system, particularly through the OP 4510 board and its FPGA components, integrates physical hardware into high-fidelity simulations for accurate emulation.

In this study, the RT-Lab interface connects MATLAB/Simulink with real-time hardware, allowing simulations to interact dynamically with physical components. This setup is essential for testing control algorithms, validating designs, and analyzing complex systems without costly physical tests. The OPAL-RT system is particularly valuable in fields like power systems, automotive, aerospace, and renewable energy, where real-time performance and interaction between software and hardware are crucial.

Fig. 15 illustrates the configuration of the real-time simulator setup, which includes key components: (1) MATLAB/Simulink software, (2) the RT-Lab platform software, (3) a host PC, and (4) OPAL-RT 4510 hardware. The setup process involved decomposing and adapting the PMSM simulation system for integration into the RT-Lab platform, enabling real-time simulation execution.

The experimental setup and results are illustrated in Figs. 16–19, demonstrating the system’s response to load torque disturbances. Notably, the real-time simulation results obtained from the RT-Lab platform show a high level of consistency with the expected simulation outcomes, highlighting the accuracy and reliability of the OPAL-RT system in real-time simulations.

Fig. 17 presents the rotor speed trajectory, where the actual speed closely tracks the reference, with steady-state error effectively eliminated, even under load torque variations. Fig. 18 shows the electromagnetic torque evolution, with the measured torque closely following its reference, exhibiting minimal ripple despite abrupt trajectory changes. Fig. 19 illustrates the d-axis armature current, which remains constant at the prescribed reference. These experimental findings confirm the effectiveness and validity of the proposed control method.

## 6.3. Experimental results with dSpace

In this section, validation is carried out using the dSPACE Micro-labBox DS 1202 platform shown by Fig. 20, connected to a brushless AC servomotor (Unimotor Leroy Somer), which drives a PMSM of the

<figure><img src="image_26.png" /><figcaption>Fig. 25. Experimental GA-observer for the IDA-PBC three-phase voltage.</figcaption></figure>
LSRPM type from the Dynamo series. This setup allows for real-world testing and performance evaluation of the proposed control system under practical operating conditions. The parameters of the PMSM used for the test are provided in reference (Kasri et al., 2024), in Table 2. This table outlines the key specifications of the LSRPM-type PMSM from the Dynamo series, including its rated power, voltage, current, speed, and other relevant electrical and mechanical characteristics that are crucial for evaluating the performance of the proposed control system.

The experimental results presented in Figs. 21–25 validate the simulation results and real-time performance using the OPAL-RT platform. In Fig. 21, the experimental speed response closely matches the simulation, with minimal discrepancies, and the real-time OPAL-RT results are in strong agreement with both, confirming the control system's ability to track the desired speed accurately. Fig. 22 shows that the experimental electromagnetic torque response aligns well with both the simulation and OPAL-RT results, demonstrating stable torque control. Fig. 23, presenting the voltage in the dq model, shows that the experimental results are very similar to the simulation, and the OPAL-RT results match closely with both, confirming precise voltage regulation. In Fig. 24, the experimental currents in the dq model match well with the simulation and OPAL-RT data, validating the control system's accuracy in current regulation in real-time. Finally, Fig. 25 demonstrates that the GA-observer for the IDA-PBC three-phase voltage provides results consistent with the simulation data, confirming its effectiveness in real-time state estimation.

The experimental results show excellent agreement with both the simulation and OPAL-RT results, validating the proposed control system's performance under both simulated and real-world conditions.

## 7. Conclusion

In this study, we apply a novel evolutionary algorithm to enhance the IDA-PBC, integrating a nonlinear observer and HSMC based on the PCH model for the PMSM. This controller leverages the PCH model of the motor, which consists of three key matrices: the interconnection matrix, representing the internal energy transfer terminals between different regions of the system; the outer interconnection matrix, illustrating the energy exchanges between the system and its external environment; and the damping matrix, which accounts for all dissipation components within the system. The proposed control is distinctive due to its use of the PCH structure in the control law and the formulation of the energy function tailored to this framework. Simulation results indicate that the IDA-PBC developed for the PMSM, grounded in passivity principles, offers numerous advantages. Notably, only three gains need to be established for the IDA-PBC with an observer, in contrast to traditional control methods that require a greater number of fixed gains. The primary objective of this research is to create a controller that encompasses the full dynamics of the PMSM while ensuring system passivity. This is accomplished by reorganizing the energy within the proposed IDA-PBC and incorporating a dissipative element that manages nonlinearities through damping rather than eliminating them, establishing a duality between the observer and the IDA-PBC. The system exhibits robustness against load variations and parameter uncertainties by utilizing large gains relative to the system's rated values. The dynamic errors in the closed-loop system decay exponentially, with the damping element influencing the rate of convergence. The IDA-PBC optimization problem is constrained by key requirements to ensure robust and practical implementation. The primary constraints include the need to satisfy Lyapunov-based stability conditions for guaranteeing closed-loop system stability and passivity constraints to maintain a positive-definite energy function. Additionally, the optimization must respect the physical limits of the PMSM, such as current and voltage boundaries. These constraints are critical for achieving a stable, high-performance, and implementable control system. Future work will focus on enhancing the robustness of the proposed methodology by addressing extreme parameter variations and broader ranges of external perturbations to

ensure reliable performance across diverse operating conditions. Additionally, the integration of advanced optimization techniques, such as hybrid approaches combining genetic algorithms with other heuristic or machine learning methods, will be explored to improve computational efficiency and scalability. Further efforts will also aim to extend the methodology to multi-objective control scenarios, enabling simultaneous optimization of performance metrics such as energy efficiency, stability, and responsiveness in complex applications.

## CRediT authorship contribution statement

**Youcef Belkhier**: Writing – review & editing, Writing – original draft, Visualization, Validation, Software, Resources, Project administration, Methodology, Investigation, Funding acquisition, Formal analysis, Data curation, Conceptualization. **Siham Fredj**: Writing – review & editing, Writing – original draft, Visualization, Validation, Software, Resources, Project administration, Methodology, Investigation, Funding acquisition, Formal analysis, Data curation, Conceptualization. **Haroon Rashid**: Data curation, Formal analysis, Funding acquisition, Investigation, Methodology, Resources, Software, Validation, Writing – review & editing. **Mohamed Benbouzid**: Writing – review & editing, Visualization, Validation, Supervision, Funding acquisition, Formal analysis, Data curation.

## Funding

This work received no funding.

## Declaration of competing interest

The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.

## Data availability

Data will be made available on request.

## References

A. A. Alfehaid, E. G. Strangas and H. K. Khalil, "Speed control of permanent magnet synchronous motor with uncertain parameters and unknown disturbance," in IEEE Transactions on Control Systems Technology, doi: 10.1109/TCST.2020.3026569.

Aviles, M., Sánchez-Reyes, L.M., Fuentes-Aguilar, R.Q., Toledo-Pérez, D.C., Rodríguez-Reséndiz, J., 2022. A novel methodology for classifying EMG movements based on SVM and genetic algorithms. Micromachines 13 (12), 2108.

Belkhier, Y., Oubelaid, A., 2024. Passivity-based control of PMSM servo system with load torque adaptation: theoretical and experimental validation. IEEE Transactions on Transportation Electrification. Volume 11 (i1), 4494–4503.

Belkhier, Y., Achour, A.Y., Hamoudi, F., Ullah, N., Mendil, B., 2021. Robust energy-based non-linear observer and voltage control for grid-connected permanent magnet synchronous generator in the tidal energy conversion system. Int. J. Energy Res. 45, 13250–13268. https://doi.org/10.1002/er.6650.

Belkhier, Y., Shaw, R.N., Bures, M., Islam, M.R., Bajaj, M., Albalawi, F., et al., 2022a. Robust interconnection and damping assignment energy-based control for a permanent magnet synchronous motor using high order sliding mode approach and nonlinear observer. Energy Rep. 8, 1731–1740.

Belkhier, Y., Achour, A., Bures, M., Ullah, N., Bajaj, M., Zawbaa, H.M., Kamel, S., 2022b. Interconnection and damping assignment passivity-based non-linear observer control for efficiency maximization of permanent magnet synchronous motor. Energy Rep. 8, 1350–1361.

Cruz-Miguel, E.E., García-Martínez, J.R., Rodríguez-Reséndiz, J., Carrillo-Serrano, R.V., 2020. A new methodology for a retrofitted self-tuned controller with open-source fpga. Sensors 20 (21), 6155.

Djouadi, H., Ouari, K., Belkhier, Y., Lehouche, H., 2024. Real-time HIL simulation of nonlinear generalized model predictive-based high-order SMC for permanent magnet synchronous machine drive. International Transactions on Electrical Energy Systems 2024 (1), 5536555.

Junejo, A.K., Xu, W., Mu, C., Ismail, M.M., Liu, Y., 2020. Adaptive speed control of PMSM drive system based a new sliding-mode reaching law. In: IEEE Transactions on Power Electronics, vol. 35, pp. 12110–12121. https://doi.org/10.1109/TPEL.2020.2986893, 11.

Kasri, A., Ouari, K., Belkhier, Y., Oubelaid, A., Bajaj, M., Tuka, M.B., 2024. Real-time and hardware in the loop validation of electric vehicle performance: robust nonlinear
predictive speed and currents control based on space vector modulation for PMSM.
Results in Engineering 22, 102223.

Khanchoul, M., Hilairet, M., Normand-Cyrot, D., 2014. A passivity-based controller under low sampling for speed control of PMSM. Control Eng. Pract. 26, 20–27.

Li, H., Guo, Y., Xu, Q., 2023a. PMSM torque ripple suppression method based on SMA-optimized ILC. Sensors 23 (23), 9317.

Li, W., Li, B., Liang, S., Xiao, H., 2023b. Brain emotional learning control based on radial basis function for permanent magnet synchronous motor. Electronics 12 (23), 4748.

Liu, X., Yu, H., Yu, J., Zhao, Y., 2019. A novel speed control method based on port-controlled Hamiltonian and disturbance observer for PMSM drives. In: IEEE Access, vol. 7, pp. 111115–111123. https://doi.org/10.1109/ACCESS.2019.2934987.

Ma, Liling, Wang, Fuxiang, Wang, Junzheng, 2021. Fault-tolerant control of PMSM based on NTSMC and NLFO. Asian J. Control.

Nguyen, A.T., Basit, B.A., Choi, H.H., Jung, J., 2020. Disturbance attenuation for surface-mounted PMSM drives using non-linear disturbance observer-based sliding mode control. In: IEEE Access, vol. 8, pp. 86345–86356. https://doi.org/10.1109/ACCESS.2020.2992635.

Nicklasson, P.J., Ortega, R., Espinosa-Perez, G., 1994. Passivity-based control of the general rotating electrical machine. Proceedings of 1994 33rd IEEE Conference on Decision and Control 4, 4018–4023. https://doi.org/10.1109/CDC.1994.411573.

Niu, S., Luo, Y., Fu, W., Zhang, X., 2020. An indirect reference vector-based model predictive control for a three-phase PMSM motor. In: IEEE Access, vol. 8, pp. 29435–29445. https://doi.org/10.1109/ACCESS.2020.2968949.

Ortega, R., Canseco, E.G., 2004. Interconnection and damping assignment passivity-based control: a survey. Eur. J. Control 10 (5), 432–450.

Ramirez-Leyva, F.H., Peralta-Sanchez, E., Vasquez-Sanjuan, J.J., Trujillo-Romero, F., 2013. Passivity-based speed control for permanent magnet motors. Procedia Technology 7, 215–222.

Smídkl, V., Janouš, S., Adam, L., Peroutka, Z., 2018. Direct speed control of a PMSM drive using SDRE and convex constrained optimization. In: IEEE Transactions on Industrial Electronics, vol. 65, pp. 532–542. https://doi.org/10.1109/TIE.2017.2723872, 1.

Torres-Salinas, H., Rodríguez-Reséndiz, J., Cruz-Miguel, E.E., Ángeles-Hurtado, L.A., 2022. Fuzzy logic and genetic-based algorithm for a servo control system. Micromachines 13 (4), 586.

Wang, R.I., Lu, B.C., Hou, Y.L., Gao, Q., 2018. Passivity-based control for rocket launcher position servo system based on ADRC optimized by IPSO-BP algorithm. Shock Vib. https://doi.org/10.1155/2018/5801573

Wang, Y., Liu, Y., Ding, J., Wang, D., 2024. Adaptive type-2 fuzzy output feedback control using nonlinear observers for permanent magnet synchronous motor servo systems. Eng. Appl. Artif. Intell. 131, 107833.

Wu, S., Zhang, J., Chai, B., 2019. A robust backstepping sensorless control for interior permanent magnet synchronous motor using a super-twisting based torque observer. Asian J. Control 21 (1), 172–183.

Wu, Y., Zhao, S., Xing, Z., Wei, Z., Li, Y., Li, Y., 2023. Detection of foreign objects intrusion into transmission lines using diverse generation model. IEEE Trans. Power Deliv. 38 (5), 3551–3560.

Xing, Z., Zhao, S., Guo, W., Meng, F., Guo, X., Wang, S., He, H., 2023. Coal resources under carbon peak: segmentation of massive laser point clouds for coal mining in underground dusty environments using integrated graph deep learning model. Energy 285, 128771.

Xu, W., Jiang, Y., Mu, C., Blaabjerg, F., 2019. Improved nonlinear flux observer-based second-order SOIFO for PMSM sensorless control. In: IEEE Transactions on Power Electronics, vol. 34, pp. 565–579. https://doi.org/10.1109/TPEL.2018.2822769, 1.

Xu, W., Junejo, A.K., Liu, Y., Hussien, M.G., Zhu, J., 2021. An efficient antidisturbance sliding-mode speed control method for PMSM drive systems. In: IEEE Transactions on Power Electronics, vol. 36, pp. 6879–6891. https://doi.org/10.1109/TPEL.2020.3039474, 6.