Next Article in Journal
Lightweight, Trust-Managing, and Privacy-Preserving Collaborative Intrusion Detection for Internet of Things
Next Article in Special Issue
Dung Beetle Optimized Fuzzy PID Algorithm Applied in Four-Bar Target Temperature Control System
Previous Article in Journal
Application of Research on Risk Assessment of Roadway Roof Falls Based on Combined Weight Matter Element Extension Model
Previous Article in Special Issue
A Broadband Millimeter-Wave 5G Low Noise Amplifier Design in 22 nm Fully Depleted Silicon-on-Insulator (FD-SOI) CMOS
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Experimental Evaluation of a Takagi–Sugeno Fuzzy Controller for an EV3 Ballbot System †

by
Rodolfo Enemegio
1,
Francisco Jurado
1,* and
Jonathan Villanueva-Tavira
2
1
División de Estudios de Posgrado e Investigación, Tecnológico Nacional de México/I.T. La Laguna, Revolución Blvd. Instituto Tecnológico de La Laguna Av., Torreón 27000, Mexico
2
Tecnológico Nacional de México/CENIDET, Interior Internado Palmira S/N, Cuernavaca 62490, Mexico
*
Author to whom correspondence should be addressed.
This paper is an extended version of our paper published in the Proceedings of the 2022 International Conference on Mechatronics, Electronics and Automotive Engineering (ICMEAE), Cuernavaca, Mexico, 13–16 December 2022.
Appl. Sci. 2024, 14(10), 4103; https://doi.org/10.3390/app14104103
Submission received: 6 December 2023 / Revised: 25 April 2024 / Accepted: 9 May 2024 / Published: 12 May 2024
(This article belongs to the Special Issue Advanced Electronics and Digital Signal Processing)

Abstract

:
In this paper, experimental results about the performance of a Takagi–Sugeno Fuzzy Controller (TSFC) for an EV3 Ballbot Robotic System (EV3BRS) are reported. The physical configuration of the EV3BRS has the form of an inverted pendulum mounted on a ball. The EV3BRS is an underactuated robotic system with four outputs and two control torques. In this work, following the Takagi–Sugeno (TS) fuzzy control design methodology, the Parallel Distributed Compensation (PDC) approach is used in the design of the TSFC. The EV3BRS’s TS Fuzzy Model (TSFM) design comes from linearization of the nonlinear model around two operation points near the upright position of EV3BRS’s body. The Linear Matrix Inequality (LMI) approach was used to obtain the feedback gains for every local linear controller, guaranteeing, via a conservative stability condition, the global asymptotic stability of the overall fuzzy control system. The main goal of the control task consists of maintaining the EV3BRS’s body at its upright position. Measurement and control data from and to the EV3BRS are transferred via telecontrol and telemetry. The appropriate performance of the controller design is corroborated via experimentation.

1. Introduction

