# Controlling the Deformation of the Antagonistic Shape Memory Alloy System by LSTM Deep Learning

Rodayna Hmede, Frédéric Chapelle, Yuri Lapusta, Juan Antonio Corrales Ramón

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

## ► To cite this version:

Rodayna Hmede, Frédéric Chapelle, Yuri Lapusta, Juan Antonio Corrales Ramón. Controlling the Deformation of the Antagonistic Shape Memory Alloy System by LSTM Deep Learning. Actuators, 2024, 13 (12), pp.479. 10.3390/act13120479. hal-04873004

HAL Id: hal-04873004

https://uca.hal.science/hal-04873004v1

Submitted on 15 Jan 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
<figure><img src="image_3.png" /></figure>

Article

# Controlling the Deformation of the Antagonistic Shape Memory Alloy System by LSTM Deep Learning

Rodayna Hmede<sup>1,2,*</sup>, Frédéric Chapelle<sup>2</sup>, Yuri Lapusta<sup>2</sup> and Juan Antonio Corrales Ramón<sup>3,*</sup> ID

**Abstract:** The antagonistic system of two shape memory alloy wires is a great inspiration for the robotics field where it is applied as a linear actuator due to its shape memory effect. However, its control is still a challenge due to its hysteresis behavior. For that reason, a new controller is proposed in this paper for the displacement of the system's effector. It is based on a Long Short-Term Memory neural network model. The aim is achieved by combining temperature-deformation data from an analytical model with voltage-temperature-deformation data from real experiments. Hence, these datasets are studied to overcome the nonlinearity obstacle of this system in order to be able to integrate it into robotic applications.

**Keywords:** shape memory alloys; antagonistic system; neural networks; modelling and controlling

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

check for
updates

**Citation:** Hmede, R.; Chapelle, F.; Lapusta, Y.; Ramón, J.A.C. Controlling the Deformation of the Antagonistic Shape Memory Alloy System by LSTM Deep Learning. *Actuators* **2024**, *13*, 479. https://doi.org/10.3390/act13120479

Academic Editors: Wei Min Huang, Todor Stoilov Todorov and Rosen Mitrev

Received: 29 October 2024

Revised: 24 November 2024

Accepted: 25 November 2024

Published: 27 November 2024

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

**Copyright:** © 2024 by the authors.
Licensee MDPI, Basel, Switzerland.
This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).

## 1. Introduction

Robotic applications are in need of smart actuator systems capable of fine integration and robustness under various circumstances such as stress. In this context, shape memory alloys (SMAs) are one of the active materials that has been largely studied in this applicative field [1–3]. It is considered a smart actuator since it can be trained to deform on its own [4]. This means that it can memorize its original form although it is cooled, heated, stretched, and bent. For that, SMAs have high achievements as sensors and actuators in specific that are investigated in various materials and devices fields in general and smart materials and robotics in specific. Theoretically, an SMA is specified by its solid crystal molecular property. It has two main solid phases: martensite and austenite. Each type of SMA has specific crystallization characteristics (starting and final transformation temperatures) [5]. This nature provides the SMA with two main mechanical properties: shape memory effect and super elasticity. The shape memory effect is characterized by its specific strain–temperature behavior. This is when the SMA is capable of recovering its initial shape. Super elasticity or pseudo elasticity [6] is presented by the stress–strain behavior of the SMA. It can have several shapes: wires, bars, springs, rings, or porous. The antagonistic system (AS), composed of two SMAs, is a challenging system because of its high hysteresis behavior. It is a smart actuator used in various fields, especially systems, biotechnology, automotive, etc. It has a main application in the robotic field as an artificial finger or manipulator actuation [7,8]. It is made up of two identical SMA wires connected at one edge (the midpoint of the whole system) and fixed on the outer edges. The AS has a great studied history among the literature as a linear or rotary actuator. Several publications considered the deformation control of AS SMA using traditional numerical methods such as the finite element method [9] and numerical models [10] and less traditional approaches such as

<footnote n="1">¹ Institute for Radiation Protection and Nuclear Safety (IRSN), National Centre for Scientific Research (CNRS), Cadarache, 13115 Saint-Paul-lez-Durance, France</footnote>

<footnote n="2">² Clermont Auvergne INP, CNRS, Institut Pascal, Université Clermont Auvergne, 63000 Clermont-Ferrand, France; frederic.chapelle@sigma-clermont.fr (F.C.); yuri.lapusta@sigma-clermont.fr (Y.L.)</footnote>

<footnote n="3">³ Centro Singular de Investigación en Tecnoloxías Intelixentes (CiTIUS), Universidade de Santiago de Compostela, 15782 Santiago de Compostela, Spain</footnote>

<footnote>* Correspondence: rodayna.hmede@irsn.fr (R.H.); juanantonio.corrales@usc.es (J.A.C.R.)</footnote>
neural networks [11,12]. However, they are based on an approximate linear piecewise relation, identified through this study, of applied temperature (external stimuli) and the system deformation (response). Therefore, the gap exists in control of the fully non-linear behavior of the actuator system with high accuracy.

The neural network (NN) efficiency is proven in the literature [11], especially in the material sciences field. In the review paper [1], the NNs that were used to model SMAs are reviewed. The authors concluded that each study case (shape, role, and properties) requires a specific AI tool as the specific NN model for the active system.

