Adaptive Intelligent Sliding Mode Control of a Dynamic System with a Long Short-Term Memory Structure

: In this work, a novel fuzzy neural network (NFNN) with a long short-term memory (LSTM) structure was derived and an adaptive sliding mode controller, using NFNN (ASMC-NFNN), was developed for a class of nonlinear systems. Aimed at the unknown uncertainties in nonlinear systems, an NFNN was designed to estimate unknown uncertainties, which combined the advantages of fuzzy systems and neural networks, and also introduced a special LSTM recursive structure. The special three gating units in the LSTM structure enabled it to have selective forgetting and memory mechanisms, which could make full use of historical information, and have a stronger ability to learn and estimate unknown uncertainties than general recurrent neural networks. The Lyapunov stability rule guaranteed the parameter convergence of the neural network and system stability. Finally, research into a simulation of an active power ﬁlter system showed that the proposed new algorithm had better static and dynamic properties and robustness compared with a sliding controller that uses a recurrent fuzzy neural network (RFNN).


Introduction
Most systems existing in nature are nonlinear. Many scholars have developed various linearization methods [1,2], which are then used for analysis and processing. However, especially in practical applications, for highly nonlinear systems, implementing control tasks for dynamic systems with uncertain parameters is still a hot research issue. In recent years, the scientific community has developed multiple advanced control strategies for nonlinear systems. SMC became the most widely used and effective control method in complex nonlinear systems [3][4][5][6][7].
However, traditional sliding mode control can often cause a system to have highfrequency switching characteristics, which may have a serious impact on the system. Recently, fuzzy logic systems (FLS) [8,9] and neural networks (NN) [10,11] have been widely applied in parameter estimation and system identification as two main schemes. Due to its fuzzy mechanism, FLS has a strong ability to deal with uncertain systems. In [8], a fuzzy logic control method was designed to change controller parameters in order to adapt the system uncertainty. Artificial neural networks (ANN) are adaptive and self-learning, and, theoretically, a multilayer feedforward NN can approximate any complex nonlinear function [9]. In [10], an NN controller was developed to approximate the upper bound of system uncertainties for nonlinear systems. Subsequently, various forms and structures of neural networks [11][12][13][14][15] were proposed for nonlinear control problems, such as the back propagation (BP) NN [12,13], radial basis function (RBF) NN [14,15], and so on. RBF neural networks have also been developed and have changed rapidly. These neural networks can adaptively compensate for the nonlinearity in a system using an adaptive feedback controller, which is described in [16]. The learning algorithm of an RBF neural network was improved and a new generalized growth and pruning algorithm was proposed for RBF in [17]. An RBF neural network was applied to robot trajectory tracking control in [18]. A fuzzy neural network (FNN) that combined a fuzzy control method and an NN estimator were developed to approach unknown system uncertainties in [19,20]. A recurrent feature-selection-type FNN was employed for a synchronous reluctance motor in [21].
Considering that traditional BP neural networks and RBF neural networks are both feed-forward networks, it is not easy to handle the time correlation issue without using historical data. Therefore, for signals with complex features, various recurrent NN methods have been proposed [22][23][24]. Advanced NN strategies using sliding mode schemes have been researched for dynamic systems [25][26][27].
Hochreiter and Schmidhuber proposed a more effective long short-term memory (LSTM) NN structure in [28]. Some variants of LSTM were studied and the forgettinggate property and output gate with output activation function were proved to be its most critical components [29]. The interpretability of an LSTM structure was studied in depth [30]. Due to its many compelling features, LSTM is used in areas such as motion recognition [31], video subtitles [32], image classification [33], nonlinear regression [34], and natural language processing [35]. LSTM was first applied to the field of control in [36], where LSTM was used to deal with the nonlinear dynamics and long-term time dependence that exists in human motion. Then, a new self-evolving interval type-2 fuzzy LSTMNN was proposed with the help of FLS and LSTM structures in [37]. Advanced intelligent control schemes were derived to approximate and provide a valid way of approaching for nonlinear systems [38,39] In this paper, the LSTM mechanism was introduced into an FNN; hence, a novel fuzzy neural network (NFNN) with an LSTM structure was developed. Then, an adaptive sliding mode control method, using the NFNN, was derived for nonlinear systems. The main contributions of this work are discussed in the following: (1) Compared with existing work, this paper introduces the LSTM mechanism into the FNN and proposes a novel FNN sliding mode method. Using LSTM in this way could satisfactorily solve the issue of time dependence and vanishing gradients. There appears to be no need for parameter fine-tuning because an NFNN works for the learning rate and initial value of the weight. (2) Most systems have nonlinearity and unknown uncertainty, which bring many unforeseen problems to system control. In this study, an adaptive sliding mode method based on an NFNN was designed for a class of nonlinear systems. This method had the significant advantages of model-free control, with a wide range of applications, strong disturbance rejection ability, and good static and dynamic performance. (3) The robustness of the controller was the main performance index. In general, the faster and more accurate the estimation of the time-varying unknown uncertainty of the system, the better the robustness. The simulation studied the system performance in the presence of parameter changes of the APF circuit, and compared it with SMC and ASMC-RFNN, showing its stronger learning ability and robustness.