An underactuated robot is one for which the number of generalized coordinates is greater than the number of control inputs. Fully actuated robots possess strong properties that facilitates the control design. In fact, fully actuated manipulator robots are globally feedback-linearizable. This generally is not true for most underactuated systems. The control problem for underactuated systems often requires the development of new tools for controller design. There is a large class of underactuated robots for which the control problem is more difficult to solve than for fully–actuated robots [1].
A ballbot is an omnidirectional underactuated robotic system driven through a spherical wheel and whose dynamics are based on the spherical inverted pendulum system [2,3]. The NXT Ballbot Robotic System (NXTBRS) is a small version of a huge robotic platform introduced in [3] but built using the robotics LEGO Mindstorms NXT kit plus two gyro sensors [4]. Due to the benefit that this robotics kit is reconfigurable and reprogrammable, in addition to its low cost, it has been used in education and research activities [5]. The robotics kit comprises Direct Current (DC) motors with encoders, sensors, and the NXT brick, as well as structural elements like wheels, gears, bars, and balls [6]. The principal parts of the NXTBRS are two rubber tires attached to servomotors, one spherical wheel, two gyro sensors, and the NXT brick (See Figure 1).
Because some DC motor parameters cannot be accurately measured, namely the moment of inertia and friction coefficient, the main control problem for a ballbot is the balancing of its body for the upright position at all times due to the uncertainties when considering the actuator’s dynamics. Some authors have used different values for the physical parameters of the servomotors based on experimental tests [4,6,7,8,9]. In [4], a type–1 servo system as described in [10], also known as an integral control structure [11], was employed in the control of an NXTBRS where feedback gains were calculated through the Linear Quadratic Regulator (LQR) design approach. The performance of the servo system was validated via simulation and experimental results. In [6], an LQR was designed to control an NXTBRS whose performance was also validated through numerical simulation and experiments. In [2], following a similar procedure as that for the Takagi–Sugeno Fuzzy Controller (TSFC) design methodology, a robust controller was designed under the focus of Polytopic Linear Differential Inclusion (PLDI) models and Linear Matrix Inequalities (LMIs). A Polytopic Model (PM) for the NXTBRS was proposed, where the gains for an LQR were designed via the LMIs technique. In this work, the parameters corresponding to both the moment of inertia and the friction coefficient from the NXT servomotors were taken from [4,6,7,8,9]. So the NXTBRS’s PM was constituted by four linear subsystems, the so–called vertices, in such a way that all possible minimum and maximum values for the parameters from the NXT servomotors may be considered in the same PM. The Polytopic Controller (PC) (control law) was then given by state feedback plus an integral action, namely, in the form of a type–1 servo system via the LQR design approach. In their proposal, it is not clear how the interpolation between both PM, i.e., linear subsystem models, and PC, i.e., linear local controllers, is given. However, it could be considered that it was carried out in the form of a gain scheduling scheme. Simulation and experimental results validated the performance of the PC in contrast with those from the classical LQRs tuned for each vertex from the PM, showing that for some vertices, the classical LQR was not able to balance the NXTBRS; i.e., the PC was robust for the widespread range of parameters from the servomotors. In [12], Discrete–Time LQRs (DTLQRs) were designed for the control of an NXT ballbot considering the physical parameters from each one of the systems given in [4,6,7,8,9]. Numerical simulation results validated the performance of the DTLQRs when comparing their response versus that from their respective continuous-time versions. In [13], an extended Kalman filter was used to estimate, under position measurements, the state vector of the NXTBRS. The estimated state vector is used by an LQR to achieve the control objective. That work showed that the closed-loop system is locally asymptotically stable. The viability of this proposal was validated via numerical simulation. In [14], a dual TSFC was proposed for the control of a Ball Robot System (BRS) to operate independently without coupling. The fuzzy model for the BRS comprises two fuzzy rules whose local linear models were obtained from linearizing the nonlinear model from zero to five degrees with respect to the vertical unstable equilibrium position. Membership functions of the Gaussian type were used. The BRS has the physical configuration of an inverted pendulum but is supported by a bowling ball and driven through two 24 V DC motors orthogonally placed. The BRS is about 40 cm in height and 17 kg in weight. Simulation and experimental results validated the proposal. In [15], from the dynamic model for a ballbot given in terms of the Euler–Lagrange equations, an H–infinity (nonlinear optimal) controller was designed, whose performance is evaluated via simulation results. The nonlinear model is linearized around a temporary operating point which is updated at each time step of the control algorithm. Feedback control gains are computed through the solution of an algebraic Riccati equation solved at each time step. Closed-loop stability is shown via the Lyapunov approach.
Mobile robots have been playing a key role in the areas related to transportation, logistics and healthcare. Single-wheel robots, two-wheel robots, and omnidirectional-wheel (ODW) robots have been designed in order to gain an increase in mobility. A ball segway (BS), a ballbot-type mobile robot, was introduced in [16], where a PID two-loop controller is proposed to control ODWs for both balancing and transferring of the BS whose performance was evaluated experimentally. In [17], a double-loop controller is proposed to control the BS and whose performance was validated via simulation and experimental results. This BS has the capability to transport a single human passenger. It was shown that this BS can maintain its balance, perform trajectory tracking and rotate around its own vertical axis. The double-loop controller comprises an LQR outer-loop controller and a PI-plus-feedforward inner-loop controller. A PD controller was added to control the rotation of the BS around its vertical axis. The driving mechanism for the BS consists of three ODWs. Its governing equations are given by a second-order multi-input multi-output (MIMO) system with five degrees of freedom (DOF). The system dynamics can be decoupled into three planar planes under certain conditions. So, the whole system can be operated through the separate control of these decoupled dynamics. Robust controllers must be designed to face modeling uncertainties due to backlash between mechanical components, location center of mass, mass moment of inertia, nonlinearities from the motors, and friction between the ball and the road surface. In [18,19,20,21], a hierarchical sliding mode control (HSMC) approach was used to address the balancing and movement problem for the BS. In [22], an adaptive version of the HSMC approach to the control of the BS was proposed. Energy/passivity methods, partial feedback linearization, and switching control have shown to be a good choice in the control of underactuated systems. A passivity-based nonlinear controller for a BS was suggested in [23]. In [24], a control scheme based on radial basis function networks was addressed, in conjunction with the dynamic surface control approach for balancing and trajectory tracking of a BS. Control schemes based on a partial feedback linearization approach and an energy-based method were reported in [25,26,27]. The performance of the control schemes proposed in [19,22,24,27] was validated through numerical simulation, whereas experimental results were exhibited in [20,23], and both simulation and experimental results were included in [18,21,25,26].
The Takagi–Sugeno Fuzzy Models (TSFMs) are universal approximators for a wide class of smooth nonlinear (systems) functions. The Takagi–Sugeno (TS) fuzzy systems are able to exactly represent or to approximate to an arbitrary degree of accuracy any nonlinear system in a compact set of state variables. A TSFM is a convex combination of local linear models whose structure facilitates stability analysis under the Lyapunov approach and LMIs. A TSFM comprises an if–then rule base. The rule antecedents partition a subset of the model variables into fuzzy sets, while the consequent of each rule is a linear model. A general TSFM utilizes an affine model with a constant term in the consequent part for each rule, so it is often referred to as an affine TSFM. In contrast with an affine TSFM, a TSFM having a linear model at its consequent part offers a limited capability in representing a nonlinear system. The TSFM, together with a Parallel Distributed Compensation (PDC) controller, forms a powerful framework for fuzzy control systems. The structure of the PDC uses a fuzzy state feedback controller that mirrors the structure of the associated TSFM. Interesting applications and resources about TS fuzzy systems related to robust control, optimal control, observer design, and control of nonlinear time–delay systems, cascaded TS systemsm and distributed TS systems can be encountered in [28,29].
In this work, motivated by the fact that just a few nonlinear controllers have been reported in the literature for this class of LEGO underactuated robot and neglecting its respective experimental validation, a TSFC is implemented on an EV3 Ballbot Robotic System (EV3BRS) in order to evaluate its performance in real time for this kind of easy-to-build lightweight and low-cost prototype with the aim of achieving the control task proposed in [30]. In this latter work, the proposal was just validated through simulation results. It must be highlighted that the EV3BRS comprises an EV3 brick, a more recent version of the NXT brick but with better capabilities. Here, the TSFM comprises two fuzzy rules where the absolute value for the angular displacement of the EV3BRS’s body is considered as premise variable and whose membership functions differ from those of the Gaussian type used in [14]. Also, the TSFM is composed of two local linear models in contrast with those four local linear models used in [2]; the first one was designed from a farther angle with respect to the vertically unstable equilibrium position of the EV3BRS’s body, while the second one was designed from the zero-degree reference for the upright position. Moreover, the dynamics of the actuators were taken into account when linearizing the nonlinear model. Furthermore, a conservative stability condition, in contrast with the relaxed condition employed in [14], is used in the design of the gains for the TSFC.
The contributions from this work are as follows: (1) the construction of a ballbot robotic system, namely the EV3BRS, but using the EV3 brick instead of a NXT brick; (2) the design of a TSFM for the EV3BRS; (3) the design of a TSFC for the EV3BRS; (4) the global asymptotic stability of the overall fuzzy control system guaranteed by the use of a conservative stability condition; (5) the experimental evaluation of the proposal; and (6) the measurement and control data to and from the EV3BRS are transferred via telecontrol and telemetry.
The manuscript is organized as follows. Section 2 describes the nonlinear dynamic model and the state variable equations of the EV3BRS, including the dynamics of the actuator. The TSFM of the EV3BRS and the design procedure of the TSFC are included in Section 3. Section 4 presents the experimental results for the performance of the TSFC in real time. In Section 5, the conclusion is drawn.

