Next Article in Journal
A Dynamic Spatiotemporal Deep Learning Solution for Cloud–Edge Collaborative Industrial Control System Distributed Denial of Service Attack Detection
Previous Article in Journal
Event-Triggered Adaptive Backstepping Control of Underactuated AUVs with Input Saturation
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Fuzzy PDC-Based LQR Sliding Neural Network Control for Two-Wheeled Self-Balancing Cart

Department of Electronic Engineering, Ming-Chuan University, Guei-Shan District, Taoyuan City 333, Taiwan
Electronics 2025, 14(9), 1842; https://doi.org/10.3390/electronics14091842
Submission received: 10 April 2025 / Revised: 24 April 2025 / Accepted: 29 April 2025 / Published: 30 April 2025
(This article belongs to the Special Issue Advances in Intelligent Control Systems)

Abstract

:
This paper proposes a fuzzy PDC (parallel distributed compensation)-based LQR (Linear Quadratic Regulator) sliding neural network methodology to control a two-wheeled self-balancing cart. Firstly, a mathematical model of a two-wheeled self-balancing cart is described to explain some parameter meanings. Then, we detail how a simulation was implemented according to these reasonable parameter settings under the fuzzy PDC-based LQR sliding neural network control algorithm. Secondly, the algorithm is developed by setting four controllable LQR controllers. Then, a ReLU-based neural network (ReNN) is developed to tune the fuzzy degrees for these four LQR controllers. This means that an intelligent controller is designed by using the fuzzy PDC concept. Subsequently, a sliding surface is designed, and the sliding mode is utilized to compensate and enhance its stability. Simulation was conducted to verify the feasibility of this proposed algorithm. The simulation results demonstrate good effectiveness and stability. Finally, a cart equipped with an STM32 MCU (microcontroller unit) was implemented to verify the feasibility of this proposed algorithm. The empirical experimental results show that the two-wheeled self-balancing cart exhibited good self-balancing performance and stability.

1. Introduction

Fuzzy parallel distributed compensation (fuzzy PDC) was proposed many years ago, and it has become a critical, effective, and vibrant research method for some nonlinear systems [1,2,3,4]. Based on these reasons, a series of studies on the development of fuzzy PDC have been greatly promoted. In [1], a design method for a fuzzy controller based on the Takagi–Sugeno (T-S) fuzzy model was proposed. It is a document with an important theoretical basis in the development of fuzzy PDC. This design principle of fuzzy PDC was explained in detail, including how to use the parallel compensation method to design a fuzzy controller based on the T-S fuzzy model to cope with nonlinear systems. In [2], the fuzzy PDC method was used to control a robot and simulation was performed to obtain good verifications of the system, which proved the excellence of fuzzy PDC; meanwhile, the results could meet the requirements of the system. In [3], the authors proposed a particle swarm optimization (PSO) algorithm combined with the fuzzy PDC method to design robust and stable quadratic optimal fuzzy controllers to improve the stability and performance of the control system. In [4], a fuzzy TS-PDC controller was proposed to cope with power systems. It can reduce the number of fuzzy rules to simplify the complex fuzzy rule base. In summary, fuzzy PDC has resulted in both theoretical improvement and practical application progress. The continuous research results on fuzzy PDC and the relevant theoretical papers have made fuzzy PDC become an increasingly promising control technology in the control theory area.
The LQR (Linear Quadratic Regulator) control methodology has been used for a long time, and it has very excellent performance for linear systems [5]. But when we focus on uncertain nonlinear systems, some research has been proposed which has only used sliding mode neural networks to tune some important parameters to, for example, generate different control forces and then to achieve good performances. Sliding mode control [6,7,8,9] is used to generate a sliding surface and then to make the system trajectories bounded in the stable region cope with some parameter uncertainties and external disturbances. Neural networks [10,11,12,13] have abilities to tune different weightings of neurons to, for example, achieve good performance. When sliding mode and neural networks are integrated into sliding mode neural networks, they can be used to control some applications such as robotics, two-wheeled self-balancing carts, etc. [14,15,16,17].
The nonlinear model predictive control (NMPC) approach has demonstrated significant efficacy in trajectory control for robots, robotic arms, and remote operation systems [18,19,20]. By integrating receding horizon optimization with system dynamics, NMPC enables the precise tracking of complex motion profiles while handling constraints in diverse applications. However, despite its strengths in model-driven scenarios, NMPC often faces challenges in real-time implementation on low-cost embedded hardware—such as microcontroller units (MCUs)—due to its high computational demand and reliance on accurate system modeling. In contrast, the proposed method addresses these critical limitations by prioritizing real-time performance, hardware compatibility, and robustness to model uncertainties for self-balancing cart systems. Unlike NMPC’s iterative optimization, our approach combines pre-computed LQR gains with adaptive neural network tuning and sliding mode control, reducing computational latency to within microcontroller capabilities. This hybrid architecture ensures stable operation under un-modeled dynamics (e.g., wheel friction variations or external disturbances) without requiring online model updates.
The advantages of this framework were empirically validated through both numerical simulations and physical experiments (see Section 6). Results show that the proposed method achieved smaller control cycles on an STM32 MCU, outperforming NMPC in comparable low-power setups. These findings highlight its practical suitability for real-world robotics and automation applications where cost, latency, and resilience are paramount.
The contribution of this paper is calculating the LQR gain value, K, under different states and then assigning K to form a fuzzy PDC control algorithm based on the adjustment parameters calculated by the sliding mode neural network under different states to stabilize the system and obtain good performance.