Problem Statement and Preliminaries
Consider a class of single-input single-output partially unknown nonlinear systems, which are shown by the differential equation in [10].
Then, considering parameter variances and disturbances, we can rewrite Equation (1) using state-space notation as follows: .
where δ = [0, 0, · · · , δ] T ∈ R n×1 is the lumped uncertainty of the nonlinear system, which is caused by internal parameter perturbation and external disturbance; Control Objective: A controller was designed to ensure that X accurately tracked the reference trajectory X m , so that the nonlinear system (4) was asymptotically stable, and all the signals were bounded.
To achieve the above objectives, a traditional sliding controller was designed for an n-order nonlinear system expressed by (4).
Denote a tracking error as: e, · · · , e (n−1) ] where X m is the n-order reference trajectory vector, and E is the n-order error vector. The derivative of Equation (5) is: A standard sliding surface is designed as: where C = [c 1 , c 2 , · · · , c n ] ∈ R 1×n is the parameter vector of the sliding surface.

Remark 1.
In this paper, a conventional linear sliding mode surface was selected. Its advantage was that it was simple and practical. As long as the selected sliding mode surface parameters satisfied the Hurwitz condition, the asymptotic stability of the system could be guaranteed. Although the terminal sliding mode surface and nonsingular sliding mode surface developed in the follow-up research improved asymptotic stability to finite-time stability, they generated some nonsingularitysolving problems; hence, the design and implementation were slightly difficult. In future research, the authors may employ some more advanced nonlinear sliding mode surfaces to reduce system chattering and achieve finite-time stabilization effects.
Letting . S = 0 to solve an equivalent control force u eq : e +c 2 e (2) + · · · + c n−1 e (n−1) ) Consequently, a new controller using a switching term is given as: where K a positive value, and sign(·) represents a sign function.

Remark 2.
The sign function brought a certain amount of system chattering, so sat (saturation) or tanh functions were used instead to improve smoothness and reduce chattering. In addition, dynamic sliding mode and super-twisting sliding mode methods could also weaken the effect of chattering well, which could be investigated in further research work.
A Lyapunov function is chosen as follows: Then, the derivative of V 1 is derived as Substituting (10) into (12) the following is obtained: where b(X) is a known function with a positive lower bound b l , and δ is a lumped uncertainty with upper bound δ b . When K ≥ δ b /c n b l , inequality (13) satisfies . V 1 ≤ 0. From Lyapunov theory, the system is asymptotically stable.