2. Dynamical Model

In this work, a four-degree-of-freedom (DOF) underactuated system consisting of a rigid body balancing atop a ball (see Figure 2) and having two control inputs (see Figure 1), here known as EV3BRS, is considered. When assuming that the whole dynamics of motion can be decomposed into two planes of motion, a TSFC is designed by taking just one of those planes of motion as a reference and then implementing it in a decentralized way on each one. The controller design is carried out under the premise that there is no slipping between wheel and surface and that only viscous friction exists between wheel and body. The control inputs are just considered as torques. The generalized coordinates are given by the angular displacement of the EV3BRS’s body, namely q 1 , and the angle of the motor shaft, namely q 2 (See Figure 2).
Consider the model for the EV3BRS [4] given in the second-order matrix form: [31]
M ( q ) q ¨ + C ( q , q ˙ ) q ˙ + g ( q ) + f ( q ˙ ) = τ ext ,
whose form is frequently used to model the dynamics from robot arms of n DOF [32,33,34], where
M ( q ) = m 11 m 12 m 21 m 22 R n × n
with m 11 = I B + I M + I b + L 2 m B + m B R b 2 + m b R b 2 + 2 L m B R b cos ( q 1 ) , m 12 = I M + I b δ + m B δ R b 2 + m b δ R b 2 + L m B δ R b cos ( q 1 ) , m 21 = m 12 , m 22 = I M + I b δ 2 + m B δ 2 R b 2 + m b δ 2 R b 2 , and which is referred to as inertia (mass) matrix, symmetric and positive definite for all q R n ,
C ( q , q ˙ ) = c 11 c 12 c 21 c 22 = L m B R b sin ( q 1 ) q ˙ 1 0 L m B δ R b sin ( q 1 ) q ˙ 1 0 R n × n
is the centrifugal and Coriolis forces (damping) matrix,
g ( q ) = g 11 g 21 = g L m B sin ( q 1 ) 0 R n
is the gravitational forces or torques vector,
f ( q ˙ ) = f 11 f 21 = f B g q ˙ 1 f B b q ˙ 2 R n
is the viscous friction forces vector, which depends on the joint velocities, and
τ ext = 0 τ = 0 u R n
is the vector of external forces corresponding to the torque exerted by the actuator. By an inverse relationship, the dynamics of motion (1) may also be expressed in terms of the joint accelerations, i.e.,
q ¨ = M ( q ) 1 [ τ ext C ( q , q ˙ ) q ˙ g ( q ) f ( q ˙ ) ]
with
M ( q ) 1 = m 22 m 12 m 21 m 11 det ( M ( q ) ) ,
where, if the existence of (8) is guaranteed, (7) is then given by
q ¨ 1 q ¨ 2 = 1 det ( M ( q ) ) ( m 12 c 21 m 22 c 11 ) q ˙ 1 m 22 g 11 + m 12 f 21 m 12 u ( m 21 c 11 m 11 c 21 ) q ˙ 1 + m 21 g 11 m 11 f 21 + m 11 u .

2.1. DC Motor Dynamics

The governing equations for the DC motor are given by [31]
L a d i a d t = v R m i a v b ,
where L a is the armature inductance, i a is the direct armature current, v is the input armature voltage, R m is the armature resistance, and v b = k b q ˙ 2 is the back electromotive force (BEMF) coming from the armature. Assuming L a 0 , i a = ( v k b q ˙ 2 ) / R m .
The DC motor torque is given by
τ = k t v k b q ˙ 2 R m ,
i.e., the input torque is a voltage scaled by k t / R m , with k t as the torque constant of the motor [32].
Physical and electrical parametric values corresponding to the platform based on the LEGO Mindstorms EV3 kit are given in Table 1. The physical parameters from the model, such as the mass of the body, the mass of the ball, the radius of the ball, the radius of the wheel, and the height of the center of mass, were measured directly. Both the body and ball moment of inertia were computed through the relations given in Table 1, which were taken from [4]. The electrical parameters from the EV3’s DC motors were taken from [35]. It is worth noting that the NXT kit’s gyros are not compatible with the EV3 brick and vice versa.

2.2. EV3BRS’s State Variable Equations

From (9), by selecting as the state variables x 1 = q 1 , x 2 = q 2 , x 3 = q ˙ 1 , and x 4 = q ˙ 2 ; the state variable equations are then formed as
x ˙ 1 = x 3 , x ˙ 2 = x 4 , x ˙ 3 = 1 det ( M ( q ) ) [ m 22 c 11 x 3 m 22 g 11 + c 21 m 12 x 3 + m 12 f B b x 4 m 12 u ] , x ˙ 4 = 1 det ( M ( q ) ) [ m 21 c 11 x 3 + m 21 g 11 m 11 c 21 x 3 m 11 f B b x 4 + m 11 u ] ,
which can also be written as
x ˙ 1 x ˙ 2 x ˙ 3 x ˙ 4 = 0 0 1 0 0 0 0 1 0 0 1 det ( M ( q ) ) ( m 12 c 21 m 22 c 11 ) 1 det ( M ( q ) ) ( m 12 f B b ) 0 0 1 det ( M ( q ) ) ( m 21 c 11 m 11 c 21 ) 1 det ( M ( q ) ) ( m 11 f B b ) x + 0 0 m 12 det ( M ( q ) ) m 11 det ( M ( q ) ) u + 0 0 1 det ( M ( q ) ) ( m 22 g 11 ) 1 det ( M ( q ) ) ( m 21 g 11 )

3. Takagi–Sugeno Fuzzy Modelling

3.1. EV3BRS’s TSFM