2. Two-Wheeled Self-Balancing Cart Mathematical Model

The mathematical model of the two-wheeled self-balancing cart is used to understand the wheel model, as shown in Figure 1. The mathematical model of forward motion around the center of mass, p, of the cart can be expressed as follows [21,22]:
x ¨ = M 2 l 2 g Q e q θ P + J P + M l 2 + M l r Q e q r ( T R + T L ) θ ¨ P = M l ( M + 2 m + 2 I / r 2 ) g Q e q θ P M l / r + M + 2 m + 2 I / r 2 Q e q ( T R + T L )
where Q e q is defined as
Q e q = J P M + ( J P + M l 2 ) ( 2 m + 2 I / r 2 )
The parameters of model are defined as follows:
  • x : the horizontal displacement of the center, O, of the chassis of the cart;
  • M : the mass of the vehicle body (kg);
  • l : the distance from center of mass to center of chassis (m);
  • J P : the moment of inertia of the vehicle body when rotating around the center of mass ( kg m 2 );
  • θ P : the angle between the vehicle body and the vertical direction (rad);
  • m : the wheel mass (kg);
  • r : the radius of the wheel (m);
  • T R : the output torque of the right wheel motor ( N m );
  • T L : the output torque of the left wheel motor ( N m );
  • I : the moment of inertia of the wheel ( kg m 2 );
  • g : the gravity acceleration magnitude (9.8 m / s 2 ).
From (1) and (2), the state space expression can be obtained as follows:
x ˙ = Ax + Bu y = Cx + Du
where
A = 0 1 0 0 0 0 A 23 0 0 0 0 1 0 0 A 43 0 ;   B = 0 0 B 21 B 22 0 0 B 41 B 42 ;   C = 1 0 0 0 0 0 1 0 ;   D = d 11 d 12 d 21 d 22 ;   x = x x ˙ θ P θ ˙ P ;   u = u 1 u 2 ;   y = x θ P

3. LQR Controller Design

From Equations (1)–(4), based on the introduced mathematical model, this section discusses how to use the LQR control method to stabilize the system initially and then ensure that our proposed control law can guarantee the foundation of stability when facing nonlinear systems. Consider a controller which is represented as u = Kx , where K R 2 × 4 is the LQR controller gain matrix. After substituting u into (3), the following equation can be obtained:
x ˙ = A x B Kx = ( A B K ) x
where x = x x ˙ θ P θ ˙ P T , where x is the position, x ˙ is the velocity, θ P is the angle, and the θ ˙ P is the angular velocity. u is the output torque, but in practice, it needs to be converted into the motor’s PWM output. The objective is to design a state feedback matrix, K , to keep the angle of the two-wheeled self-balancing cart vertical, and the displacement will return to the original point. So, we utilize the LQR derivation method to design K , which will be introduced below; this implies that the control error should be zero. Based on the LQR theory [5], the cost function J is defined as follows. The control purpose is to design the Q and R matrices so as to minimize J :
J = [ x T Qx + u T Ru ] d t
where Q and R are weighting matrices for the states and control forces, respectively. The diagonal elements q i in Q represent the importance attached to the corresponding error component x i ; if we want the convergence to be faster, then a larger weight coefficient will be set. Similarly, the diagonal elements r i in R represent restrictions on the corresponding input components u i ; in general case, the weight coefficient should be set to smaller value to avoid making the system unstable and uncontrollable.
In order to achieve an optimal K , the cost function J should be minimized. Based on the optimal control theory [6,23], the optimal solution can be obtained by the means of algebraic methods or differential methods. A common approach is to solve the Riccati equation [20]. We can solve the following Riccati equation:
A T P + PA PBR 1 B T P + Q = 0
where P is a symmetric and positive definite state feedback gain matrix of a square dimension of 4. If the positive definite matrix P exists, then the optimal controller gain matrix K can be obtained as follows [5,17]:
K L Q R = R 1 B T P
Finally, the LQR controller can be expressed as
u L Q R = K L Q R x