Moreover, AS was modelled using an NN approach in ref. [13], where the stress–strain behavior of the system was studied using a specific model of long–short-term memory (LSTM) NN with regression layers. By that, the super elastic system’s characteristic is modeled using the LSTM NN. We examined in [13] multiple neural network models for capturing the nonlinear behavior of AS SMAs, concluding that the LSTM model was the most effective. Furthermore, recent advancement [14] has integrated LSTM to study the dynamic response of complex nonlinear systems as tensegrity structures to external stimuli, offering a more accurate prediction of its deformed shape. By combining traditional regression techniques with LSTM networks, they demonstrated enhanced predictive accuracy and robustness. Moreover, in ref. [12], the authors approved the LSTM advantages to model nonlinear behaviors and they provided an advanced model for complex nonlinear ones. Hence, the potential of integrating LSTM is scored for enhanced control of nonlinear systems, as it allows for greater adaptability and more reliable performance in real-world applications, such as robotics and structural monitoring. LSTM NN as a recurrent neural network (RNN) showed its potential through a diversity of studies especially in nonlinear modelling and controlling [15]. The LSTM functionality relies on the network’s ability to learn long-term dependencies between time steps in time series and sequence data. It effectively predicts long patterns of unidentified lengths. In this work, the LSTM neural network (NN) is employed with a regression layer to successfully model the antagonistic SMA actuator. However, modeling or controlling its deformation depending on the variation of its temperature has not been studied using AI. Hence, this article’s aim is to model and control the strain temperature behavior of the AS actuator using NN. The system is heated using applied voltage, and the system’s position is represented by the position of its middle point. The strain–temperature relation has been studied analytically and experimentally to build the proper AI ground truth. This latter is used to learn and test the NN’s method that best challenges the AS’s hysteresis behavior.

## 2. Methodology

The displacement of the midpoint of the AS defines the temperature behavior of the system upon heating the two wires progressively. This behavior will be tested using three models: numerical simulation of an analytical model, experimental model, and AI model. The analytical model is discussed to prove its linear limitation. The experimental model is studied to build the ground truth of the NN model. The NN model will control the system’s temperature to maintain the actuator’s displacement.

The overall test to study the system’s shape memory effect (strain–temperature behavior) is noted in S1. It is performed as follows:

* Initial state: placement of the two wires in an austenitic state by heating them.

* Step 0: pre-stretch the two wires to transform them into partially oriented martensite.

* Step 1: heat the wire SMA1 by applying the voltage.

* Step 2: return the wire SMA1 to room temperature by turning off the applied voltage.

* Step 3: heat the wire SMA2 by applying the voltage.

* Step 4: return the wire SMA2 to room temperature by turning off the applied voltage.

In the following, we call a “cycle” for a “step 1 to step 4” block, and we call a sequence of cycles for the overall test where there are repetitions of the cycle with different applied heating temperatures. Therefore, the cycle is repeated by increasing the voltage sequence to increase the wires’ heating temperature.
### 3. Numerical Simulation Model

The numerical simulation's objective is to understand the theoretical temperature-displacement behavior of the SMA AS system. This relation is presented graphically for each SMA separately in Figure 1 following the piecewise linear assumption. The Young's modulus evolution during the martensitic transformation is then approximated by a linear function of the Young's modulus of austenite (EA) and martensite (EM), depending on the percentage of austenite transformed in martensite (X). However, in our case, we have the hypothesis of constant Young's modulus and constant ambient temperature ($T_{amb}$).

<figure><img src="image_6.png" /><figcaption>**Figure 1.** Stress temperature and stress-strain behaviours upon initialization and activation of the first cycle. (a) Graphs of points (O, O', A, A', and B) are for pre-stretching and heating of SMA1 where the grey points (A'' and B0) refer to the full austenite transformation; (b) graphs of points (B, B', and C) are for cooling of SMA1; (c) graphs of points (C, C', and D) are for heating of SMA2; (d) graphs of points (D, D', and E) are for cooling of SMA2. The red curves are for SMA1, and the blue curves are for SMA2.</figcaption></figure>

Figure 1 schematizes the following steps' descriptions with their reference points (O, O', A, B, C, D, and E).
$$E_{SMA} = X \times x E_{M} + (1 - X) E_{A}. \qquad (1)$$

### 3.1. Static Variables

Force equilibrium:

$$F1 = F2 \rightarrow \Delta F1 = \Delta F2 \qquad (2)$$

Stress increment in the SMA wires:

$$\Delta \sigma_{1} = \Delta F_{1} / A_{1} \qquad (3)$$

$$\Delta \sigma_{2} = \Delta F_{2} / A_{2} \qquad (4)$$

### 3.2. Kinematic Variables

Preservation of system total length:

$$L_{1} = L_{2} \rightarrow \Delta L_{1} = \Delta L_{2} \qquad (5)$$

Strain increment of the SMA wires:

$$\Delta \varepsilon_{1} = \Delta L_{1} / L_{1} \qquad (6)$$

$$\Delta \varepsilon_{2} = \Delta L_{2} / L_{2} \qquad (7)$$

### 3.3. Behavioral Law

The behaviour law of the SMA depends on its molecular phase. If the SMA is completely austenitic, its behaviour is defined by

$$\Delta \sigma = E_{A} \times \Delta \varepsilon \qquad (8)$$

On the contrary, if the SMA is stretched and transformed from austenite to martensite, its behaviour is defined by

$$\Delta \sigma = \alpha \times \Delta \varepsilon \qquad (9)$$

#### Step 0: Pre-initialization of the system

The two wires are initially austenitic and stretched, so their transformation strain is 3%. The stress-strain curves of each SMA wire are shifted following the equations

