#### Abstract

This paper treats the problems of stability analysis and control synthesis of the switched inverted pendulum system with nonlinear/linear controllers. The proposed control strategy consists of switching between backstepping and linear state feedback controllers on swing-up and stabilization zones, respectively. First, the backstepping controller is implemented to guarantee the rapid convergence of the pendulum to the desired rod angle from the vertical position. Next, the state feedback is employed to stabilize and maintain the system on the upright position inherently unstable. Based on the quadratic Lyapunov approach, the switching between the two zones is analyzed in order to determine a sufficient domain in which the stability of the desired equilibrium point is justified. A real-time experimentation shows a reduction of of the samples below the classical scheme when using only the backstepping control in the entire operating region. Furthermore, the reduction percentage has become 92% in comparison with the composite linear/linear controller.

#### 1. Introduction

For several years, stability analysis and control synthesis of switched systems have received an increasing interest. This class of systems consists of a finite number of subsystems and a logical rule that orchestrates switching between them. Mathematically, these subsystems are usually described by differential equations. Examples of such switched systems can be found in chemical processes [1], power converters [2], automotive industry, electrical circuits [3], and many other fields.

The most control structure of switched systems used in literature is to design the same number of linear subsystems and linear subcontrollers. Therefore, necessary and sufficient stability conditions are in general based on switched quadratic Lyapunov functions [4]. However, the main disadvantage of this structure consists of the complexity in designing several controllers and that does not easily account for all interactions between them. Lately, some researchers suggested another switching structure by applying only one controller [5]. Thus, a common quadratic Lyapunov function is used for all subsystems which ensures the asymptotic quadratic stability [5]. Despite the simplicity of this structure, there are many control and performance problems that could profit from it, for instance, the existence of systems that cannot be asymptotically stabilized by a single control law.

Among the large variety of analysis and control problems of switched systems is the guarantee of a sufficient stability domain of the desired equilibrium point. In fact, the knowledge if a given initial state lies within such a stable region is a question of practical importance in many engineering applications as the synthesis of the preferment nonlinear controller [6]. Therefore, the majority of studies concerned with this object are setting in the Lyapunov method which is essentially applied to complex and nonlinear systems. Nevertheless, stability analysis of switched systems used in general is the Popov criterion [7], the circle criterion [8], and the positive-real lemma.

In this paper, we have focused on an alternative switched control structure which includes both backstepping and linear feedback control laws. Indeed, this strategy ensures the rapidity of the system behavior in the closed loop and the minimization of subsystems and subcontroller numbers. Thereafter, the switch between these models has been analyzed using the quadratic Lyapunov approach and Sylvester’s criterion.

One of the most important mechanical systems which treats extensively the issues cited above is the inverted pendulum. This system, inherently unstable with highly nonlinear dynamics, belongs to the class of underactuated systems having fewer control inputs than degrees of freedom. This renders the control task more challenging making this process a classical benchmark for testing and comparing different control techniques.

The evolution space of the considered system can be decomposed into two operating zones: swing-up and stabilization zones in which nonlinear and linear feedback controllers are applied, respectively.

This paper is organized as follows: Section 2 depicts the proposed alternative switched control strategy. Section 3 outlines the mathematical model and the design of nonlinear/linear composite controller of the inverted pendulum system. Section 4 deals with determination of a sufficient domain in which the stability of the equilibrium point is justified.

#### 2. Problem Formulation

A switched system consists of a finite number of dynamical subsystems and a switching unit that orchestrates between them. Indeed, the most control structure used, as depicted in Figure 1, contains the same number of linear models , for , and linear subcontrollers , for . At each switching time instant, only one model and its subcontroller are active.

Therefore, some important results of necessary and sufficient stability conditions have been obtained in [9, 10]. However, the major disadvantage of this structure is in the design of several subcontrollers and that does not easily account for all interactions between them.

Some other researchers suggested another switched control structure, shown in Figure 2, which consists of the design of a linear centralized controller for all linear models . This technique is simple to implement since it requires the design of only one controller.