4. Fuzzy PDC-Based Sliding Neural Network Design

In order to cope with the uncertainty and nonlinear characteristics of the system, the sliding mode control method and a neural network are needed for tuning some parameters of fuzzy PDC. The overall design concept diagram is proposed in Figure 2.

4.1. Sliding Controller Design

Sliding control [6,7,8,9] is designed by using a pair of suitable defined sliding surfaces as
s 1 = x ˙ + λ 1 x
s 2 = θ ˙ P + λ 2 θ P
where λ 1 and λ 2 are positive constants. The time derivatives of (10) and (11) are obtained as
s ˙ 1 = x ¨ + λ 1 x ˙
s ˙ 2 = θ ¨ P + λ 2 θ ˙ P
From (1)–(4), (12) and (13), the simplified nonlinear model can be derived as
s ˙ 1 = A 23 θ P + ( B 21 u 1 + B 22 u 2 ) + λ 1 x ˙
s ˙ 2 = A 43 θ P + ( B 41 u 1 + B 42 u 2 ) + λ 2 θ ˙ P
There is an error between the reasonable values of u 1 and u 2 . We can make the following mathematical expression.
u 1 = u 2 + Δ u 2
Substituting (16) into (14) and (15) yields the following mathematical expression:
s ˙ 1 = A 23 θ P + ( B 21 + B 22 ) u 1 B 22 Δ u 2 + λ 1 x ˙
s ˙ 2 = A 43 θ P + ( B 41 + B 42 ) u 2 + B 41 Δ u 2 + λ 2 θ ˙ P
By using the sliding mode theorem [6], we assume that Δ u 2 = 0 ; then, the sliding mode conditions should be s ˙ 1 = 0 and s ˙ 2 = 0 [6,7,8,9]. An equivalent control law can be obtained as
u e q 1 = A 23 θ P λ 1 x ˙ B 21 + B 22
u e q 2 = A 43 θ P λ 2 θ ˙ P B 41 + B 42
According to the sliding mode control theorem, switching control terms should be added to (19) and (20) to satisfy the Lyapunov stability condition [24]. u 1 and u 2 are designed as the following control law.
u 1 = u e q 1 + u s m 1
u 2 = u e q 2 + u s m 2
From (10)–(13), the Lyapunov function is defined as
V ( s 1 , s 2 ) = 1 2 s 1 2 + 1 2 s 2 2
From (14)–(22), according to the Lyapunov stability theorem, the derivation process is the following:
V ˙ = s 1 s ˙ 1 + s 2 s ˙ 2 = s 1 [ A 23 θ P + ( B 21 + B 22 ) u 1 B 22 Δ u 2 + λ 1 x ˙ ] + s 2 [ A 43 θ P + ( B 41 + B 42 ) u 2 + B 41 Δ u 2 + λ 2 θ ˙ P ]                 = s 1 [ A 23 θ P + ( B 21 + B 22 ) ( u e q 1 + u s m 1 ) B 22 Δ u 2 + λ 1 x ˙ ] + s 2 [ A 43 θ P + ( B 41 + B 42 ) ( u e q 2 + u s m 2 )                 + B 41 Δ u 2 + λ 2 θ ˙ P ]       = s 1 [ ( B 21 + B 22 ) ( u s m 1 ) B 22 Δ u 2 ] + s 2 [ ( B 41 + B 42 ) ( u s m 2 ) + B 41 Δ u 2 ]
Now, we set u s m 1 and u s m 2 as follows:
u s m 1 = ε 1 sgn ( s 1 ) B 21 + B 22
u s m 2 = ε 2 sgn ( s 2 ) B 41 + B 42
where sgn ( ) denotes a sign function with a boundary of 0.5 to mitigate the chattering effect, and ε 1 and ε 2 are positive bound numbers. In (24), we consider B 22 Δ u 2 and B 41 Δ u 2 very small bounded quantities. They represent uncertainty, nonlinearities, and disturbances. We assume that they have small bounded relationships, ε 1 B 22 Δ u 2 and ε 2 B 41 Δ u 2 , with s 1 and s 2 , respectively, so (24) can be derived as the following equation.
        V ˙ = s 1 [ ε 1 sgn ( s 1 ) B 22 Δ u 2 ] + s 2 [ ε 2 sgn ( s 2 ) + B 41 Δ u 2 ]         = [ ε 1 s 1 B 22 Δ u 2 s 1 ] + [ ε 2 s 2 + B 41 Δ u 2 s 2 ] [ ε 1 + B 22 Δ u 2 ] s 1 [ ε 2 B 41 Δ u 2 ] s 2 0