The TSFM [36,37] is described by fuzzy if–then rules, each of which is associated with a local linear system from the linearization on an operation point for a nonlinear system [38,39,40]. The fuzzy blending of the linear system models raises the overall fuzzy model of the system. The structure of a TSFM in continuous time adopts the following form:
Plant rule i:
IF z 1 ( t ) is M i 1 and and z p ( t ) is M i p ,
THEN x ˙ ( t ) = A i x ( t ) + B i u ( t ) , y ( t ) = C i x ( t ) , i = 1 , 2 , , r ;
where z 1 ( t ) z p ( t ) are measurable premise variables, M i j are fuzzy sets, x ( t ) R n is the state vector, y ( t ) R q is the output vector, u ( t ) R m is the input vector, A i R n × n , B i R n × m , C i R q × n , and r is for the number of fuzzy rules.
So the overall output of the T–S fuzzy system (14) and (15) is inferred using a singleton fuzzifier, a center average defuzzifier, and a product inference engine, from the pair ( x ( t ) , u ( t ) ) , as follows [41]:
x ˙ ( t ) = i = 1 r h i ( z ( t ) ) { A i x ( t ) + B i u ( t ) } ,
y ( t ) = i = 1 r h i ( z ( t ) ) C i x ( t ) ,
where z ( t ) = ( z 1 ( t ) z 2 ( t ) z p ( t ) ) and w i ( z ( t ) ) = j = 1 p M i j ( z j ( t ) ) , with M i j ( z j ( t ) ) as the grade of membership of z j ( t ) in M i j , and
h i ( z ( t ) ) = w i ( z ( t ) ) i = 1 r w i ( z ( t ) )
is the normalized weight of each if–then rule.
The TSFMs are universal approximators of any smooth nonlinear dynamic system [28]. The TSFM can be considered as an infinite dimensional system since it can be composed of a great number of linear subsystems as a result of linearization for infinitesimal quantities around an operation point. Although there are no general guidelines about how many linearization points should be chosen, a large number of points may be necessary for an accurate approximation, which implies a high computational cost [29]. Also, as the TSFC design methodology tries both LMIs and eigenvalue problems, i.e., convex feasibility and optimization problems [42], the design of a large-dimensional TSFM may be conducive for an LMI that is infeasible. It should be noticed that a TSFM must be redesigned for every modification in the parameters, or assumptions about the dynamical behavior, of the nonlinear system since the controller design is based on the TSFM.
Then, the nonlinear model (13) is linearized around operation points x 1 = 0 and x 1 = ± π 12 = π 12 . Thus, taking x 1 = 0 , and recalling that from small-angle linearization cos ( θ ) 1 and sin ( θ ) θ , the linear model has the form
x ˙ 1 x ˙ 2 x ˙ 3 x ˙ 4 = 0 0 1 0 0 0 0 1 Δ 1 W m 22 0 0 Δ 1 ( m 12 f B b ) k t k b R m Δ 1 W m 21 0 0 Δ 1 ( m 11 f B b ) k t k b R m x + 0 0 Δ 1 k t m 12 R m Δ 1 k t m 11 R m u
where Δ 1 = 1 / m 11 m 22 m 21 m 12 , m 11 = I B + I M + I b + L 2 m B + m B R b 2 + m b R b 2 + 2 L m B R b , m 12 = m 21 = I M + I b δ + m B δ R b 2 + m b δ R b 2 + L m B δ R b , and W = m B g L .
From the parametric values in Table 1, (19) takes the form
x ˙ = 0 0 1 0 0 0 0 1 155.5 0 0 2.4 1200.3 0 0 23.7 x + 0 0 50.2203 509.729 u ,
which corresponds to the local linear system x ˙ = A 1 x + B 1 u .
Hence, taking x 1 = π 12 , thus
cos ( x 1 ) = cos π 12 , sin ( x 1 ) = sin ( x 1 ) x 1 x 1 = ξ 1 x 1 ,
with ξ 1 = sin ( x 1 ) / x 1 . Then, from (13), the linear model corresponding to this latter value for the operation point results in
x ˙ 1 x ˙ 2 x ˙ 3 x ˙ 4 = 0 0 1 0 0 0 0 1 Δ 2 W ξ 1 m 22 0 0 Δ 2 ( m 12 f B b ) k t k b R m Δ 2 W ξ 1 m 21 0 0 Δ 2 ( m 11 f B b ) k t k b R m x + 0 0 Δ 2 k t m 12 R m Δ 2 k t m 11 R m u ,
with Δ 2 = 1 / m 11 m 22 m 21 m 12 , m 11 = I B + I M + I b + L 2 m B + m B R b 2 + m b R b 2 + 2 L m B R b cos π 12 , and m 12 = m 21 = I M + I b δ + m B δ R b 2 + m b δ R b 2 + L m B δ R b cos π 12 .
So, from Table 1, (21) takes the form
x ˙ = 0 0 1 0 0 0 0 1 133.1629 0 0 1.9837 998.2332 0 0 20.3892 x + 0 0 42.2471 438.6702 u ,
which is considered as the local linear system x ˙ = A 2 x + B 2 u .

3.2. Parallel Distributed Compensation (PDC)

The PDC technique [43] is used to design the fuzzy controller for the fuzzy model (14) and (15), where each rule is designed from the respective rule of the TSFM [38,39,40]. From the premise variables, the fuzzy controller shares the same fuzzy sets with the fuzzy model. So the following following fuzzy controller is inferred:
Control rule i:
IF z 1 ( t ) is M i 1 and and z p ( t ) is M i p ,
THEN u ( t ) = K i x ( t ) , i = 1 , 2 , , r ;
where K i is the feedback gain. Thus, the entire fuzzy controller is given as
u ( t ) = i = 1 r h i ( z ( t ) ) K i x ( t ) .
It should be noticed that the controller (25) is nonlinear.

3.3. TSFC Design