On the contrary, there are many control and performance problems that could profit from this approach; for instance, various objectives cannot be met by a single controller.

In this paper, we have focused on an alternative switched structure, as can be seen in Figure 3. Therefore, we have designed linear and nonlinear controllers in swing-up and stabilization zones, respectively. Indeed, this method ensures the rapidity of the closed-loop system behavior and the minimization of subsystems and subcontroller numbers. Thereafter, the switch between the two zones has been analyzed in order to determine a sufficient stability domain using the quadratic Lyapunov approach and Sylvester’s criterion.

This alternative switch structure can be perfectly applied to the inverted pendulum system, the mechanical model of which is illustrated in Figure 4 [11, 12].

This process consists of a rod and a moving cart in the horizontal direction. Its parameters are defined in Table 1.

The educational kit of the considered process, shown in Figure 5, consists of a track of 1 m length with limit switches between and , PC Pentium 4 with PCI-1711 card, cable adaptor, optical encoders with HCTL2016 ICs, digital pendulum controller, cart, DC motor, pendulum with weight, Advantech PCI-1711 device driver, and adjustable feet with belt tension adjustment.

In the next section, the proposed control structure will be applied to the inverted pendulum system in order to show its efficiency.

#### 3. Switched Control Design

Our work aims to design a nonlinear (NL) control law, in the swing-up zone, to guarantee the rapid convergence of the pendulum from down position into the stabilization zone. Then, the switch to the linear (L) controller permits to stabilize it at the desired open-loop unstable equilibrium point.

##### 3.1. Mathematical Modeling

The mathematical model of the inverted pendulum is depicted by the following nonlinear equations:where (m) is the position of the cart, (m/s) is the velocity, (rad) is the rod angle from the vertical position, (rad/s) is the angular velocity, and (N) is the force.

ForEquation (1) can be rewritten as follows:with

##### 3.2. Composite NL/L Controller

The proposed control strategy is based on switching between backstepping and linear state feedback on swing-up and stabilization zones, respectively. Therefore, the switching rule of the global control law is distributed into and in swing-up and stabilization zones, respectively, as depicted in Figure 6.

###### 3.2.1. Linear Feedback Control in the Stabilization Zone

In this zone, system (3) can be linearized using the small-angle approximations which are as follows: , and . Then, it can be described by the following linear state equation:with

Based on the pole placement technique, we have applied the linear state feedback controller:where is the state feedback gain. From equations (5) and (7), we have in closed loop:where .

###### 3.2.2. Backstepping Controller in Swing-Up Zone

Backstepping control is known as a construction approach in the sense that it has a systematic way of constructing the Lyapunov function along with the control input design. To ensure the negativeness of the derivative of the every step Lyapunov function, it usually requires the cancelation of the indefinite cross-coupling terms [13].

This NL controller is used to move the cart until attains . The design of in the swing-up zone is illustrated as below:

* Step 1. *A new control variable is defined aswhere is the desired setpoint. Then, the derivative of is obtained asThe function of stabilization is presented as follows:where is a positive constant.

* Step 2. *A second error is given by the following equation:The derivative of is described as follows:Thereafter, the backstepping control law is depicted aswhere is a positive constant.

#### 4. System Analysis in the Stabilization Zone: Estimation of a Stability Domain

It is necessary to guarantee the switched NL/L controlled system stability, when it is provided by the linear feedback control law (7). Therefore, we have to determine the sufficient stability domain:where is a real-positive constant and is the positive definite quadratic Lyapunov function expressed as follows:

The symmetric positive definite matrix is determined by solving the Lyapunov equation:where . Asymptotic stability of the equilibrium of the nonlinear model (3) provided of a feedback linear control law (7) is guaranteed when the derivative of :is negative definite.

Equation (18) can be rewritten aswhereand the parameters are detailed in Appendix.

As also, the matrix can be transformed in the following symmetric form:

By applying Sylvester’s criterion, the closed-loop system is asymptotically stable if . Accordingly, the elementary determinants , for , should satisfywhere .

Subsequently, by solving the inequality system (22), the condition leads to which can be rewritten aswhere . Thus, we state the following result.

Theorem 1. *The equilibrium point of the nonlinear system (3) provided of a feedback linear control law (7) is asymptotically stable in the attraction domain:if there exist a positive definite matrix , a solution of Lyapunov equation (17), and a not unitary orthogonal matrix S such that .*

*Proof 1. *The proof of the above theorem is based on the quadratic Lyapunov function described by equation (16) and its time derivative given by equation (19). Therefore, based on the eigen decomposition, the matrix *P* can be reduced in the form:where is an orthogonal matrix and *D* is a diagonal matrix. Then, by writing , we obtainwhere .

Consequently, the quadratic Lyapunov function can be expressed by the following equation:where . Then, the condition leads to inequality (23) which becomesOn the contrary, we haveFrom conditions (28) and (29), we consider thator otherwise,Therefore, the asymptotic stability domain given in (24) is justified.

#### 5. Results and Discussion

This section deals with the results obtained using the composite NL/L controller in real time. Indeed, we have set the backstepping controller parameters in the swing-up zone: and . In the stabilization zone, by selecting the desired closed-loop poles: , we have determined the following state feedback controller gain: .

Furthermore, by applying the proposed theorem, we have numerically obtained the following:

Hence, the evolution of the four elementary determinants is depicted in Figures 7–10, respectively.

Based on the proposed strategy, we have carried out the real-time control experiment of the inverted pendulurm system. Therefore, the composite backstepping/linear state controller feedback has been implemented to swing rapidly the pendulum from its initial position into the desired angle and, then, to guarantee its stabilization.

The experimental results of position (m), angle (rad), and force (N) are shown in Figure 11.

**(a)**

**(b)**

**(c)**

To valid the above experimental study, we have verified, at the switch time corresponding to , that where the real-time values of the considered state variables are given by , , , and .

In conclusion, real-time results show that the NL/L controller provides excellent performance. In fact, this type of control guarantees more rapidity with comparison to the response of the backstepping controller in the entire operating region, illustrated in Figure 12, and on the contrary with the response of the composite L/L controller, depicted in Figure 13. Indeed, the swing-up phase has taken 15.4 and 42 seconds to stabilize the inverted pendulum when using the NL controller in the entire operating zone and the composite L/L controller, respectively.

**(a)**

**(b)**

**(c)**

**(a)**

**(b)**

**(c)**

The reader can find a video that shows the performance of the real-time composite backstepping/linear state feedback controller implemented for the inverted pendulum system: https://www.youtube.com/watch?reload=9v=m2PsGHmlH04feature=youtu.be.

#### 6. Conclusion

In this paper, we have applied an alternative switched control structure consisting of backstepping and linear state feedback controllers in swing-up and stabilization zones, respectively. Indeed, the nonlinear controller was implemented to guarantee the rapid convergence of the pendulum from down position into the stabilization zone. Then, the switch to the linear controller stabilizes it at the equilibrium point.

Based on the quadratic Lyapunov approach and Sylvester’s criterion, we have determined a sufficient stability domain in which the equilibrium point of the considered closed-loop system is justified.

A real-time experimentation shows the effectiveness of the proposed control strategy and proves a reduction of of the samples below the conventional scheme when applying only the backstepping controller in the entire operating region. Furthermore, the reduction percentage has become in comparison with the composite linear/linear controller.

#### Appendix

The parameters of the triangular matrix , given in equation (20), are as follows:

#### Data Availability

No data were used to support this study.

#### Conflicts of Interest

The authors declare that they have no conflicts of interest.

#### Supplementary Materials

The video that shows the performance of the real-time composite backstepping/linear state feedback controller implemented for the inverted pendulum system.* (Supplementary Materials)*