Through the above Equation (27), the stability and robustness of the system are proven and guaranteed simultaneously.

4.2. Fuzzy PDC-Based LQR Controller Design

According to the equivalent control u e q 1 and u e q 2 of the sliding mode proposed in the previous section, its control value will encounter a lot of interference in physical implementation. Therefore, we design a neural network in the following section to propose a method which can monitor and determine the weight for choosing between the LQR controllers. That is, the weights of each LQR controller must be calculated by the neural network discussed later. Here, the fuzzy PDC method is introduced to deduce every degree of the four LQRs.
The concept of fuzzy PDC is the following [1,2,3,4]:
R u l e       i :       I F       x ( t )       i s       μ i 1             a n d       θ P ( t )       i s       μ i n             T H E N             x ˙ ( t ) = A i x ( t ) + B i u ( t )
where A i are system matrices and B i are input matrices; i = 1,2,3,4; there are four IF–THEN fuzzy rules in this paper; and μ i j are the fuzzy singleton. Then, the fuzzy PDC output rules can be established.
R u l e       j :       I F       x ( t )       i s       μ j 1             a n d       θ P ( t )       i s       μ j n             T H E N             u j ( t ) = K j x ( t )
for j = 1 , 2 , 3 , 4 , where K j R 2 × 4 are state feedback matrix gains of LQR.
Through different state simulations, we assign different fuzzy degree to two states, x and θ P , and we denote them as μ i where i = 1 , 2 , 3 , 4 . Then, through defuzzification, we obtain the final degree value as follows.
u F u z z y P D C L Q R = μ 1 K L Q R 1 + μ 2 K L Q R 2 + μ 3 K L Q R 3 + μ 4 K L Q R 4 μ 1 + μ 2 + μ 3 + μ 4
The ReNN (discussed in Section 4.3 and Section 5) dynamically adjusts the fuzziness values of the LQR controller.

4.3. Neural Network Controller Design

The ReLU (Rectified Linear Unit) in neural networks has several notable features [25,26,27,28]. It has simple and efficient computation ability. Its activation function is very simple; that is, f ( x ) = max ( 0 , x ) . During forward propagation, it only needs to determine whether the input is greater than zero or not, which reduces the computational load and can speed up the training process. Meanwhile, it helps alleviate the vanishing gradient problem. When the input is greater than zero, the derivative of the ReLU is 1, enabling the gradient to be effectively propagated back to previous layers. Finally, for a large number of negative inputs, the output of the neuron is zero. Only a portion of neurons are activated; this reduces the interdependence between neurons, mitigating the over-fitting risk. Figure 3 depicts a three-layer neural network (ReNN). It consists of an input layer, a hidden layer, and a output layer. The energy function is minimized using the slope to obtain the optimal weights of the ReNN. The following introduces the meaning and basic functions of each layer of the ReNN:
(a)
Input Layer: Each node within this layer is related to the net input and net output values, which are, respectively, denoted as x i and y i , j .
n e t i = x i
y i , j = f i , j ( n e t i ) = n e t i ,   i = 1 , 2 , 3 , , m ,   and   j = 1 , 2 , 3 , , m
Here, x i stands for the i-th input to the node of Layer 1, and m represents the number of input variables. All the link weights in this layer are assigned a value of 1.
(b)
Hidden Layer: Each node in this layer performs activation using the ReLU function, which is defined as Re L u ( x ) = max ( 0 , x ) [22,23,24,25,26,27,28]. The derivative of the ReLU is 1 when the input number is greater than zero; otherwise, it is equal to 0. The ReLU will be used as the activation function for the j-th node of the i-th input.
n e t i j = max ( 0 , y i , j )
The number of neurons in this layer determines the number of neurons that are triggered. The larger the number of neurons is, the more important the rule is. Therefore, it will affect the output weights of the four LQR controllers in fuzzy PDC. The triggered node (denoted by ) plays a key role at this time because it multiplies the input signal and produces an output specific to the j-th rule node. The expression is defined by the following equation:
y j k = Π i j n e t i j ,   i = j = 1 , 2 , 3 , 4
(c)
Output Layer: It consists of two nodes, one for LQR and the other for the sliding mode controller, which is responsible for performing the key operation of calculating the percentage of the two controllers. Among these nodes, we have a specific node labeled Σ , which learns and memorizes the optimal percentage output by monitoring all input system states signals. This summation process is represented by the following equation:
n e t k = j w j k y j k
u k = f k n e t k = n e t k ,   k = 1 , 2 , 3 , 4
A more elaborate description of the components involved in this calculation can be further provided as follows.
  • w j k : The link weight denoting the strength of the output action corresponding to the output of the j-th column in relation to the k-th rule.
  • y j k : The j-th input to the node of layer.
  • m : The total number of output nodes.
  • u k : The k-th column output of the ReNN controller.