The solution to the controller fuzzy design problem consists of determining feedback gains K i for the linear controllers fulfilling the following theorem.
Theorem 1 
([28]). The equilibrium of the continuous fuzzy control systems (14), (15) and (25) is globally asymptotically stable if there exists a common positive definite matrix P C such that
G i i T P C + P C G i i < 0 ,
G i j + G j i 2 T P C + P C G i j + G j i 2 0 ,
for i < j , such that h i h j , with G i j = A i B i K j .
Proof. 
See [28]. □
The conditions (26) and (27) are not jointly convex in K i and P C . So, defining X = P C 1 and M i = K i X such that for X > 0 then K i = M i X 1 , the stable fuzzy controller design problem is established as follows [28]:
  • Stable Fuzzy Controller Design Problem. Find X > 0 and M i ( i = 1 , , r ) satisfying
X A i T A i X + M i T B i T + B i M i > 0 ,
X A i T A i X X A j T A j X + M j T B i T + B i M j + M i T B j T + B j M i 0 .
The conditions (28) and (29) are LMIs with respect to variables X and M i . A positive definite matrix X and M i can be found that satisfies such inequalities. From the solutions (28) and (29), a common positive definite matrix P C and feedback gains K i can be obtained as
P C = X 1 ,
K i = M i X 1 .
Hence, assuming that the pair ( A i , B i ) is controllable, one proceeds with the stable fuzzy controller design. Then, one solves the design problem through the use of the LMI Control Toolbox from MATLAB (Matlab2018a)®. The existence of a common positive definite matrix P C has been verified in [30] for which the feedback gain result is
K 1 = 13.4035 0.0515 1.7995 0.1413 ,
K 2 = 15.0967 0.0598 2.0884 0.1565 .
A feature of the TSFC design methodology is that the nonlinearities are completely captured by the TSFMs and the nonlinearities are fully embedded into the membership functions in the TSFMs. Here, the membership functions are given, as shown in Figure 3. The TSFC scheme is shown in Figure 4.

4. Results

4.1. LEGO Mindstorms EV3 Hardware

The MATLAB® and Simulink (Simulink 9.1)® environments contain freeware tools for programming and communicating with LEGO Mindstorms EV3 technology (LEGO Group, Billund, Denmark). The acronym EV3 refers to the word Evolution, while the number represents the generation of the set. The brain of the LEGO Mindstorms EV3 kit is also known as smart brick, which contains a 300 MHz ARM9 microcontroller (Texas Instruments, Dallas, TX, USA ) that collects information from sensors, processes it, and sends commands to the actuators. The smart brick can communicate with computers, smartphones, and other robots thanks to USB, Bluetooth, and WiFi connectivity. This brain has 16 MB flash memory, 64 MB RAM (Offtek Ltd., Solihull, UK), and a Linux operating system.
For the control of the EV3BRS, the Motor, Gyro Sensor, and Encoder (rotation sensor) Simulink® blocks are used, available from the Simulink® support package for LEGO Mindstorms EV3 hardware. Figure 5 shows the blocks related to the I/O peripherals. The input from the LEGO EV3 Motor block accepts integer values between 100 (full power reverse) and + 100 (full power forward); i.e., the input voltage ( ± 9 [V]) from each motor is translated to a pulse width modulator (PWM) duty cycle with values within the range of ± 100 %. The brick output port that is connected to each motor must be selected from the same Motor block parameters. In addition, the LEGO EV3 Encoder block allows the measurement of the cumulative rotation of a motor in degrees [deg]. The angular displacement of the EV3BRS’ body from its upright position is obtained through a LEGO EV3 Gyro Sensor located in each plane, which provides the measure of rotation in degrees [deg] around a single vertical axis that extends from the top and bottom of the same gyro sensor. The angular velocity is calculated through a Derivative Simulink® block.
The Simulink® support package for LEGO Mindstorms EV3 hardware is easy to use since each block works like any other Simulink® block. When the code is completed, Simulink® translates it into the C++ code and transfers it to the LEGO Mindstorms EV3 brick via Bluetooth, WiFi, USB, or ethernet connection. One of the main difficulties in achieving the connection between the brick and Simulink® is to find the appropriate firmware version for the LEGO EV3 block that is compatible with the version of MATLAB® being used. In this work, the connection between the brick and the host computer running MATLAB® 2018a/Simulink® is established by way of WiFi access via the brick’s USB port, for an execution time of 20 s and a sampling time of 0.01 s. Figure 6 shows the hardware connections used to carry out the experimental evaluation.

4.2. External Mode Execution

Some options are available to the programmer for the execution of the control algorithm on the EV3BRS. One of them, used in the present work, is the Simulink® external mode. In real-time external mode, the Simulink® Coder dynamically links the generated algorithm code with the controller code generated from the I/O blocks. The resulting executable file runs in operating system kernel mode on the host computer and exchanges parameter data with Simulink® via a shared memory interface. Figure 7 shows the general diagram of the controller and the plant implemented in Simulink®. From the block diagram of the controller and the plant in Simulink®, the next step is to indicate to Simulink® which hardware the program will run on. This is performed in the Hardware Implementation option from the Configuration Parameters panel through Options from Run on Target Hardware of the Tools menu. In this configuration window, the type of connection that will be used to communicate with the LEGO Mindstorms EV3 device, the LEGO Mindstorms EV3 device ID, and the IP address can also be specified with respect to the case with a WiFi or ethernet connection.
The following results were obtained from a real-time testing prototype using an EV3 brick, including the LEGO Mindstorms kit, an ASUS TUF Gaming A15 Laptop (ASUS, Taipei, China), a tp-link wireless router WR840N (TP-Link, Shenzhen, China), and a NETGEAR N150 Wireless USB adapter WNA1100 (Netgear, Inc., San Jose, CA, USA). So, the measurement and control data to and from the EV3BRS are transferred via telecontrol and telemetry. The EV3BRS prototype is shown in Figure 8. Figure 9, Figure 10, Figure 11, Figure 12, Figure 13 and Figure 14 exhibit the real-time performance in the closed loop of the TSFC for the initial condition of zero, i.e., in the case for which the EV3BRS’s body is released from the upright position. From Figure 9 and Figure 10, it can be seen that the EV3BRS’s body is maintained around zero, i.e., near the upright position, showing a better balance on the plane of motion x z in contrast with that from the plane of motion y z . Figure 11 and Figure 12 show the dynamics for each rotor shaft of the actuators. The control signal for each actuator is shown in Figure 13 and Figure 14, from which it can be seen that the actuator aligned with the x-axis demands a minor effort in comparison with that aligned with the y-axis. It must be noticed that in this work, the control task consists of maintaining the EV3BRS’s body at its upright position and neglecting the translational displacement of the EV3BRS on the plane of motion x y . So, from experimental results, it can be noticed that the control objective is successfully achieved. A video is attached to this draft version of the manuscript in the (Supplementary Materials).