The Novel FNN Structure
The unknown f (X) needs to be used in the controller (10); therefore, in practical applications, the unknown f (X) needs to be estimated. A novel FNN with an LSTM structure was adopted to identify the f (X), as shown in Figures 1 and 2 Layer 1-Input Layer: For node i of the input layer, the node input and output were derived as:   Layer 2-Fuzzification Layer: The relationship in this layer is expressed as: were derived as: where superscript and subscript show the number of layer nodes respectively;   Layer 2-Fuzzification Layer: The relationship in this layer is expressed as: The basic rules and signal transmission of each layer of an NFNN are given in the following steps.
Layer 1-Input Layer: For node i of the input layer, the node input and output were derived as: where superscript and subscript show the number of layer nodes respectively; is a unity function of the i-th node, respectively, and N is the sampling iteration number.
Layer 2-Fuzzification Layer: The relationship in this layer is expressed as: Mathematics 2022, 10, 1197 6 of 23 where x 2 j (N) = y 1 i (N) is the input of the fuzzification layer, c 2 j is the mean value, b 2 j is the standard deviation, net 2 j (N) is the Gaussian function, f 2 j (·) is the negative exponential function, and y 2 j (N) is the output of the j-th node, respectively. Layer 3-LSTM Layer: The relationship of this layer is expressed as follows: where where ok are the weight and bias terms of the different LSTM parts, symbol • denotes dot product, tanh(z) and σ(z) show nonlinear activation functions, f 3 k (N) is the output of the forgetting gate, u 3 k (N) • a 3 k (N) is the output of the input gate, c 3 k (N) is the state value, y 3 k (N) is the output at the N-th iteration of the k-th node, and h 3 k (N) is the output of the output gate. Layer 4-Defuzzification Layer: The relationship of this layer is expressed as: where w 4 kl is the weight of the fourth layer's l-th node connected with the k-th input, net 4 l (N) is the network output, and y 4 l (N) is the output of the l-th node. Layer 5-Output Layer: The relationship of this layer is expressed as: where w 5 l is the weight related to the fifth layer output node and the l-th input, net 5 o (N) is the network output, and y 5 o (N) is the final output. The learning mechanism of the NFNN is summarized as follows: (1) The system error is transmitted as the input to the fuzzy layer by the input layer. (2) Then, each neuron of the fuzzy layer employs a Gaussian function to make the input fuzzified, and the output is then passed to the LSTM layer for information extraction and mining. (3) The input of the LSTM layer and the feedback output of the previous state join with the input information channel and pass through three gates of forgetting, input, and output in turn. (4) The output of the LSTM layer is then passed to the defuzzification layer, using the weighted average method. (5) Finally, a weighted summation is accomplished on the defuzzification result to obtain the final output. Figure 3 gives the block diagram of the designed ASMC-NFNN, which mainly includes three parts: reference signal, proposed controller, and dynamic system. In the controller module, the NFNN took the error information of the system as input, used the gradient descent method for optimization, and adaptively learnt in order to obtain the unknown uncertainty of the system; SMC as the main body of the controller, combined with the estimated value output by the NFNN and robust term, gave the final effective control law. In addition, the control object was a system that had unmodeled dynamics and was subject to internal parameter changes and external disturbances. The control goal was not to rely on an accurate system model to achieve the task of accurate control under different disturbances. The following introduces the design of the proposed NFNN and ASMC-NFNN controller.

Adaptive Sliding Mode Controller Design Using the NFNN and Stability Analysis
where 5 l w is the weight related to the fifth layer output node and the -l th input, The learning mechanism of the NFNN is summarized as follows: (1) The system error is transmitted as the input to the fuzzy layer by the input layer.
(2) Then, each neuron of the fuzzy layer employs a Gaussian function to make the input fuzzified, and the output is then passed to the LSTM layer for information extraction and mining. (3) The input of the LSTM layer and the feedback output of the previous state join with the input information channel and pass through three gates of forgetting, input, and output in turn. (4) The output of the LSTM layer is then passed to the defuzzification layer, using the weighted average method. (5) Finally, a weighted summation is accomplished on the defuzzification result to obtain the final output. Figure 3 gives the block diagram of the designed ASMC-NFNN, which mainly includes three parts: reference signal, proposed controller, and dynamic system. In the controller module, the NFNN took the error information of the system as input, used the gradient descent method for optimization, and adaptively learnt in order to obtain the unknown uncertainty of the system; SMC as the main body of the controller, combined with the estimated value output by the NFNN and robust term, gave the final effective control law. In addition, the control object was a system that had unmodeled dynamics and was subject to internal parameter changes and external disturbances. The control goal was not to rely on an accurate system model to achieve the task of accurate control under different disturbances. The following introduces the design of the proposed NFNN and ASMC-NFNN controller. Figure 3. Block diagram of the proposed control system. According to the universal approximation rule, there are optimal weights to use the output of the NFNN to estimate any smooth nonlinear function. Consequently, a NN is designed to identify the unknown terms of the system.

Adaptive Sliding Mode Controller Design Using the NFNN and Stability Analysis
Assume that optimal weights W * , . This five-layer NFNN is given in Figure 1, written as: where 3 * T , Φ * is the ideal output in the fourth layer with regards to the weights, W * is the ideal weight generated from online learning, and ε is a reconstruction error, ensuring |ε| ≤ ε b , ε b is a positive value.
Practically, the estimate of f (X) by the NFNN is written as: Then, the estimation error of f (X) function is derived as: where W T Φ + ε = ε 0 is the approximation error, W = W * −Ŵ, and Φ = Φ * −Φ. Then, the Taylor expansion of Φ is applied to convert the nonlinear NFNN into a partially linear form as follows: where O h is the higher-order term of the expansion and the partial terms, which can be calculated by the chain rule [36], are represented as: Then, from Equation (10), a practical controller is designed as follows: Theorem 1. Considering the nonlinear system (4), the proposed controller with the ASMC-NFNN strategy can be guaranteed to be asymptotically stable if the following conditions are satisfied: (1) The ASMC-NFNN controller is designed as in (41).