Based on the gradient theory [10,11,12,13], we utilize a single neuron to derive the equations within the neural network. To tune the weights of the ReNN, the energy function and the cost function are defined as follows so as to carry out the gradient operation:
E ( u , w ) = 1 2 ( u * u ) 2
The gradient calculus of E with respect to w can be obtained as follows:
Δ w j = η E w j = η ( E u u w j ) = ( u * u ) y k
where η is learning rate. Likewise, the update law for the activation layer can be derived as
Δ w i = η Σ i E w i = η ( E y j y j w j ) = y j j w j ( u u ) y j
After the calculation by the ReNN, the output weights w i , i = 1 , 2 , 3 , 4 correspond to 4 fuzzy degrees of fuzzy PDC in (30) which are μ i , i = 1 , 2 , 3 , 4 for x ; in the same way, the output weights of w j , j = 1 , 2 , 3 , 4 correspond to 4 fuzzy degrees of fuzzy PDC which are μ j , j = 1 , 2 , 3 , 4 for θ P , respectively.
From (25), (26) and (30), the total control laws are designed as follows:
u 1 = u F u z z y P D C L Q R 1 + u s m 1
u 2 = u F u z z y P D C L Q R 2 + u s m 2

5. Simulation Results

According to the mathematical models of Equations (1) and (2), the simulation parameters of the two-wheeled self-balancing cart model were set as follows: m = 0.035 ; r = 0.0672 / 2 ; I = 0.5 m r 2 ; M = 0.757 2 m ; and l = 0.5 0.0903 . By using Matlab R14 software [29,30], after the Q and R matrices were set, four LQR gain matrices K could then be obtained as follows.
Q 1 = 2000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2000 ; R 1 = 2 0 0 2 ; K 1 = 22.36 36.44 276 27.93 22.36 36.44 276 27.93
Q 2 = 4000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4000 ; R 2 = 3 0 0 3 ; K 2 = 25.82 40.07 283.41 31.23 25.82 40.07 283.41 31.23
Q 3 = 3000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3000 ; R 3 = 4 0 0 4 ; K 3 = 19.36 33.25 270 25.15 19.36 33.25 270 25.15
Q 4 = 20000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 20000 ; R 4 = 5 0 0 5 ; K 4 = 44.72 59.91 331.06 50.2 44.72 59.91 331.06 50.2
Based on the four K values calculated above in (42)–(45), a simulation comparison was performed based on the control laws (30), (40) and (41). The results are shown in Figure 4 and Figure 5. Figure 6 is shown as the control force for the small cart. As shown in the results, the design method of the fuzzy PDC-based LQR ReNN sliding control proposed outperforms the traditional LQR method in terms of effectiveness. While the algorithm integrates multiple control techniques (fuzzy PDC, LQR, sliding mode, and neural network), its hybrid architecture and application to two-wheeled self-balancing carts represent a non-trivial innovation with distinct advantages over my prior work.
The ReNN was trained on 2 million synthetic samples generated from 10,000 simulation trials with diverse initial states. Each sample comprised state variables and corresponding optimal fuzzy PDC weights obtained from LQR simulations. As shown in Figure 7, the training and validation MSE curves are illustrated. The training MSE converged to 0.023, with a validation MSE of 0.028, highlighting strong generalization capability. To alleviate overfitting, early stopping was implemented, which effectively maintained a small gap between training and validation errors. Figure 8 and Figure 9 depict the weight changes during the training process. Figure 8 corresponds to the weight dynamics for x , while Figure 9 shows those for θ P . From the dynamic trajectory changes in these figures, it is evident that the ReNN could indeed dynamically adjust the fuzziness values of the LQR controller.