5. Conclusions

From the experimental evaluation results, we conclude that the proposal for the control of the EV3BRS performs well. So it can be seen that the control objective has been reached considering just two fuzzy rules for the TSFM with membership functions differing from that of the Gaussian type and taking the absolute value for the angular displacement of the EV3BRS’s body as the premise variable for the fuzzy rules. Consequently, the EV3BRS’s TSFM has been validated experimentally, as well as its original nonlinear dynamical model. It has also been confirmed that when following the controller design in a decentralized way, the control task can be carried out successfully, although for one of the planes of motion, the dynamics are more demanding. Moreover, a disadvantage of the TSFC technique is the lack of approaches for the improvement in the transient dynamics if one tries to reach stability in a fixed time. Furthermore, global asymptotic stability is achieved via a conservative stability condition. In future work, other control design methodologies may be explored in order to evaluate their respective performance in the achievement of the control task in real time.

Supplementary Materials

The following supporting information can be downloaded at: https://www.mdpi.com/article/10.3390/app14104103/s1, Video S1: Real-time closed-loop performance of the TSFC on the EV3BRS.

Author Contributions

Conceptualization, F.J.; investigation, R.E., F.J. and J.V.-T.; methodology, R.E. and F.J.; formal analysis, R.E.; validation, R.E., F.J. and J.V.-T.; software, R.E.; data curation, R.E.; visualization, R.E., F.J. and J.V.-T.; writing—original draft preparation, R.E. and F.J.; writing—review and editing, F.J.; supervision, F.J. and J.V.-T.; funding acquisition, F.J.; resources, F.J.; project administration, F.J. All authors have read and agreed to the published version of the manuscript.

Funding

This research was funded by Tecnológico Nacional de México (TecNM) projects and, partially, under grant 43433 from the EDD 2023 program. This work was supported by CONACYT, México, under grant 759631.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

The original contributions presented in the study are included in the article/Supplementary Material, further inquiries can be directed to the corresponding authors.

Conflicts of Interest

The authors declare no conflicts of interest.

Abbreviations

The following abbreviations are used in this manuscript:
BEMFBack Electromotive Force
BRSBall Robot System
BSBall Segway
DCDirect Current
DOFDegree-of-Freedom
DTLQRDiscrete-Time Linear Quadratic Regulator
EV3BRSEV3 Ballbot Robotic System
HSMCHierarchical Sliding Mode Control
LQRLinear Quadratic Regulator
LMIsLinear Matrix Inequalities
MIMOMulti-Input Multi-Output
NXTBRSNXT Ballbot Robotic System
ODWOmnidirectional Wheel
PDCParallel Distributed Compensation
PLDIPolytopic Linear Differential Inclusion
PCPolytopic Controller
PMPolytopic Model
TSTakagi–Sugeno
TSFCTakagi–Sugeno Fuzzy Controller
TSFMTakagi–Sugeno Fuzzy Model