$$\sigma_{1}^{O'} = \sigma_{cr} \qquad (10)$$

$$\sigma_{2}^{O'} = \sigma_{cr} \qquad (11)$$

$$\varepsilon_{1}^{O'} = \sigma_{1}^{1/E_{A}} \qquad (12)$$

$$\varepsilon_{2}^{O'} = \sigma_{2}^{1/E_{A}} \qquad (13)$$

$$\varepsilon_{1}^{A} = 3\% \qquad (14)$$

$$\varepsilon_{2}^{A} = 3\% \qquad (15)$$

$$\sigma_{1}^{A} = \sigma_{1}^{O'} + \alpha(\varepsilon_{1}^{A} - \varepsilon_{1}^{O'}) \qquad (16)$$

$$\sigma_{2}^{A} = \sigma_{2}^{O'} + \alpha(\varepsilon_{2}^{A} - \varepsilon_{2}^{O'}) \qquad (17)$$

#### Step 1: Heating of SMA wire 1

SMA1 wire will tend to recover its initial length (memorized shape) and exert force on the other wire. SMA2 will then be stretched by following the Equation (9) law, continuing its martensite transformation according to the slope $\alpha$. Let us call $k+$ the slope defining the
thermo-mechanical behaviour of SMA wire 1 being heated. Using Equation (5), k+ can be formulated as follows:

$$k+ = \Delta\sigma1/\Delta\epsilon1 = -\alpha \qquad (18)$$

The evolution of the stress–strain of SMA wire 1 when it is fully austenite is defined by point B0, situated at the following intersection:

* The equation line representing the austenitic elasticity of SMA1.

$$\sigma_1^{B0} = E_A \times \varepsilon_1^{B0} \qquad (19)$$

* The equation line of slope $-\alpha$, passing from point A, as follows:

$$(\sigma_1^{B0} - \sigma_1^A)/(\varepsilon_1^{B0} - \varepsilon_1^A) = -\alpha \qquad (20)$$

It gives

$$\varepsilon_1^{B0} = \frac{\sigma_1^A + \alpha\varepsilon_1^A}{\alpha + E_A} \qquad (21)$$

The evolution of the stress–strain curve of SMA wire 2 gives

$$\varepsilon_2^{B0} = \varepsilon_2^A - \varepsilon_1^{B0} + \varepsilon_1^A \qquad (22)$$

Moreover, the behaviour of SMA wire 2 gives

$$\sigma_2^{B0} = \sigma_2^A + \alpha(\varepsilon_2^{B0} - \varepsilon_2^A) \qquad (23)$$

The slope of transition from starting austenite at A' to final austenite at A", which can be defined by $\beta'$ using Equation (24), we calculate Equations (25) and (26).

$$\sigma_1^A = \beta T + T_0 \qquad (24)$$

We can calculate the following:

$$T_1^{A'} = (-A_S + \sigma_1^A)/\beta \qquad (25)$$

$$T_1^{A''} = (-A_F + \sigma_1^{B0})/\beta \qquad (26)$$

So, the slope of the transition is as follows:

$$\beta' = (\sigma_1^A - \sigma_1^{B0})/(T_1^{A'} - T_1^{A''}) \qquad (27)$$

The evolution of the stress–strain of SMA wire 1 when the temperature T between $T_1^{A'}$ and $T_1^{A''}$ is defined by point B:

$$\sigma_1^A = \beta'(T_1^B - T_1^{A'}) + \sigma_1^A \qquad (28)$$

B is on AB0 of slope $-\alpha$ in the stress–strain diagram, so

$$\varepsilon_1^B = (-\sigma_1^B + \sigma_1^A)/\alpha + \varepsilon_1^A \qquad (29)$$

For the SMA2, according to the symmetry concept: $\sigma_1^B = \sigma_2^B$. B is on AB0 of slope $+\alpha$ in the stress–strain diagram, so

$$\varepsilon_2^B = (\sigma_2^B - \sigma_2^A)/\alpha + \varepsilon_2^A \qquad (30)$$

## Step 2: Cooling of SMA wire 1

Cooling down the SMA1 will decrease the stress in the two wires. SMA1 returns to an austenite/martensite state, so it must undergo unloading to return to the corresponding
line. Let us define k⁻ as the slope that defines the thermo-mechanical behaviour of SMA wire 1. k⁻ is the inverse of the charge/discharge law:

$$K^{-} = \Delta\sigma_{1}/\Delta\varepsilon_{1} = -E \quad (31)$$

The evolution of the stress-strain curve of SMA1 is defined by point C, situated at the following intersection:

* The equation line

$$\sigma_{1}^{C} = \alpha \varepsilon_{1}^{C} + b \quad (32)$$

representing the martensitic transformation plateau, with

$$b = \sigma_{1}^{A} - \alpha \times \varepsilon_{1}^{A}$$

* The equation of slope k⁻ = -E passing by point B, which is as follows:

$$(\sigma_{1}^{C} - \sigma_{1}^{B})/(\varepsilon_{1}^{C} - \varepsilon_{1}^{B}) = -E \quad (33)$$

That gives

$$\varepsilon_{1}^{C} = (b - \sigma_{1}^{B} - E \times \varepsilon_{1}^{B})/(-E - \alpha) \quad (34)$$

and $\sigma_1^C$ is calculated using Equation (9).

Concerning SMA wire 2, point C is defined by knowing Equation (5) which gives

$$\varepsilon_{2}^{C} = \varepsilon_{2}^{B} - \Delta\varepsilon_{1} \quad (35)$$

$$\sigma_{2}^{C} = \sigma_{2}^{B} + E(\varepsilon_{2}^{C} - \varepsilon_{2}^{B}) \quad (36)$$

### Step 3: Heating of SMA wire 2

Now the same procedure of the SMA1 heating takes place for SMA2. First, we need the complete transformation of the wire to austenite to find the transition slope β" where SMA2 can be retracted so that SMA wire 1 will be stretched. SMA wire 1 starts its martensite transformation, and its behaviour is defined by Equation (9). As presented before, the slope defining the thermo-mechanical behavior of a heated SMA is k⁺ = -α when the other SMA wire is transforming from austenite to martensite.

The evolution of the stress-strain curve of SMA wire 2 is defined by point D₀, situated at the following intersection:

* The equation line