6. Experiment Results

The hardware used in the experiment included a two-wheeled self-balancing cart produced by Wheeltech Inc. (Dongguan, China) [22]. The main board photo is shown in Figure 10. An image taken after connecting the main board to other components such as wheels, the drive board, etc., is shown in Figure 11. The cart consisted of two wheels, a main board, a sensor board, an OLED display panel, a Bluetooth board, a battery, and a motor drive board. The algorithm proposed in this paper could be verified using the two-wheeled self-balancing cart. The block diagram of the implemented cart is introduced in Figure 12. The main board was mainly manufactured with an STM32 series MCU chip (Geneva, Switzerland) [31]. The states of the cart body such as angle and position were sensed by an MPU 6050 board [22]; the sensing signals were encoded and then sent to the main board. After that, algorithm calculations from the control law were carried out and the PWM signals were sent to the motor drive board to control the wheel motors to, for example, let the cart to be stable and self-balancing. By using a real implementation of the cart, after it was powered on, it was verified that the proposed fuzzy PDC-based LQR sliding neural network control methodology is effective and very stable. The diagram is shown in Figure 13. Meanwhile, the sensed angle changing line could be viewed on a computer monitor by the means of the Bluetooth board on the cart. It is shown in Figure 14.

7. Conclusions

This paper develops a fuzzy PDC-based LQR sliding neural network methodology to control a two-wheeled self-balancing cart. Firstly, a simulation was conducted to verify the feasibility of this proposed algorithm. The simulation demonstrated very good effectiveness and stability. Then, a cart equipped with an STM32 MCU was implemented to verify the feasibility of this proposed algorithm. The results of the empirical experiment show that good self-balancing performance and stability were exhibited.

Funding

This research received no external funding.

Data Availability Statement

The data presented in this study are available in this article.

Acknowledgments

The author is grateful to the editors and reviewers for their constructive comments, which have significantly improved this work.

Conflicts of Interest

The author declares no conflicts of interest.