References

  1. Spong, M.W.; Hutchinson, S.; Vidyasagar, M. Robot Modeling and Control, 2nd ed.; John Wiley & Sons, Inc.: Hoboken, NJ, USA, 2020. [Google Scholar]
  2. García, R.A.; Arias, M. Linear Controllers for the NXT Ballbot with Parameter Variations Using Linear Matrix Inequalities. Control Syst. Mag. 2016, 36, 121–136. [Google Scholar]
  3. Hollis, R. Ballbots. Sci. Am. 2006, 295, 72–77. [Google Scholar] [CrossRef] [PubMed]
  4. Yamamoto, Y. NXT Ballbot Model–Based Design–Control of a Self–Balancing Robot on a Ball, Built with LEGO Mindstorm NXT, 1st ed.; Cybernet Systems: Tokyo, Japan, 2009. [Google Scholar]
  5. Gawthrop, P.; McGookin, E. A LEGO–based control experiment. Control Syst. Mag. 2004, 24, 43–56. [Google Scholar]
  6. Sánchez, P.; Arribas, T.; Gómez, M.; Rodríguez, O. A Monoball Robot Based on LEGO Mindstorms. Control Syst. Mag. 2012, 32, 71–83. [Google Scholar]
  7. Hurbain, P. LEGO 9V Technic Motors Compared Characteristics. Available online: http://www.philohome.com/motors/motorcomp.htm (accessed on 1 November 2017).
  8. Pinto, M.; Bermúdez, G. Parameters determination of a mobil robot of LEGO Mindstorms. Ing. Investig. Desarro. 2007, 5, 7–13. (In Spanish) [Google Scholar]
  9. García, R.A. Development of a Robot Ballbot–like for Control Applications. Available online: http://jupiter.utm.mx/~tesis_dig/12495.pdf (accessed on 5 March 2017). (In Spanish).
  10. Ogata, K. Modern Control Engineering, 4th ed.; Prentice Hall: Upper Saddle River, NJ, USA, 2002. [Google Scholar]
  11. Franklin, G.F.; Powell, J.D.; Emami–Naeini, A. Feedback Control of Dynamic Systems, 6th ed.; Pearson: Upper Saddle River, NJ, USA, 2010. [Google Scholar]
  12. Ortíz, I.; Jurado, F.; Ollervides-Vázquez, E.J. Discrete-Time Linear Quadratic Regulator for a NXT Ballbot System. In Proceedings of the 2022 International Conference on Mechatronics, Electronics and Automotive Engineering (ICMEAE), Cuernavaca, Mexico, 5–9 December 2022. [Google Scholar]
  13. Herrera, L.E.; Hernández, R.; Jurado, F. Control and Extended Kalman Filter based Estimation for a Ballbot Robotic System. In Proceedings of the XX Congreso Mexicano de Robótica (COMRob), Ensenada, Mexico, 12–14 September 2018. [Google Scholar]
  14. Chiu, C.H.; Peng, Y.F. Design of Takagi–Sugeno Fuzzy Control Scheme for Real World System Control. Sustainability 2019, 11, 3855. [Google Scholar] [CrossRef]
  15. Rigatos, G.; Abbaszadeh, M.; Pomares, J. A Nonlinear Optimal Control Method for the Ballbot Autonomous Vehicle. In Proceedings of the 2020 American Control Conference, Denver, CO, USA, 1–3 July 2020. [Google Scholar]
  16. Pham, D.B.; Lee, S.G.; Back, S.; Kim, J.J.; Lee, M.K. Balancing and Translation Control of a Ball Segway that a Human Can Ride. In Proceedings of the 2016 16th International Conference on Control, Automation and Systems (ICCAS), Gyeongju, Republic of Korea, 16–19 October 2016. [Google Scholar]
  17. Pham, D.B.; Kim, H.; Kim, J.J.; Lee, S.G. Balancing and transferring control of a ball Segway using a double–loop approach. IEEE Control Syst. Mag. 2018, 38, 15–37. [Google Scholar]
  18. Pham, D.B.; Lee, S.G. Hierarchical sliding mode control for a two–dimensional ball Segway that is a class of a second–order underactuated system. J. Vib. Control 2019, 25, 72–83. [Google Scholar] [CrossRef]
  19. Lee, S.M.; Park, B.S. Robust control for trajectory tracking and balancing of a ballbot. IEEE Access 2020, 8, 159324–159330. [Google Scholar] [CrossRef]
  20. Do, V.T.; Lee, S.G. Robust integral backstepping hierarchical sliding mode controller for a ballbot system. Mech. Syst. Signal Process. 2020, 144, 106866. [Google Scholar] [CrossRef]
  21. Pham, D.B.; Lee, S.G.; Bui, T.H.; Truong, T.P. Hierarchical Sliding Mode Control for A 2D Ballbot That Is a Class of Second–Order Underactuated System; IntechOpen: London, UK, 2022. [Google Scholar]
  22. Do, V.T.; Lee, S.G.; Mien, V. Adaptive hierarchical sliding mode control for full nonlinear dynamics of uncertain ridable ballbots under input saturation. Int. J. Robust Nonlinear Control 2021, 31, 2882–2904. [Google Scholar] [CrossRef]
  23. Do, V.T.; Lee, S.G.; Gwak, K.W. Passivity-based nonlinear control for a ballbot to balance and transfer. Int. J. Control Autom. Syst. 2019, 17, 2929–2939. [Google Scholar] [CrossRef]
  24. Jang, H.G.; Hyun, C.H.; Park, B.S. Neural network control for trajectory tracking and balancing of a ball–balancing robot with uncertainty. Appl. Sci. 2021, 11, 4739. [Google Scholar] [CrossRef]
  25. Pham, D.B.; Kim, J.J.; Lee, S.G. Combined control with sliding mode and partial feedback linearization for a spatial ridable ballbot. Mech. Syst. Signal Process. 2019, 128, 531–550. [Google Scholar] [CrossRef]
  26. Pham, D.B.; Weon, I.S.; Lee, S.G. Partial feedback linearization double–loop control for a pseudo-2D ridable ballbot. Int. J. Control Autom. Syst. 2020, 18, 531–550. [Google Scholar] [CrossRef]
  27. Do, V.T.; Pham, D.B.; Lee, S.G. Design of an Energy-Based Controller for a 2D Ball Segway. In Proceedings of the 17th International Conference on Control, Automation and Systems (ICCAS), Jeju, Republic of Korea, 18–21 October 2017. [Google Scholar]
  28. Tanaka, K.; Wang, H.O. Fuzzy Control Systems Design and Analysis: A Linear Matrix Inequality Approach; John Wiley & Sons, Inc.: Hoboken, NJ, USA, 2001. [Google Scholar]
  29. Lendek, Z.; Guerra, T.M.; Babuška, R.; De Schutter, B. Stability Analysis and Nonlinear Observer Design Using Takagi–Sugeno Fuzzy Models; Springer: Berlin/Heidelberg, Germany, 2010. [Google Scholar]
  30. Enemegio, R.; Jurado, F.; Villanueva-Tavira, J. Takagi–Sugeno Fuzzy Controller Design for an EV3 Ballbot Robotic System. In Proceedings of the 2022 International Conference on Mechatronics, Electronics and Automotive Engineering (ICMEAE), Cuernavaca, Mexico, 5–9 December 2022. [Google Scholar]
  31. Esfandiari, R.; Lu, B. Modeling and Analysis of Dynamic Systems; CRC Press: Boca Raton, FL, USA, 2010. [Google Scholar]
  32. Kelly, R.; Santibáñez, V.; Loría, A. Control of Robot Manipulators in Joint Space; Springer: Berlin/Heidelberg, Germany, 2005. [Google Scholar]
  33. Vázquez, L.A.; Jurado, F.; Castañeda, C.E.; Santibáñez, V. Real–time decentralized neural control via backstepping for a robotic arm powered by industrial servomotors. IEEE Trans. Neural Netw. Learn. Syst. 2018, 29, 419–426. [Google Scholar] [CrossRef] [PubMed]
  34. Vázquez, L.A.; Jurado, F.; Castañeda, C.E.; Alanis, A.Y. Real–time implementation of a neural integrator backstepping control via recurrent wavelet first order neural network. Neural Proc. Lett. 2019, 49, 1629–1648. [Google Scholar] [CrossRef]
  35. Fong, J.; Uppill, S.; Cazzolato, B. 899: Ballbot. Bachelor’s Thesis, University of Adelaide, Adelaide, Australia, 2009. [Google Scholar]
  36. Takagi, T.; Sugeno, M. Fuzzy identification of systems and its applications to modeling and control. IEEE Trans. Syst. Man. Cybern. 1985, 15, 116–132. [Google Scholar] [CrossRef]
  37. Wang, H.O.; Tanaka, K.; Griffin, M. An analytical framework of fuzzy modeling and control of nonlinear systems: Stability and design issues. In Proceedings of the 1995 American Control Conference ACC’95, Seattle, WA, USA, 21–23 June 1995. [Google Scholar]
  38. Jurado, F.; Castillo–Toledo, B.; Di Gennaro, S. Stabilization of a Quadrotor via Takagi–Sugeno Fuzzy Control. In Proceedings of the 12th World Multi–Conference on Systemics, Cybernetics and Informatics: WMSCI 2008, Orlando, FL, USA, 29 June–2 July 2008. [Google Scholar]
  39. Jurado, F.; Palacios, G.; Flores, F.; Becerra, H.M. Vision-based trajectory tracking system for an emulated quadrotor UAV. Asian J. Control 2014, 16, 729–741. [Google Scholar] [CrossRef]
  40. Llama, M.A.; De La Torre, W.; Jurado, F.; Garcia-Hernandez, R. Robust Takagi–Sugeno fuzzy dynamic regulator for trajectory tracking of a pendulum–cart system. Math. Probl. Eng. 2015, 2015, 247682. [Google Scholar] [CrossRef]
  41. Wang, L.X. A Course in Fuzzy Systems and Control; Prentice Hall PTR: Upper Saddle River, NJ, USA, 1997. [Google Scholar]
  42. Boyd, S.; El Ghaoui, L.; Feron, E.; Balakrishnan, V. Linear Matrix Inequalities in System and Control Theory; SIAM: Philadelphia, PA, USA, 1994. [Google Scholar]
  43. Wang, H.O.; Tanaka, K.; Griffin, M. Parallel Distributed Compensation of Nonlinear Systems by Takagi–Sugeno Fuzzy Model. In Proceedings of the 1995 IEEE International Conference on Fuzzy Systems, Yokohama, Japan, 20–24 March 1995. [Google Scholar]