Remark 3.
Compared with the existing research, the proposed control strategy had a better control performance. First, compared to traditional sliding mode control, the ASMC-NFNN had the advantage of less chattering because, in the case of unknown system disturbances, traditional sliding mode control often relies on high-gain switching gain to achieve disturbance compensation.
Although this could bring a good steady-state performance, it could cause high-frequency output chattering, which could bring huge adverse effects to the system. On the contrary, the proposed method firstly relied on the learning and estimation ability of the neural network to realize the active compensation of the disturbance, thereby reducing the burden of the sliding mode on the disturbance, and reducing the system chattering while improving the performance. Second, the proposed strategy had better dynamic performance and robustness than other neural network-based sliding mode control strategies because it adopted a novel neural network with an LSTM structure. As mentioned above, in theory, it had a selective forgetting mechanism, avoided the problem of gradient disappearance, and had the advantages of a strong learning ability. Therefore, it could compensate for the unknown time-varying uncertainty of the system faster and more accurately, and, thus, had better dynamic performance. The subsequent simulation comparison results also showed that the proposed control strategy could cope with larger parameter changes and had better dynamic performance.
Proof. The following Lyapunov function is designed as: where V 2 is positive definite. The last 16 items in Equation (58) are denoted as M.
Remark 4. The designed Lyapunov function not only included the quadratic form of the systematic error, but also the quadratic form of the estimation error of the neural network weight, which not only ensured the convergence of the systematic error, but also ensured that the parameter error was small. In addition, because the learning rate of the weight was relatively large, the quadratic term of the system error had a larger proportional coefficient than the weight error, which meant that the convergence of the system error was guaranteed to a greater extent. In addition, compared with the traditional neural network method using gradient descent to optimize the error, this paper incorporated the quadratic form of the weight error into the design of the Lyapunov function, so that the adaptive rate of the neural network could be reversely derived through the stability proof. Although the form of the two was found to be similar after derivation, it was clear that the method proposed in this paper had more theoretical support, which was a unique contribution of this paper.

Simulation Study
To verify the effectiveness of the proposed ASMC-NFNN algorithm, a simulation experiment was performed using Matlab/Simulink with a single-phase active power filter (APF), as in Figure 4. In the simulation experiment, the computer system was 64-bit, the CPU was i7-6500 U (2.5 GHz), and the Matlab software version was 2019b. The shunt single-phase APF circuit model had three main components: grid voltage, nonlinear load, and APF main circuit. From circuit theory, the following equations are obtained: In this paper, the state equation for the compensation current was studied since a PID controller applied in the DC side voltage made it easy to obtain the voltage requirements. The compensation current is derived as However, under system uncertainties and disturbances, the state equation for the In fact, the APF controller included three parts: harmonic detection module, DC side voltage control module, and compensation current tracking control module. The control goal was to force the compensation current to follow the reference current quickly and accurately. On the one hand, the harmonic detection module was implemented by a singlephase fast harmonic detection algorithm, which could obtain the reference current in real time. On the other hand, the control of DC side voltage was realized by traditional PID control due to low control requirements and low control difficulty, and voltage stability was achieved by superimposing the output of the PID controller into the reference information. Therefore, the voltage on the DC side was stable and could be regarded as a constant.
From circuit theory, the following equations are obtained: where U s is a grid voltage, i c is a compensation current, U dc is a capacitor voltage in DC side, and L and R are inductance and resistance. respectively. u is defined as In this paper, the state equation for the compensation current was studied since a PID controller applied in the DC side voltage made it easy to obtain the voltage requirements. The compensation current is derived as However, under system uncertainties and disturbances, the state equation for the compensation current is further revised as where ∆R and ∆L are the uncertainties of R and L respectively, and g is the other uncertain component. Further, Equation (65) is rewritten as: .
where h 0 is the lumped uncertainty bounded by H 0 , as |h 0 | ≤ H 0 . Taking the derivative of Equation (66) one gets ..
Then, the second-order dynamic equation is obtained as: .
where x 1 represents i c ,B represents R/L 2 * U dc , which is a known constant, f (x) represents −R 2 /L 2 * i c − . U s /L + R/L 2 * U s , which is an unknown function whose exact value is difficult to obtain, h k represents −R/L * h + . h 0 , and h k is the lumped uncertainty, with an upper bound H k , as |h k | ≤ H k .
The parameters in the system simulation are explained in Table 1. The parameters of the PID controller and the ASMC-NFNN controller are given as In the NFNN, learning rates were η 1 , η 2 = 2.5 × 10 −3 , η 3 , η 4 , · · · , η 16 = 5, the initial values of the center and width in Gaussian function were selected as c 2 = [−0.075 0 0.075], b 2 = [1 1 1], and the initial weights were chosen to be 1, except for the initial weights

Steady−State Response
In the simulation, the harmonic compensation was set to be added in the APF system from 0.05 s. Figure 5 gives the steady-state response of the system under the proposed ASMC−NFNN. The waveform diagrams were load current, power supply current, compensation current tracking curve, and tracking error figure, in order. As can be seen from the load current curve in Figure 5, the load had serious nonlinear distortion and caused serious harmonic distortion in the power supply current. The degree of harmonic distortion could be seen from the spectrum ana in Figure 6. In addition to the fundamental wave, there were many harmonic total harmonic distortion (THD) rate reached 35.07%. However, after APF control at 0.05 s, the harmonics were suppressed in a short time. From Figure 7 was reduced to 2.3%. Therefore, APF using the ASMC−NFNN controller coul rify harmonic pollution. As shown in Figure 8, the compensation current cur reference current curve almost completely coincided after a short time, and th error was also nearly zero, which reflected the high accuracy of current tra response, and good harmonic compensation effect. The degree of harmonic distortion could be seen from the spectrum analysis chart in Figure 6. In addition to the fundamental wave, there were many harmonics, and the total harmonic distortion (THD) rate reached 35.07%. However, after APF started to control at 0.05 s, the harmonics were suppressed in a short time. From Figure 7, the THD was reduced to 2.3%. Therefore, APF using the ASMC−NFNN controller could well purify harmonic pollution. As shown in Figure 8, the compensation current curve and the reference current curve almost completely coincided after a short time, and the tracking error was also nearly zero, which reflected the high accuracy of current tracking, fast response, and good harmonic compensation effect.
control at 0.05 s, the harmonics were suppressed in a short time. From Figure 7, the THD was reduced to 2.3%. Therefore, APF using the ASMC−NFNN controller could well purify harmonic pollution. As shown in Figure 8, the compensation current curve and the reference current curve almost completely coincided after a short time, and the tracking error was also nearly zero, which reflected the high accuracy of current tracking, fast response, and good harmonic compensation effect.    Figures 9-12 give adaptive adjustment curves of some parameters of the NFNN, which did not need to be adjusted manually. After adaptive learning, convergence was achieved in a short time and the system response could also achieve good results. This showed that the NFNN had an excellent adaptive adjustment performance and stability.   Figures 9-12 give adaptive adjustment curves of some parameters of the NFNN, which did not need to be adjusted manually. After adaptive learning, convergence was achieved in a short time and the system response could also achieve good results. This showed that the NFNN had an excellent adaptive adjustment performance and stability.  Figures 9-12 give adaptive adjustment curves of some parameters of the NFNN, which did not need to be adjusted manually. After adaptive learning, convergence was achieved in a short time and the system response could also achieve good results. This showed that the NFNN had an excellent adaptive adjustment performance and stability.

Dynamic Response Simulation and Comparison
To verify the ability of APF to compensate for harmonics under sudden load changes using ASMC−NFNN, sudden load increase and decrease experiments were designed and the comparison simulation with ASMC−RFNN was given.
In the dynamic simulation, the APF was connected to the system at 0.05 s, and a nonlinear load was added at 0.3 s and subtracted at 0.6 s. In addition, the parameters of the increased load are given in Table 1. The dynamic response of the APF system was observed when the load changed. The dynamic response waveforms of the supply current using ASMC−NFNN is shown in Figure 13, which shows that no matter when the load was increased in 0.3 s or the load was decreased in 0.6 s, the power current returned to a sinusoidal steady state after a short adjustment, showing that the proposed controller worked well under load changes with good dynamic properties.

Dynamic Response Simulation and Comparison
To verify the ability of APF to compensate for harmonics under sudden load changes using ASMC−NFNN, sudden load increase and decrease experiments were designed and the comparison simulation with ASMC−RFNN was given.
In the dynamic simulation, the APF was connected to the system at 0.05 s, and a nonlinear load was added at 0.3 s and subtracted at 0.6 s. In addition, the parameters of the increased load are given in Table 1. The dynamic response of the APF system was observed when the load changed. The dynamic response waveforms of the supply current using ASMC−NFNN is shown in Figure 13, which shows that no matter when the load was increased in 0.3 s or the load was decreased in 0.6 s, the power current returned to a sinusoidal steady state after a short adjustment, showing that the proposed controller worked well under load changes with good dynamic properties.

Dynamic Response Simulation and Comparison
To verify the ability of APF to compensate for harmonics under sudden load changes using ASMC−NFNN, sudden load increase and decrease experiments were designed and the comparison simulation with ASMC−RFNN was given.
In the dynamic simulation, the APF was connected to the system at 0.05 s, and a nonlinear load was added at 0.3 s and subtracted at 0.6 s. In addition, the parameters of the increased load are given in Table 1. The dynamic response of the APF system was observed when the load changed. The dynamic response waveforms of the supply current using ASMC−NFNN is shown in Figure 13, which shows that no matter when the load was increased in 0.3 s or the load was decreased in 0.6 s, the power current returned to a sinusoidal steady state after a short adjustment, showing that the proposed controller worked well under load changes with good dynamic properties. Moreover, the voltage control curve on the DC side is shown in Figure 14, verifying the previous assumption that the DC side voltage was stable. Moreover, Figure 15 shows the current tracking curves under the two methods. In both methods, the compensation current could track the reference current when the load changed. Moreover, it was roughly seen that the tracking curve of the comparison method was over-tracked and covered other curves, so its tracking compensation performance was worse. Moreover, the voltage control curve on the DC side is shown in Figure 14, verifying the previous assumption that the DC side voltage was stable. Moreover, the voltage control curve on the DC side is shown in Figure 14, verifying the previous assumption that the DC side voltage was stable. Moreover, Figure 15 shows the current tracking curves under the two methods. In both methods, the compensation current could track the reference current when the load changed. Moreover, it was roughly seen that the tracking curve of the comparison method was over-tracked and covered other curves, so its tracking compensation performance was worse. Moreover, Figure 15 shows the current tracking curves under the two methods. In both methods, the compensation current could track the reference current when the load changed. Moreover, it was roughly seen that the tracking curve of the comparison method was over-tracked and covered other curves, so its tracking compensation performance was worse. Mathematics 2022, 10, x FOR PEER REVIEW 19 of 24 In order to see a more obvious comparison, the overall tracking error comparison curves are given in Figure 16, and the partial enlarged comparison curves at the load change point are given in Figure 17. It was clearly seen from Figure 17 that the error of the proposed method (red curve) at the two load change nodes was closer to 0 than the comparison method (blue curve). Therefore, the proposed controller with NFNN had better dynamic performance than the RFNN.  In order to see a more obvious comparison, the overall tracking error comparison curves are given in Figure 16, and the partial enlarged comparison curves at the load change point are given in Figure 17. It was clearly seen from Figure 17 that the error of the proposed method (red curve) at the two load change nodes was closer to 0 than the comparison method (blue curve). Therefore, the proposed controller with NFNN had better dynamic performance than the RFNN. In order to see a more obvious comparison, the overall tracking error comparison curves are given in Figure 16, and the partial enlarged comparison curves at the load change point are given in Figure 17. It was clearly seen from Figure 17 that the error of the proposed method (red curve) at the two load change nodes was closer to 0 than the comparison method (blue curve). Therefore, the proposed controller with NFNN had better dynamic performance than the RFNN.  Several performance indicators were used to analyze the proposed NFNN-based controller and the comparative RFNN−based controller. The performance comparison results of THD are shown in Table 2. In three experimental states, the ASMC-NFNN had a smaller THD than the ASMC−RFNN. In addition, compared with the dynamic terminal sliding mode controller using a double hidden layer recurrent neural network (DTSMC−DHLRNN) proposed in Ref. [40], the THD performance of ASMC−NFNN in steady state was 0.66% better. In addition, the comparison results of some commonly used performance indicators are given in Table 3, showing the proposed controller was superior to the comparison method in various error performance indicators. However, in the indicator of simulation calculation time, because the proposed method had a more complicated structure, the calculation time was slightly longer than the comparison method. In fact, the update complexity per weight and time step of the LSTM algorithm was, essentially, that of BPTT, namely O(1), and LSTM was local in both space and time [36]. Therefore, the extra complexity introduced by LSTM was not high and, fortunately, with the upgrade in computing power, the subtle difference in computing time was no longer a serious problem.

Parameter Variations Simulation and Comparison
Practically, it was not easy to obtain accurate parameters of the controlled object, especially in the power system occasions, as the component parameters would also dynamically change. For example, the aging of the resistance made the resistance value Several performance indicators were used to analyze the proposed NFNN-based controller and the comparative RFNN−based controller. The performance comparison results of THD are shown in Table 2. In three experimental states, the ASMC-NFNN had a smaller THD than the ASMC−RFNN. In addition, compared with the dynamic terminal sliding mode controller using a double hidden layer recurrent neural network (DTSMC−DHLRNN) proposed in Ref. [40], the THD performance of ASMC−NFNN in steady state was 0.66% better. In addition, the comparison results of some commonly used performance indicators are given in Table 3, showing the proposed controller was superior to the comparison method in various error performance indicators. However, in the indicator of simulation calculation time, because the proposed method had a more complicated structure, the calculation time was slightly longer than the comparison method. In fact, the update complexity per weight and time step of the LSTM algorithm was, essentially, that of BPTT, namely O(1), and LSTM was local in both space and time [36]. Therefore, the extra complexity introduced by LSTM was not high and, fortunately, with the upgrade in computing power, the subtle difference in computing time was no longer a serious problem.

Parameter Variations Simulation and Comparison
Practically, it was not easy to obtain accurate parameters of the controlled object, especially in the power system occasions, as the component parameters would also dynamically change. For example, the aging of the resistance made the resistance value larger, and the inductance would change subject to environmental factors, such as temperature and magnetic field. The changes in the internal parameters of these systems were called internal disturbances, which would make the performance of general controllers worse and even difficult to use in practice. Therefore, this section studies the robustness of the proposed controller under parameter changes and compares it with the other two methods. The selected variable parameters were the resistance and inductance values on the APF main circuit. Figure 18 shows the change curve using ASMC−NFNN of the steady−state THD value with different degrees of inductance attenuation. When the inductance attenuation percentage was small, the THD hardly changed. When the inductance attenuation degree gradually became larger, the value and the change range of THD also increased continuously. This showed that the inductance parameter had a great influence on the system performance. However, it could be seen from the figure that even if the inductance was attenuated by 40%, the THD of the power supply current was still below 5% under the proposed method, which could still meet the application requirements. Therefore, the proposed method had a large tolerance space for inductance parameters, and had good robustness in terms of inductance parameter changes. larger, and the inductance would change subject to environmental factors, such as temperature and magnetic field. The changes in the internal parameters of these systems were called internal disturbances, which would make the performance of general controllers worse and even difficult to use in practice. Therefore, this section studies the robustness of the proposed controller under parameter changes and compares it with the other two methods. The selected variable parameters were the resistance and inductance values on the APF main circuit. Figure 18 shows the change curve using ASMC−NFNN of the steady−state THD value with different degrees of inductance attenuation. When the inductance attenuation percentage was small, the THD hardly changed. When the inductance attenuation degree gradually became larger, the value and the change range of THD also increased continuously. This showed that the inductance parameter had a great influence on the system performance. However, it could be seen from the figure that even if the inductance was attenuated by 40%, the THD of the power supply current was still below 5% under the proposed method, which could still meet the application requirements. Therefore, the proposed method had a large tolerance space for inductance parameters, and had good robustness in terms of inductance parameter changes. In addition, the steady−state THD comparison chart of the three methods under inductance attenuation is given in Figure 19, showing that the proposed strategy had the smallest THD variation and the best parameter tolerance. The method based on ASMC−RFNN had a small THD change when the inductance attenuation was small; when the inductance attenuation was greater than 5%, the THD increased sharply; after the inductance attenuation was 30%, the THD even exceeded the ordinary sliding mode controller. The above shows that when the inductance attenuation was greater than 30%, the RFNN network of the ASMC-RFNN method fell into disorder and failed to learn the system parameters correctly. At the same time, it proved that the NFNN had a better learning ability and adaptability than the RFNN. On the other hand, when the inductance parameters were not particularly large, the proposed algorithm with the NN had greater tolerance to inductance parameters and a smaller THD change trend than ordinary sliding mode controllers, showing the advantage of good robustness. In addition, the steady−state THD comparison chart of the three methods under inductance attenuation is given in Figure 19, showing that the proposed strategy had the smallest THD variation and the best parameter tolerance. The method based on ASMC−RFNN had a small THD change when the inductance attenuation was small; when the inductance attenuation was greater than 5%, the THD increased sharply; after the inductance attenuation was 30%, the THD even exceeded the ordinary sliding mode controller. The above shows that when the inductance attenuation was greater than 30%, the RFNN network of the ASMC-RFNN method fell into disorder and failed to learn the system parameters correctly. At the same time, it proved that the NFNN had a better learning ability and adaptability than the RFNN. On the other hand, when the inductance parameters were not particularly large, the proposed algorithm with the NN had greater tolerance to inductance parameters and a smaller THD change trend than ordinary sliding mode controllers, showing the advantage of good robustness. At the same time, the simulation comparison chart of resistance variation is given in Figure 20, showing the change in the resistance had a very small effect on the system performance. The SMC−based method could tolerate an increase of 3.4 times in resistance, while the proposed ASMC−NFNN could tolerate an increase of 3.6 times in resistance. In general, changes in resistance parameters had a limited impact on the system, and ASMC−NFNN methods had better performances, to some extent.

Conclusions
In this paper, an ASMC-NFNN strategy was studied for a general class of dynamic systems with unknown uncertainties. Considering the existence of time-varying unknown uncertainty perturbations in such systems, an NFNN with an LSTM structure was developed to approximate the system uncertainty where the LSTM structure had a special gating unit that could selectively forget and remember, which was suitable for long-term dependent learning problems. In addition, a sliding mode controller was given to implement the tracking control of nonlinear systems, ensuring high tracking accuracy and fast response speed under estimation error and external disturbances. An NFNN online learning algorithm was derived and all the parameters of the NFNN were guaranteed to converge under the adaptive laws. The proposed control strategy were verified on the second-order single-phase APF system, and the numerical experimental results showed that it had better steady-state and dynamic properties than other control At the same time, the simulation comparison chart of resistance variation is given in Figure 20, showing the change in the resistance had a very small effect on the system performance. The SMC−based method could tolerate an increase of 3.4 times in resistance, while the proposed ASMC−NFNN could tolerate an increase of 3.6 times in resistance. In general, changes in resistance parameters had a limited impact on the system, and ASMC−NFNN methods had better performances, to some extent. At the same time, the simulation comparison chart of resistance variation is given in Figure 20, showing the change in the resistance had a very small effect on the system performance. The SMC−based method could tolerate an increase of 3.4 times in resistance, while the proposed ASMC−NFNN could tolerate an increase of 3.6 times in resistance. In general, changes in resistance parameters had a limited impact on the system, and ASMC−NFNN methods had better performances, to some extent.

Conclusions
In this paper, an ASMC-NFNN strategy was studied for a general class of dynamic systems with unknown uncertainties. Considering the existence of time-varying unknown uncertainty perturbations in such systems, an NFNN with an LSTM structure was developed to approximate the system uncertainty where the LSTM structure had a special gating unit that could selectively forget and remember, which was suitable for long-term dependent learning problems. In addition, a sliding mode controller was given to implement the tracking control of nonlinear systems, ensuring high tracking accuracy and fast response speed under estimation error and external disturbances. An NFNN online learning algorithm was derived and all the parameters of the NFNN were guaranteed to converge under the adaptive laws. The proposed control strategy were verified on the second-order single-phase APF system, and the numerical experimental results showed that it had better steady-state and dynamic properties than other control

Conclusions
In this paper, an ASMC-NFNN strategy was studied for a general class of dynamic systems with unknown uncertainties. Considering the existence of time-varying unknown uncertainty perturbations in such systems, an NFNN with an LSTM structure was developed to approximate the system uncertainty where the LSTM structure had a special gating unit that could selectively forget and remember, which was suitable for long-term dependent learning problems. In addition, a sliding mode controller was given to implement the tracking control of nonlinear systems, ensuring high tracking accuracy and fast response speed under estimation error and external disturbances. An NFNN online learning algorithm was derived and all the parameters of the NFNN were guaranteed to converge under the adaptive laws. The proposed control strategy were verified on the second-order single-phase APF system, and the numerical experimental results showed that it had better steady-state and dynamic properties than other control methods, and also had better robustness in the presence of parameter changes. Considering that the control strategy was universally designed, and the algorithm integrating neural network and sliding mode were very suitable for power electronic control, the strategy could be extended to the control of a series of similar electronic power systems, and could achieve superior results. In future research, reducing the computational complexity of neural networks and the difficulty of parameter adjustment will be a hot research direction. In addition, the use of more advanced adaptive super-twisting sliding modes is also expected to be a promising research direction.