References

  1. Wang, H.O.; Tanaka, K.; Griffin, M.F. An Approach to Fuzzy Control of Nonlinear Systems: Stability and Design Issues. IEEE Trans. Fuzzy Syst. 1996, 4, 14–23. [Google Scholar]
  2. Lin, C.M.; Mon, Y.J. A Fuzzy-PDC-Based Control for Robotic Systems. Inf. Sci. 2001, 137, 135–155. [Google Scholar] [CrossRef]
  3. Pal, D.; Chatterjee, A.; Rakshit, A. Robust-Stable Quadratic-Optimal Fuzzy-PDC Controllers for Systems with Parametric Uncertainties: A PSO Based Approach. Eng. Appl. Artif. Intell. 2018, 70, 38–51. [Google Scholar]
  4. Alshammari, B.; Ben Salah, R.; Kahouli, O.; Kolsi, L. Design of Fuzzy TS-PDC Controller for Electrical Power System via Rules Reduction Approach. Symmetry 2020, 12, 2068. [Google Scholar] [CrossRef]
  5. Kalman, R.E. A New Approach to Linear Filtering and Prediction Problems. J. Basic Eng. 1960, 82, 35–45. [Google Scholar]
  6. Slotine, J.J.E.; Li, W. Applied Nonlinear Control; Prantice-Hall: Englewood Cliffs, NJ, USA, 1991. [Google Scholar]
  7. Edwards, C.; Spurgeon, S.K. Sliding Mode Control: Theory and Applications; CRC Press: Boca Raton, FL, USA, 1998. [Google Scholar]
  8. Zhang, Z.; Yang, X.; Wang, W.; Chen, K.; Cheung, N.C.; Pan, J. Enhanced Sliding Mode Control for PMSM Speed Drive Systems Using a Novel Adaptive Sliding Mode Reaching Law Based on Exponential Function. IEEE Trans. Ind. Electron. 2024, 71, 11978–11988. [Google Scholar] [CrossRef]
  9. Ma, S.; Zhao, J.; Xiong, Y.; Wang, H.; Yao, X. Sliding-Mode Control of Linear Induction Motor Based on Exponential Reaching Law. Electronics 2024, 13, 2352. [Google Scholar] [CrossRef]
  10. Ge, S.S.; Hang, C.C.; Lee, T.H.; Zhang, T. Stable Adaptive Neural Network Control; Springer Science & Business Media: Berlin/Heidelberg, Germany, 2013; Volume 13. [Google Scholar]
  11. Zheng, C.; Hu, C.; Yu, J.; Wen, S. Saturation Function-Based Continuous Control on Fixed-Time Synchronization of Competitive Neural Networks. Neural Netw. 2024, 169, 32–43. [Google Scholar] [CrossRef]
  12. Tam, P.; Ros, S.; Song, I.; Kang, S.; Kim, S. A Survey of Intelligent End-to-End Networking Solutions: Integrating Graph Neural Networks and Deep Reinforcement Learning Approaches. Electronics 2024, 13, 994. [Google Scholar] [CrossRef]
  13. Li, M.; Xu, J.; Wang, Z.; Liu, S. Optimization of the Semi-Active-Suspension Control of BP Neural Network PID Based on the Sparrow Search Algorithm. Sensors 2024, 24, 1757. [Google Scholar] [CrossRef]
  14. Simon, J. Fuzzy Control of Self-Balancing, Two-Wheel-Driven, SLAM-Based, Unmanned System for Agriculture 4.0 Applications. Machines 2023, 11, 467. [Google Scholar] [CrossRef]
  15. Tsai, C.-C.; Huang, H.-C.; Lin, S.-C. Adaptive Neural Network Control of a Self-Balancing Two-Wheeled Scooter. IEEE Trans. Ind. Electron. 2010, 57, 1420–1428. [Google Scholar] [CrossRef]
  16. Nghia, V.B.V.; Van Thien, T.; Son, N.N.; Long, M.T. Adaptive Neural Sliding Mode Control for Two Wheel Self Balancing Robot. Int. J. Dynam. Control 2022, 10, 771–784. [Google Scholar] [CrossRef]
  17. Mon, Y.-J. Tikhonov-Tuned Sliding Neural Network Decoupling Control for an Inverted Pendulum. Electronics 2023, 12, 4415. [Google Scholar] [CrossRef]
  18. Hu, Y.; Su, H.; Zhang, L.; Miao, S.; Chen, G.; Knoll, A. Nonlinear Model Predictive Control for Mobile Robot Using Varying-Parameter Convergent Differential Neural Network. Robotics 2019, 8, 64. [Google Scholar] [CrossRef]
  19. Zhang, J.; Zhang, X.; Cheng, Y.; Cheng, Y.; Zhang, Q.; Lu, K. Nonlinear Model Predictive Control (NMPC) based shared autonomy for bilateral teleoperation in CFETR Remote Handling. Nuclear Eng. Technol. 2024, 56, 4437–4445. [Google Scholar] [CrossRef]
  20. Wang, J.; Liu, Z.; Chen, H.; Zhang, Y.; Zhang, D.; Peng, C. Trajectory Tracking Control of a Skid-Steer Mobile Robot Based on Nonlinear Model Predictive Control with a Hydraulic Motor Velocity Mapping. Appl. Sci. 2023, 14, 122. [Google Scholar] [CrossRef]
  21. Grasser, F.; D’Arrigo, A.; Colombi, S.; Rufer, A.C. JOE: A Mobile, Inverted Pendulum. IEEE Trans. Ind. Electron. 2002, 49, 107–114. [Google Scholar] [CrossRef]
  22. Wheeltec Inc. Two-Wheeled Self Balancing Cart Technical Development Manual; Wheeltec Inc.: Dongguan, China, 2025; Available online: www.wheeltec.net (accessed on 20 April 2025).
  23. Kwakernaak, H.; Sivan, R. Linear Optimal Control Systems; Wiley-Interscience: New York, NY, USA, 1972; Volume 1, p. 608. [Google Scholar]
  24. Wang, M.; He, X.; Li, X. Self-Triggered Impulsive Control for Lyapunov Stability of Nonlinear Systems in Discrete Time. IEEE Trans. Cybern. 2024, 54, 4852–4858. [Google Scholar] [CrossRef]
  25. Fei, W.; Dai, W.; Li, C.; Zou, J.; Xiong, H. On Centralization and Unitization of Batch Normalization for Deep ReLU Neural Networks. IEEE Trans. Signal Process. 2024, 72, 2827–2841. [Google Scholar] [CrossRef]
  26. Liang, X.; Xu, J. Biased ReLU Neural Networks. Neurocomputing 2021, 423, 71–79. [Google Scholar] [CrossRef]
  27. Barbu, A. Training a Two-Layer ReLU Network Analytically. Sensors 2023, 23, 4072. [Google Scholar] [CrossRef] [PubMed]
  28. Sooksatra, K.; Rivas, P. Dynamic-Max-Value ReLU Functions for Adversarially Robust Machine Learning Models. Mathematics 2024, 12, 3551. [Google Scholar] [CrossRef]
  29. Mathworks Inc. MATLAB R14 User’s Manual; Mathworks Inc.: Natick, MA, USA, 2004; Available online: https://www.mathworks.com/ (accessed on 20 April 2025).
  30. TeraSoft Inc. MATLAB R 14 User’s Manual; TeraSoft Inc.: Taipei, Taiwan, 2004; Available online: https://www.terasoft.com.tw/ (accessed on 20 April 2025).
  31. STMicroelectronics. STM32F103xx Reference Manual; ST Microelectronics: Geneva, Switzerland, 2025; Available online: https://www.st.com.cn/content/st_com/zh.html (accessed on 20 April 2025).