Figure 1. EV3BRS’s generalized coordinates.
Figure 1. EV3BRS’s generalized coordinates.
Applsci 14 04103 g001
Figure 2. EV3BRS’s simplified model.
Figure 2. EV3BRS’s simplified model.
Applsci 14 04103 g002
Figure 3. Membership functions.
Figure 3. Membership functions.
Applsci 14 04103 g003
Figure 4. TSFC scheme.
Figure 4. TSFC scheme.
Applsci 14 04103 g004
Figure 5. Simulink® support package for LEGO Mindstorms EV3 hardware.
Figure 5. Simulink® support package for LEGO Mindstorms EV3 hardware.
Applsci 14 04103 g005
Figure 6. Hardware connections used for the experimental validation.
Figure 6. Hardware connections used for the experimental validation.
Applsci 14 04103 g006
Figure 7. Implementation on Simulink® of the TSFC in a real-time experiment.
Figure 7. Implementation on Simulink® of the TSFC in a real-time experiment.
Applsci 14 04103 g007
Figure 8. EV3BRS prototype.
Figure 8. EV3BRS prototype.
Applsci 14 04103 g008
Figure 9. Dynamics of the EV3BRS’s body around the z-axis corresponding to the plane of motion x z .
Figure 9. Dynamics of the EV3BRS’s body around the z-axis corresponding to the plane of motion x z .
Applsci 14 04103 g009
Figure 10. Dynamics of the EV3BRS’s body around the z-axis corresponding to the plane of motion y z .
Figure 10. Dynamics of the EV3BRS’s body around the z-axis corresponding to the plane of motion y z .
Applsci 14 04103 g010
Figure 11. Dynamics of the rotor shaft around the y-axis corresponding to the displacement of the EV3BRS on the plane of motion x z .
Figure 11. Dynamics of the rotor shaft around the y-axis corresponding to the displacement of the EV3BRS on the plane of motion x z .
Applsci 14 04103 g011
Figure 12. Dynamics of the rotor shaft around the x-axis corresponding to the displacement of the EV3BRS on the plane of motion y z .
Figure 12. Dynamics of the rotor shaft around the x-axis corresponding to the displacement of the EV3BRS on the plane of motion y z .
Applsci 14 04103 g012
Figure 13. Control signal for the actuator aligned with the y-axis.
Figure 13. Control signal for the actuator aligned with the y-axis.
Applsci 14 04103 g013
Figure 14. Control signal for the actuator aligned with the x-axis.
Figure 14. Control signal for the actuator aligned with the x-axis.
Applsci 14 04103 g014
Table 1. EV3BRS’s Parametric values.
Table 1. EV3BRS’s Parametric values.
ParameterSymbolValueUnits
Mass of the body m B 0.7448kg
Mass of the ball m b 0.0139kg
Radius of the wheel R w 0.0222m
Radius of the ball R b 0.026m
Body moment of inertia I B m B L 2 3 kg m2
Ball moment of inertia I b 2 m b R b 2 3 kg m2
Height of the centre of massL0.155m
Gravity acceleration g 9.81m/s2
Gear ratio, motor ball δ R w R b
DC motor moment of inertia I M 1 × 10−5kg m2
Friction between body and surface f B g 0Nms/rad
Friction between body and ball f B b 0.0022Nms/rad
DC motor torque constant k t 0.317Nm/A
DC motor resistance R m 6.69 Ω
DC motor back EMF constant k b 0.468V s/rad
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

Enemegio, R.; Jurado, F.; Villanueva-Tavira, J. Experimental Evaluation of a Takagi–Sugeno Fuzzy Controller for an EV3 Ballbot System. Appl. Sci. 2024, 14, 4103. https://doi.org/10.3390/app14104103

AMA Style

Enemegio R, Jurado F, Villanueva-Tavira J. Experimental Evaluation of a Takagi–Sugeno Fuzzy Controller for an EV3 Ballbot System. Applied Sciences. 2024; 14(10):4103. https://doi.org/10.3390/app14104103

Chicago/Turabian Style

Enemegio, Rodolfo, Francisco Jurado, and Jonathan Villanueva-Tavira. 2024. "Experimental Evaluation of a Takagi–Sugeno Fuzzy Controller for an EV3 Ballbot System" Applied Sciences 14, no. 10: 4103. https://doi.org/10.3390/app14104103

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