$$\sigma_{2}^{D0} = E_{A} \times \varepsilon_{2}^{D0} \quad (37)$$

* The equation line of slope -α passing by point C:

$$(\sigma_{2}^{D0} - \sigma_{2}^{C})/(\varepsilon_{2}^{D0} - \varepsilon_{2}^{C}) = -\alpha \quad (38)$$

which gives

$$\varepsilon_{2}^{D0} = (\sigma_{2}^{C} + \alpha \varepsilon_{2}^{C})/(\alpha + E_{A}) \quad (39)$$

$$\sigma_{2}^{D0} = \sigma_{2}^{C} - \alpha(\varepsilon_{2}^{D0} - \varepsilon_{2}^{C}) \quad (40)$$

Concerning SMA2, the evolution of the stress-strain curve is defined by Equation (5), which gives

$$\varepsilon_{2}^{D0} = \varepsilon_{2}^{C} - \varepsilon_{2}^{D0} + \varepsilon_{2}^{C}(\Delta\varepsilon_{2}) \quad (41)$$

Knowing the point of the behavior of SMA1 that is determined by its martensitic transformation and defined by Equation (9), which gives

$$\sigma_{1}^{D0} = \sigma_{1}^{C} + \alpha(\varepsilon_{1}^{D0} - \varepsilon_{1}^{C}) \quad (42)$$
To calculate the slope of transition from starting austenite at C' to final austenite at C'', which is defined by β'', we know that $\sigma = \beta T + T_0$, so we can calculate the following:

$$T_2^{C'} = (-A_S + \sigma_2^C)/\beta \quad (43)$$

$$T_2^{C''} = (-A_F + \sigma_2^{D0})/\beta \quad (44)$$

So, the slope of the transition is as follows:

$$\beta'' = (\sigma_2^C - \sigma_2^{D0})/(T_2^{C'} - T_2^{C''}) \quad (45)$$

The evolution of the stress-strain of SMA wire 1 when the temperature T between $T_2^{C'}$ and $T_2^{C''}$ is defined by point D:

$$\sigma_2^D = \beta'' (T_2^D - T_2^{C'}) + \sigma_2^C \quad (46)$$

D is on CD₀ of slope $-\alpha$ in the stress-strain diagram, so

$$\varepsilon_2^D = (-\varepsilon_2^D + \varepsilon_2^C)/\alpha + \varepsilon_2^C \quad (47)$$

For the SMA1, according to the symmetry concept: $\sigma_1^D = \sigma_2^D$. D is on CD₀ of slope $+\alpha$ in the stress-strain diagram, so

$$\varepsilon_1^D = (\sigma_1^D - \sigma_1^C)/\alpha + \varepsilon_1^C \quad (48)$$

### Step 4: Cooling of SMA2

The mechanical behaviour of SMA wire 1 is defined by Equation (9). As previously seen, the thermo-mechanical behaviour of a cooled SMA wire, returning to a mixed martensite/austenite phase, is defined by the slope $k^- = -E$. Point E then defines the evolution of the stress-strain curve of SMA wire 2, situated at the following intersection:

* The equation line

$$\sigma_2^E = \alpha \varepsilon_2^E + b \quad (49)$$

* The equation line of slope $k^- = -E$ passing by point D, that is

$$(\sigma_2^E - \sigma_2^D)/(\varepsilon_2^E - \varepsilon_2^D) = -E \quad (50)$$

which gives:

$$\varepsilon_2^E = (b - \sigma_2^D - E \times \varepsilon_2^D)/(-E - \alpha) \quad (51)$$

and $\sigma_2$ is calculated using Equation (9), which gives:

$$\sigma_2^E = \sigma_2^D - E (\varepsilon_2^E - \varepsilon_2^D) \quad (52)$$

Concerning SMA wire 1, we use the evolution of the strain, which gives:

$$\varepsilon_1^E = \varepsilon_1^D - \Delta\varepsilon_2 \quad (53)$$

$$\sigma_1^E = \sigma_1^D + E(\varepsilon_1^E - \varepsilon_1^D) \quad (54)$$

To have explicit knowledge of our SMA, several numerical tests of various heating temperature ranges are studied. The activation temperature (T) depends on the thermal properties of the SMA wire: Ms, Mf, As, and Af. The T values are obtained empirically using MATLAB R2024b, which are between 70 °C and 95 °C. Moreover, the numerical simulation algorithm's output is the displacement value of the midpoint at each heating step for each wire upon the sequence of cycles where T is increasing progressively. Figure 2a,b presents the results upon applying T on the SMA1 and the SMA2 wires, respectively. As the stress-temperature behaviour of SMA is the shape memory effect, the presence of hysteresis characteristics prevents the precision of these piecewise linear relationships, leading to the
analytical model's limitations and proving the need for AI modelling. We obtain a strictly
linear displacement-temperature behavior at step 1 (heating of the SMA1 wire), while it is
almost linear at step 3 (heating of the SMA2 wire). At T equals 70 °C, the displacements are
1.3 mm and 2.6 mm in step 1 and step 3, respectively. At T equals 95 °C, the displacements
are 13.8 mm and 26.4 mm in step 1 and step 3, respectively. This can be explained well
by the shape memory effect of the SMA: at the initialization step of stretching 3% of each
wire, the midpoint does not move, having two equal and opposite displacement directions.
Upon heating the SMA1 wire, it contracts and causes elongation of the SMA2 wire and an
SMA1 state transformation to austenite. Hence, the midpoint is displaced in the negative
direction by (−Δl). Upon cooling the SMA1 wire, it remains in its form with light release
displacement. Upon heating the SMA2 wire, it contracts and causes an elongation of the
SMA1 wire, so the midpoint returns to its initial position by moving (Δl). Then, as SMA2
contracts, the midpoint keeps moving in the positive direction with second (−Δl) as the
SMA2 wire's state transforms to pure austenite. Upon cooling the SMA2 wire, it remains in
its form with light displacement. The schematic of this explanation is presented in Figure 3.

<figure><img src="image_7.png" /><figcaption>**Figure 2.** The simulated displacements of the antagonistic system midpoint as a function of the heating temperature upon each cycle of S1 are produced numerically using MATLAB: (a) upon heating SMA1, (b) upon heating SMA2.</figcaption></figure>

<figure><img src="image_8.png" /><figcaption>**Figure 3.** Description of the state and form of the AS SMA system: (a) upon the initialization procedure of 3% pre-stretching (Δl₀) and (b) upon a cycle of test S1.</figcaption></figure>
## 4. Experimental Model

The aim of this section is to develop the heating-cooling experiment S1, described previously in the methodology (Section 2) for a two-wire AS based on the single wire presented in Section 4.1. The principle's schematisation is given in Figure 3. The objective is to measure the position of the midpoint (the connection point between the two wires) and the temperature passing through the wires during the system operation. For that purpose, a physical AS was built and instrumented (see Section 4.2). The experimental results are presented in Section 4.3. Notice that the experimental process respects the same strategy explained in the numerical simulation model part (Section 3) upon the six cycles.

### 4.1. Initialization and Identification of the SMA Parameters

Experimentally, the used SMA wire is Flexinol of 0.006 inches diameter of a low-temperature (LT) model, which means the SMA is martensite formed at lower temperatures, provided by RobotShop. Flexinol is made up of nickel-titanium (NiTi), enabling this "muscle wire" contraction ability upon electricity application. The single wire length is 30 mm. The wire's parameters are presented in Table 1.

<table><caption>**Table 1.** The supplied data sheet gives the properties of the used shape memory alloy wire.</caption><thead><tr><td>Characteristic</td><td>Value</td></tr></thead><tbody><tr><td>Off-Time</td><td>2 s</td></tr><tr><td>Resistance</td><td>55 Ω/m</td></tr><tr><td>Recommended current at room temperature</td><td>410 mA</td></tr><tr><td>Recommended pull force</td><td>321 g</td></tr><tr><td>Recommended deformation</td><td>3–5%</td></tr><tr><td>Martensite start temperature, Ms</td><td>52 °C</td></tr><tr><td>Martensite finish temperature, Mf</td><td>42 °C</td></tr><tr><td>Austenite start temperature, As</td><td>68 °C</td></tr><tr><td>Austenite finish temperature, Af</td><td>78 °C</td></tr></tbody></table>

### 4.2. Activation and Preparation of the Experimental Setup

The experimental setup is presented in Figure 4, and its CAD design is presented in Figure 5. Sliding of the SMA wires at their two ends in the clamping system is one of the major concerns for the designers of SMA wire-based mechanisms. In our system, the wire is thin (diameter of 0.006 inches), so two adequate clamper tubes at the two ends tighten the SMA wire to achieve accurate actuation strongly. The two SMA wires are connected mechanically in series and electrically in parallel with a switch in the antagonistic system (Figure 6). It is essential to note the electrical isolating significance: (1) between the wires and the metal support, and (2) between the connected wires at the middle point to prevent the electricity passage between them and between the support and the wires, respectively.

<figure><img src="image_9.png" /><figcaption>**Figure 4.** The innovative system consists of two antagonistic SMA wires (SMA1 and SMA2), four clamper tubes to hold the thin ends of the SMA wires, and two pre-stretching screws that strain the wires by screwing and release them by unscrewing.</figcaption></figure>
<figure><img src="image_10.png" /><figcaption>Figure 5. CAD design of the test bench using CATIA software CATIA V5-6R2018.</figcaption></figure>

<figure><img src="image_11.png" /><figcaption>**Figure 6.** The scheme of the electric circuit of the AS SMA system with the Arduino connections, where GND and D5 are the ground (negative) and the 5V (positive) pins of Arduino, respectively, and where S, D, and G of the MOSFET switch transistor are the source, drain, and gate pins, respectively.</figcaption></figure>

Therefore, non-conductor clamper tubes (the copper cylinders in Figure 5) are used for holding the thin wire properly and for electrical isolation. An essential pre-operative step for using SMA in our experiment is provided: Before activating the SMA wires, they are pre-stretched by 3% using the screw connections between the cylinders and the system. Each turn of the pre-stretching screw strains the wire by 1 mm. Therefore, the initialization procedure in this experiment can be considered as pre-stretching each wire by 3% simultaneously.

The setup of S1 consists of the following:

* A displacement sensor measures the displacement of the system midpoint.

* Two temperature sensors record the temperature of the two wires.

* An electric relay switches the current between the two wires.

* A switch transistor switches on and then off the current on the actuated wire.

* A power supply provides the voltage.

* An Arduino setup controls the electric circuit and runs the sensors.

* The measured parameters are as follows:

* The voltage at the terminals of the wire and the current intensity.

* The displacement of the midpoint.
* The temperature of the wires.

According to the data sheet (Table 1), the wire needs 2 s to heat up and cool at a low activation temperature. This means each step takes 2 s.

The controlling of the electric circuit is performed by using the Arduino board. The schematic in Figure 6 describes the electric circuit and Arduino connections. The wires are connected electrically in parallel and mechanically in series. This means each wire has an independent electric circuit that Arduino controls to switch the voltage on and off regularly. The aim is to maintain the voltage value passing through the wires. The setup needs a main electric relay in the primary circuit to switch the electricity between the two parallel circuits and a switching transistor to continuously turn the electricity on and off for each circuit. The relay selects the first wire to activate and passes the current through, then it sends it to the transistor that plays the role of a switch to heat the wire by applying the voltage through and then cooling it by blocking the current. Secondly, the relay closes the circuit for SMA1 and opens it for SMA2, and the transistor plays the same role in the SMA2 circuit. Arduino controls the relay and transistor work with each step's opening and closing time. In addition, Arduino is used to activate and collect the sensors' data.

### 4.3. *Experimental Results*

The temperature-voltage relation was studied at the beginning of the experiments by applying a voltage value on the SMA wire and reading its temperature using the thermal sensor. These experimentally obtained data are presented in Table 2 and Figure 7. This experiment proved the proportional relation between the SMA wire temperature and the applied voltage. Then, upon each step, we connected a temperature sensor to the wires to collect the temperature, a displacement sensor to the midpoint of the two wires to obtain the position or displacement of this point, and a voltmeter to measure the applied voltage at each wire. We figured out the collected data of the midpoint displacement and the wire temperature as a function of the applied voltage. As a result, the temperature-displacement hysteresis behavior of the antagonistic system is obtained. The experimentally collected data are voltage (V), temperature (°C), and displacement (mm). Furthermore, a sequence of cycles of S1 is studied to figure out the displacement-temperature behaviour of the AS SMA system. The experiment starts at time zero, and the zero reference position (the initial position before beginning the experiment) is in the system's middle as the two wires are of equal length. The sensors return the midpoint displacement (Δl) and the wire temperature T at step 1 (where the SMA1 wire is heated) and step 3 (where the SMA2 is heated). Hence, upon each cycle, we have the midpoint's actual position, the midpoint displacement, and the temperature of the heated wire (Table 3). Experimentally, the displacement-temperature behaviour of the midpoint of the AS SMA system has a proportional nonlinear relation. It assures the weakness of the analytical model. Therefore, these strictly non-linear graphs will be the learning base. Therefore, we can study the system using AI by this ground truth of the temperature-displacement behaviour.

<table><caption>**Table 2.** The variation of the temperature of the midpoint of the AS SMA system upon applying the voltage for 2 s.</caption><tr><td>Voltage (V)</td><td>3</td><td>6</td><td>8</td><td>10</td><td>13</td><td>16</td><td>20</td><td>22</td><td>24</td></tr><tr><td>Temperature (°C)</td><td>32</td><td>42</td><td>56</td><td>58</td><td>89</td><td>98</td><td>117</td><td>120</td><td>126</td></tr></table>
<figure><img src="image_12.png" /><figcaption>**Figure 7.** The variation of the temperature of the midpoint of the AS SMA system upon applying the voltage for 2 s.</figcaption></figure>

<table><caption>**Table 3.** The experimentally collected data of the AS SMA system during the four cycles.</caption><thead><tr><th rowspan="2">Cycle</th><th colspan="6">Step 1</th><th colspan="5">Step 3</th></tr><tr><th>t (s)</th><th>T</th><th>P0</th><th>P1</th><th>Δl</th><th>t (s)</th><th>T</th><th>P2</th><th>P3</th><th>Δl</th></tr></thead><tbody><tr><td>1</td><td>2</td><td>31.7</td><td>0</td><td>-2</td><td>-2</td><td>6</td><td>32</td><td>-2</td><td>+2</td><td>4</td></tr><tr><td>2</td><td>10</td><td>38</td><td>+2</td><td>-1</td><td>-3</td><td>14</td><td>41</td><td>-1</td><td>+5</td><td>6</td></tr><tr><td>3</td><td>18</td><td>58.7</td><td>5</td><td>1</td><td>-4</td><td>22</td><td>58.1</td><td>+1</td><td>+9</td><td>8</td></tr><tr><td>4</td><td>26</td><td>75.7</td><td>9</td><td>4.66</td><td>-4.3</td><td>30</td><td>70.8</td><td>4.66</td><td>+13.6</td><td>9</td></tr><tr><td>5</td><td>34</td><td>84.2</td><td>13.6</td><td>8.66</td><td>-5</td><td>38</td><td>88</td><td>8.66</td><td>+18.6</td><td>10</td></tr><tr><td>6</td><td>42</td><td>92</td><td>18.6</td><td>12.6</td><td>-6</td><td>46</td><td>93</td><td>12.6</td><td>+24.6</td><td>12</td></tr></tbody></table>

# 5. Artificial Intelligence Model

## 5.1. Ground Truth

The ground truth of the AI study in this work is the experimental data of the displacement-temperature behaviour developed previously using the real system. The experimentally collected data of the AS SMA system are temperature (°C) and displacement (mm). This means, the dataset consists of six cycles of two positions (P1, P3) as a function of temperature. They are presented in Table 3 and Figure 8. The aim is to analyse the evolution of the position of the bonding point between the two SMA wires caused by the voltage applied on the terminals during heating/cooling cycles at room temperature. The displacement-temperature dataset is modelled by the neural network model which consists of the LSTM NN and a regression layer. It is discussed in [13] where the stress-strain behavior is modelled. Moreover, controlling the system depends on predicting the heating temperature needed to reach a precisely targeted position by the midpoint, also called the targeted system position. The learning base consists of the initial position and the target position of the system as inputs and the heating temperature for the two wires as an output. It is time steps data since it is made up of four steps, and each step requires a specific time duration of heating or cooling of the wires. Focusing on the final position of the overall design, we consider step 1 and step 3: the initial position of step 1 (P0) and the final position of step 3. Moreover, considering the intermediate displacement of the system caused by step 1, we take into account P1, which is the final position of step 1 for each cycle.
<figure><img src="image_13.png" /><figcaption>**Figure 8.** The experimental displacements of the antagonistic system midpoint as a function of the heating temperature upon a sequence of cycles: (a) upon heating SMA1, (b) upon heating SMA2.</figcaption></figure>

During our analysis, we checked several metrics such as loss function and R2. We have chosen RMSE as the primary evaluation metric because it effectively quantifies prediction accuracy by penalising larger errors more heavily, making it suitable for the context of our study. Hence, for evaluation, the NN tests depend on the square root of the mean squared error (RMSE) between the predicted and actual values.

## 5.2. LSTM Modelling of a Sequence of Cycles

The LSTM NN consists of 4 layers: a sequence input layer with 1 feature (variable), a long short-term memory (LSTM) layer with 800 hidden units, a fully connected layer with 1 output, and a regression layer for continuous value prediction. The parameters used in this LSTM setup then include 1 input (the temperature value array), 1 output (the displacement value array), and 800 hidden units determining the amount of information remembered between the states. The LSTM layers update their internal cell and hidden states using the hyperbolic tangent function (tanh) as the state activation function and the hard sigmoid (σ) function as the gate activation function. The fully connected and regression layers play significant roles in the network. Precisely, the regression layer models the relationship between the displacement and the temperature. The network is trained using the ADAM optimizer with a learning rate of 0.005, which decreases by a factor of 0.2 every 125 epochs according to a piecewise schedule. The training process is configured to run for a maximum of 800 epochs, with a gradient threshold of 1 to prevent gradient explosion. The number of hidden units in the LSTM model was determined through empirical testing and optimisation. We evaluated several configurations of hidden units (ranging from 50 to 900) to identify the optimal setup. The selected number of 800 hidden units provided the best trade-off between model accuracy (measured using RMSE) and computational cost. Increasing the number beyond 800 did not result in significant accuracy improvement but increased the training time and risk of overfitting. This choice ensures that the model's performance is robust while maintaining computational efficiency.

The performance is monitored through training-progress plots, and the model is evaluated using the mean squared error metric. For robust analysis, the dataset is split into 70% for training and 30% for testing of the total experimental dataset.

Hence, this model obtained an excellent modelling of the system behaviour with a low RMSE value. Figure 9a presents the modelling of the displacements of the antagonistic system midpoint as a function of the temperature at step 1 upon a sequence of cycles obtained experimentally. Its RMSE value is $7.2372 \times 10^{-4}$ mm. Figure 9b presents the modelling of the displacements as a function of the temperature at step 3 upon a sequence of cycles obtained experimentally. Its RMSE value is $2.4045 \times 10^{-4}$ mm. Note that the heating temperatures at step 1 and step 3 are the same.
<figure><img src="image_14.png" /><figcaption>**Figure 9.** The modelled displacements of the antagonistic system midpoint as a function of the wires' heating temperature upon a sequence of cycles using the LSTM NN model: (a) upon heating SMA1, (b) upon heating SMA2.</figcaption></figure>

5.3. *LSTM Controlling of the Midpoint's Position*

For controlling, the data underwent standardisation prior to training to improve
the accuracy and efficiency of the model used. This process scaled both the input and
output data to have a standard deviation of 1. Standardisation helps ensure that each
feature contributes equally to the model's learning process, preventing features with larger
scales from dominating the model's training. Moreover, this preprocessing step aids in
faster convergence and more stable optimisation during the training of LSTM. Following
training, the standardised predictions are transformed back to their original scale, enabling
the evaluation of the model's performance using the key metrics Root Mean Squared
Error (RMSE).

Concerning repeatability and reliability, measurements taken to ensure the reliability of our experimental data include (1) careful calibration of equipment—following the activation method of the two SMAs by 3% strain of their initial length, (2) consistent testing conditions using force and heat sensors, and (3) controlled SMA cycling protocols, up to six cycles, upon each position measurement to mitigate fatigue effects.

The NN is designed using recordings of T responding to the initial and targeted
system positions. The inputs are three value units: P0 for the initial position, P1 for the
intermediate position (caused by step 1), and P2 for the final position (caused by step 3)
for a given timestep. The LSTM NN model that has the best training uses 800 hidden
units as the LSTM layer's size with regression and fully connected layers. Consequently,
the LSTM NN is computed to control T responding to P1 and P2 respecting the cycle
steps, with an RMSE of 2.79 × 10⁻⁴ mm. Figure 10 presents the tested and trained system
position-temperature behaviour.
<figure><img src="image_15.png" /><figcaption>**Figure 10.** The controlled temperature responds to the AS system's (a) intermediate position (P1) and (b) intermediate position (P3).</figcaption></figure>

**6. Conclusions**

In conclusion, the shape memory effect of the antagonistic actuator is studied theoretically and presented numerically using MATLAB. Then the cyclic movement of the system is produced experimentally and measured by the temperature and displacement sensors to extract the AI model's ground truth. The latter is constituted by the initial, intermediate, and final positions for several consecutive cycles. The final position occurs at the end of heating the SMA2 wire (step 3), the intermediate one occurs at the end of heating the SMA1 wire (step 1), and the initial one appears at the beginning of the cycle. The potential of the LSTM NN model for modelling the shape memory effect and controlling the system's position has been proven through this work. Moreover, the training parameters have an optimisation role in achieving less RMSE value for the controlling procedure. The number of layers, the maximum epoch number, the activation and training functions, and the number of neurons can summarise these characteristics. From a perspective, as SMA is a challenge in a controlling process, this study can inspire the active material field, especially since the studied system plays an actuator role. Moreover, this study could involve further developments in addition to the cyclic movement. This work could also be extended to control the electric cyclic loop with non-supervision.

Moreover, studying the ambient temperature effect requires further experimental preparations. Therefore, as a perspective, expanding the dataset to include variations in ambient temperature could enhance the model's robustness. This would improve applicability to a broader range of conditions, ensuring a more reliable and generalisable performance.

We can discuss the non-supervision principle as Reinforcement Learning (RL), which is also a widespread approach in robotic control. This combination could be illustrated as a robotic application for medical tasks, where the global behavior of the smart actuator and the encompassing structure must be addressed.

**Author Contributions:** Conceptualization, R.H. and F.C.; methodology, R.H., F.C. and J.A.C.R.; validation, R.H., J.A.C.R. and F.C.; software, R.H.; formal analysis, Y.L., J.A.C.R. and F.C.; investigation, R.H., F.C., J.A.C.R. and Y.L.; resources, J.A.C.R. and F.C.; data curation, R.H.; writing—original draft preparation, R.H.; writing—review and editing, F.C., J.A.C.R. and Y.L.; visualization, R.H.; supervision, F.C., J.A.C.R. and Y.L.; project administration, F.C.; funding acquisition, F.C. All authors have read and agreed to the published version of the manuscript.
**Funding:** This research was funded by the ANR project AIM (ANR-20-THIA-0001) and the European Union under the European Regional Development Fund (ERDF). It also used materials from the ANR MANIMAT project (ANR-20-CE33-0005). JACR was funded by the Spanish Ministry of Universities through a 'Beatriz Galindo' fellowship (Ref. BG20/00143), by the Interreg VI-B SUDOE Programme through the research project ROBOTA-SUDOE (Ref. S1/1.1/P0125) and by the European Union (European Regional Development Fund—ERDF).

**Data Availability Statement:** The data presented in this study are available upon request from the corresponding authors.

**Conflicts of Interest:** The authors declare no conflicts of interest. The funders had no role in the design of the study; in the collection, analyses, or interpretation of the data; in the writing of the manuscript; or in the decision to publish the results.

## References

1. Hmede, R.; Chapelle, F.; Lapusta, Y. Review of Neural Network Modeling of Shape Memory Alloys. *Sensors* **2022**, *22*, 5610. [CrossRef] [PubMed]

2. Kheirikhah, M.M.; Rabiee, S.; Edalat, M.E. A Review of Shape Memory Alloy Actuators in Robotics. In *RoboCup 2010: Robot Soccer World Cup XIV*; Ruiz-del-Solar, J., Chown, E., Plöger, P.G., Eds.; Springer: Berlin/Heidelberg, Germany, 2011; pp. 206–217. [CrossRef]

3. Duerig, T.W.; Melton, K.N.; Stöckel, D. *Engineering Aspects of Shape Memory Alloys*; Butterworth-Heinemann: Oxford, UK, 2013.

4. Aïssa, B.; Memon, N.K.; Ali, A.; Khraisheh, M.K. Recent Progress in the Growth and Applications of Graphene as a Smart Material: A Review. *Front. Mater.* **2015**, *2*, 58. [CrossRef]

5. Guo, L.; Chen, F.; Chen, S.; Huang, Y.; Zhang, J.; Wang, C.; Yang, S. The improvement of the shape memory effect of Cu-13.5Al-4Ni high-temperature shape memory alloys through Cr-, Mo-, or V-alloying. *J. Sci. Adv. Mater. Devices* **2023**, *8*, 100532. [CrossRef]

6. Jahanbazi Asl, F.; Kadkhodaei, M.; Karimzadeh, F. The effects of shape-setting on transformation temperatures of pseudoelastic shape memory alloy springs. *J. Sci. Adv. Mater. Devices* **2019**, *4*, 568–576. [CrossRef]

7. Ko, J.; Jun, M.B.; Gilardi, G.; Haslam, E.; Park, E.J. Fuzzy PWM-PID control of cocontracting antagonistic shape memory alloy muscle pairs in an artificial finger. *Mechatronics* **2011**, *21*, 1190–1202. [CrossRef]

8. Dilibal, S.; Engeberg, E.D. Finger-like manipulator driven by antagonistic nickel-titanium shape memory alloy actuators. In *Proceedings of the 2015 International Conference on Advanced Robotics (ICAR)*, Istanbul, Turkey, 27–31 July 2015; pp. 152–157. [CrossRef]

9. Boufayed, R.; Chapelle, F.; Destrebecq, J.F.; Balandraud, X. Finite element analysis of a prestressed mechanism with multi-antagonistic and hysteretic SMA actuation. *Meccanica* **2020**, *55*, 1007–1024. [CrossRef]

10. Auricchio, F.; Bonetti, E.; Scalet, G.; Ubertini, F. Theoretical and numerical modeling of shape memory alloys accounting for multiple phase transformations and martensite reorientation. *Int. J. Plast.* **2014**, *59*, 30–54. [CrossRef]

11. Imoisili, P.E.; Makhatha, M.E.; Jen, T.-C. Artificial Intelligence prediction and optimization of the mechanical strength of modified Natural Fibre/MWCNT polymer nanocomposite. *J. Sci. Adv. Mater. Devices* **2024**, *9*, 100705. [CrossRef]

12. Gonzalez, J.; Yu, W. Non-linear system modeling using LSTM neural networks. *IFAC-Pap.* **2018**, *51*, 485–489. [CrossRef]

13. Hmede, R.; Chapelle, F.; Lapusta, Y. Modeling the butterfly behavior of SMA actuators using neural networks. *Comptes Rendus. Mécanique* **2022**, *350*, 143–157. [CrossRef]

14. Mao, Z.; Kobayashi, R.; Nabae, H.; Suzumori, K. Multimodal Strain Sensing System for Shape Recognition of Tensegrity Structures by Combining Traditional Regression and Deep Learning Approaches. *IEEE Robot. Autom. Lett.* **2024**, *9*, 10050–10056. [CrossRef]

15. Yu, Y.; Si, X.; Hu, C.; Zhang, J. A Review of Recurrent Neural Networks: LSTM Cells and Network Architectures. *Neural Comput.* **2019**, *31*, 1235–1270. [CrossRef] [PubMed]

**Disclaimer/Publisher's Note:** The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.