Figure 1. The concept diagram of two-wheeled self-balancing cart.
Figure 1. The concept diagram of two-wheeled self-balancing cart.
Electronics 14 01842 g001
Figure 2. The design concept diagram of fuzzy PDC-based LQR ReNN sliding mode control for a two-wheeled self-balancing cart.
Figure 2. The design concept diagram of fuzzy PDC-based LQR ReNN sliding mode control for a two-wheeled self-balancing cart.
Electronics 14 01842 g002
Figure 3. The ReNN diagram.
Figure 3. The ReNN diagram.
Electronics 14 01842 g003
Figure 4. The simulation results of x (cart position).
Figure 4. The simulation results of x (cart position).
Electronics 14 01842 g004
Figure 5. The simulation results of θ P (cart angle).
Figure 5. The simulation results of θ P (cart angle).
Electronics 14 01842 g005
Figure 6. The simulation results of u 1 + u 2 (cart control torque).
Figure 6. The simulation results of u 1 + u 2 (cart control torque).
Electronics 14 01842 g006
Figure 7. Training and validation MSE curves.
Figure 7. Training and validation MSE curves.
Electronics 14 01842 g007
Figure 8. Weighting change diagram for x .
Figure 8. Weighting change diagram for x .
Electronics 14 01842 g008
Figure 9. Weighting change diagram for θ P .
Figure 9. Weighting change diagram for θ P .
Electronics 14 01842 g009
Figure 10. A physical photo of the main board.
Figure 10. A physical photo of the main board.
Electronics 14 01842 g010
Figure 11. A physical photo of the cart.
Figure 11. A physical photo of the cart.
Electronics 14 01842 g011
Figure 12. A block diagram of the hardware of the implementation of the cart.
Figure 12. A block diagram of the hardware of the implementation of the cart.
Electronics 14 01842 g012
Figure 13. A photo of the real implementation of the cart.
Figure 13. A photo of the real implementation of the cart.
Electronics 14 01842 g013
Figure 14. A diagram of the angle changing line.
Figure 14. A diagram of the angle changing line.
Electronics 14 01842 g014
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.

Share and Cite

MDPI and ACS Style

Mon, Y.-J. Fuzzy PDC-Based LQR Sliding Neural Network Control for Two-Wheeled Self-Balancing Cart. Electronics 2025, 14, 1842. https://doi.org/10.3390/electronics14091842

AMA Style

Mon Y-J. Fuzzy PDC-Based LQR Sliding Neural Network Control for Two-Wheeled Self-Balancing Cart. Electronics. 2025; 14(9):1842. https://doi.org/10.3390/electronics14091842

Chicago/Turabian Style

Mon, Yi-Jen. 2025. "Fuzzy PDC-Based LQR Sliding Neural Network Control for Two-Wheeled Self-Balancing Cart" Electronics 14, no. 9: 1842. https://doi.org/10.3390/electronics14091842

APA Style

Mon, Y.-J. (2025). Fuzzy PDC-Based LQR Sliding Neural Network Control for Two-Wheeled Self-Balancing Cart. Electronics, 14(9), 1842. https://doi.org/10.3390/electronics14091842

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop