Abstract
Balancing control of a rotary double inverted pendulum system is a challenging research topic for researchers in dynamics control field because of its nonlinear, high degree-of-freedom, under actuated and unstable characteristics. The system always works under uncertainties and disturbances. Many control algorithms fail or ineffectively control the rotary double inverted pendulum system. In this article, mixed sensitivity H∞ control is proposed to balance the rotary double inverted pendulum system. The controller is proposed to ensure the robust stability and enhance the time domain performance of the system under uncertainties and disturbances. Structure of the system, dynamics model and controller synthesis are presented. For performance evaluation, the proposed mixed sensitivity H∞ controller is compared with linear quadratic regulator from both simulation and experiment on the rotary double inverted pendulum system. The results show high performance of the proposed controller on the rotary double inverted pendulum system with model uncertainties and external disturbances.
Keywords
Introduction
Inverted pendulum system is a nonlinear, under actuated and unstable system. It has been used in control field to evaluate control performance and efficiency of several controllers. The inverted pendulum system can be classified into two groups, that is, moving cart type and rotary type. Researches of the moving cart type are reviewed as follows. Andreas Siuka and Markus Schöberl, 1 Linden and Lambrechts, 2 and Cheang and Chen 3 demonstrated how to control the single inverted pendulum on moving cart systems. The single inverted pendulum on moving cart system consists of only a pendulum and a moving cart in the system, which is the simplest inverted pendulum system. The system becomes more complicated with more pendulums in the system. Double inverted pendulum system may have serially connected two pendulums on a moving cart. Gretchen et al. 4 and Liu and Zhou 5 implemented and controlled this type of system. The other type of the double inverted pendulum system has two parallel pendulums on a moving cart. Nan Lu 6 developed and controlled this type of system. The control concept of inverted pendulum was applied to design a controller to balance rockets during a vertical take-off by Kurode et al. 7
Research works of the rotary type inverted pendulum systems are reviewed as follows. In Sukontanakarn and Parnichkun, 8 a rotary single inverted pendulum system was successfully controlled using optimal control. Rotary dual inverted pendulum system with two parallel pendulums attached to a rotary arm was designed and controlled by Pakdeepattarakorn et al. 9 In this article, a rotary double inverted pendulum (RDIP) system is developed and controlled. The system consists of serially connected two pendulums and a rotating arm driven by a motor. Balancing control of RDIP system is a challenging research topic for researchers in dynamics control field because of its nonlinear, high degree-of-freedom, under actuated and unstable characteristics. The system always works under uncertainties and disturbances.
Research works of RDIP system are reviewed as follows. The pole assignment method was proposed for periodic rotation of the outer pendulum while stabilizing the inner pendulum by Komine et al. 10 An RDIP developed by Pan et al. 11 was controlled by using the conventional linear quadratic regulator (LQR). Casanova et al. 12 used an RDIP system to evaluate a multi-loop control structure for a multivariable plant with different delays in the signals between controller and plant.
H∞ control is a robust control approach. It is suitable when the system is subjected to influences of external disturbances as shown by Jiang et al. 13 It has an ability to work in an inaccurate modeling and identification error system as shown in a pneumatic surgical robot system developed by Tuvayanond and Parnichkun. 14 Various types of H∞ controllers have been designed. Some of them have been tested on inverted pendulum systems. After the introduction of H∞ norm by Zames, 15 H∞ controller was developed by Doyle et al. 16 It was applied to control a single inverted pendulum (SIP) on moving cart by Linden and Lambrechts. 2 They studied an influence of dry friction on the inverted pendulum system and achieved good performance using H∞ controller.
In addition to the original H∞ controller, some improvements and modifications of H∞ controller were introduced. H∞ loop shaping developed by McFarlane and Glover 17 was implemented by combining the conventional loop shaping method with H∞ controller. Cheang and Chen 3 successfully controlled a single inverted pendulum on moving cart system by using the H∞ loop shaping. They proved that dynamic system under uncertainty was effectively controlled by loop shaping controller. Static H∞ loop shaping controller was applied to a double inverted pendulum on moving cart system by Liu and Zhou. 5 Their loop shaping weighting functions were optimized by genetic algorithm. The other approach of designing H∞ controller is mixed sensitivity approach. To achieve good closed loop performances, such as disturbance rejection, noise attenuation, and control input bandwidth, the mixed sensitivity approach relies on optimization that involves two or more sensitivity functions, the sensitivity function (S), the input sensitivity function (KS), and the complementary sensitivity function (T) as reviewed by Kwakernaak. 18 Thus mixed sensitivity approach can be differed mixed sensitivities, such as S/T in Peng et al. 19 and M. Rachedi et al., 20 S/KS in Wei-qian et al., 21 Ozana et al., 22 and Xinping Bao, 23 or S/KS/T in Alfaya et al., 24 Bejarano et al., 25 Delettre et al., 26 Iannino et al., 27 and Fragoso et al. 28 Peng et al. 19 proposed H∞ controller to solve the S/T problem for the pneumatic manipulator with parameter variation, and low or high frequency disturbances acting on the pneumatic manipulator as uncertainties. Rachedi et al. 20 used mixed sensitivity controller for position control of a “Delta” parallel robot. The controller showed better performance against disturbance forces applied on the traveling plate compared to Proportional Integral Derivative (PID) controller. S/KS mixed sensitivity approach was applied for vibration control of high-order flexible structures by Wei-qian et al. 21 The controller could satisfy tracking performance specification and internal stability. The same controller was also applied for elevation control of a helicopter by Ozana et al. 22 Xinping Bao 23 developed a rudder-based roll control system for the robotic boat. They designed a mixed sensitivity H∞ controller to control yaw and roll attitude. Alfaya et al. 24 and Bejarano et al. 25 applied S/KS/T-based multivariable H∞ controller for one-stage refrigeration cycle. Their results showed better tracking performance and robustness against disturbance over PID and model predictive controller. The same controller was applied for a planar manipulator of flexible and contactless handling, steam turbine power generation applications, and a lab-scale wind turbine by Delettre et al., 26 Iannino et al., 27 and Fragoso et al., 28 respectively. Their experiments showed better robust performance over the conventional controllers.
In this article, mixed sensitivity of S/KS/T H∞ is proposed to control a RDIP system. Control performance of the controller will be evaluated by both simulation and experiment on the nominal condition and the condition with external disturbances and parameter variation. In addition to robust stability, the other important control performance indices, including rise time, settling time, peak time, and peak value are also considered.
This article is organized as follows: in the second section, system architecture of the RDIP system is described. Mathematical model of the system is derived in the third section. A controller for the RDIP system is proposed and explained in the fourth section. Finally, the fifth section presents simulation and experimental results.
System architecture
Three-dimensional (3-D) model of the developed RDIP system is shown in Figure 1. The system consists of serially connected two pendulums mounted on an arm. Both pendulums can freely rotate about their pivot axes.

3-D model of the developed RDIP system. 3-D: three-dimensional; RDIP: rotary double inverted pendulum.
This under-actuated RDIP system has only one motor attached to the arm. The arm rotates on horizontal plane to balance both pendulums to the upright position on vertical axes. Photos of the developed RDIP system are shown in Figure 2.

Photos of the developed RDIP system. RDIP: rotary double inverted pendulum.
The components of the RDIP system shown in Figure 2 are listed in Table 1. In real implementation, the arm and both pendulums are made from aluminum. Three optical encoders with resolution of 1024 pulses per revolution are utilized to measure the angular positions of the arm and both pendulums. The angular velocities of the arm and both pendulums are calculated by using data from the three encoders.
Components of RDIP system.
RDIP: rotary double inverted pendulum.
Two encoders are used to measure the angular positions of the pendulums and directly connected with the pendulums joints by using mounting hubs. The third encoder used to measure the angular position of the arm is connected with the motor by using pulley and belt as shown in Figure 3. Photos of some parts of the RDIP system are shown in Figure 4.

Belt and pulley transmission system.

Parts of RDIP system. RDIP: rotary double inverted pendulum.
The arm of the RDIP system is driven by 150 W DC motor using belt and pulley transmission. In addition, since the system requires signals from the rotating arm, a slip ring is installed at the arm rotating axis. With this slip ring, the arm can be rotated freely without any constraints from the encoder wires. Parameters of the RDIP system are then identified. Some parameters are obtained from SOLIDWORKS program. Some parameters are obtained from direct measurement.
STM32F407 microcontroller with 32-bit ARM Cortex M4 core architecture is utilized to control the RDIP system. H-bridge DC motor driver with continuous current up to 80 A at 24 V capacity is applied to drive the DC motor.
Electrical circuit of the system is shown in Figure 5. Components of the electrical circuit are listed in Table 2.

Electrical circuit board of RDIP system. RDIP: rotary double inverted pendulum.
Components of electrical circuit.
Dynamic model
Schematic diagram of the RDIP system is shown in Figure 6. Dynamics model of the system is derived using Euler–Lagrange equation of motion which is expressed as equation (1)
where

Schematic diagram of the system.
There are three equations are obtained from equation (1)
In equations (1) and (2), Lagrangian (L), can be written as
where
Notation: For clarity, the following notations are used throughout the article. (*)A, (*)I, and (*)O represent parameters related to the arm, the inner pendulum, and the outer pendulum.
Total kinetic energy is the summation of the following kinetic energies.
Kinetic energy of the arm
When the distance between center of the mass and rotation axis of the rotating arm equals zero, kinetic energy becomes
Kinetic energy of the inner pendulum
Kinetic energy of the outer pendulum
From equations (5) to (7), total kinetic energy
Total potential energy is the summation of the following potential energies.
Potential energy of the arm
Potential energy of the inner pendulum
Potential energy of the outer pendulum
From equations (9) to (11), total potential energy
W is the energy lost in the system from viscosity friction. Total loss energy of the system can be expressed by using loss energy of the arm, inner pendulum, and outer pendulum
Notation: First derivation and second derivation of the (*) are defined as
In order to obtain dynamic model of the system, the Lagrangian of the RDIP system is derived by equation (3) and obtained as expressed in equation (14)
Definitions of the parameters in equation (14) and their values are listed in Table 3.
System parameters and values.
From equations (2), (13), and (14), equations of the system obtained as expressed by equations (15) to (17)
DC motor model
When the armature inductance is very small and negligible, the DC motor model is simplified. DC back emf and electromagnetic torque generated by the DC motor is proportional to the speed of the motor and the rotor current, respectively.
Equation of the motor voltage is
Equation (21) is substituted into equation (19).
where τ is the torque of the DC motor, Kt is the torque constant, Kv is back emf constant, R is armature resistance, V is input voltage, and
Parameters of the motor used in the RDIP system are listed in Table 4.
Motor parameters and values.
Equations (15) to (17) are rewritten by using equation (22)
Nonlinear dynamic model
Dynamics model of the system can be obtained as expressed in equation (26). M, C, G, and D represent inertia matrix, Coriolis matrix, gravity matrix, and disturbance matrix, respectively.
where
Nonlinear model of the system in equation (27) can be linearized at the upright position of the pendulums. The dynamics model is rearranged
State vector of the RDIP system consists of six states
The system model is linearized using small angle approximation
The linearized model at the upright position is obtained as
Parameters in Tables 3 and 4 are substituted into the state space model expressed by equation (29).
State matrix (A) and input matrix (B) become as follows
Controller design
LQR controller
LQR is an optimal controller. The optimal controller controls the system at the minimum cost.
Cost function of LQR is expressed by
where Q is state weighting matrix and R is input weighting matrix.
The following algebraic Riccati equation is used to determine the covariance matrix, P.
The controller gain, K, is determined by using
Mixed sensitivity H∞ controller
Mixed sensitivity of S/KS/T H∞ controller is proposed to balance the RDIP system. In this mixed sensitivity controller, three closed loop transfer functions in equation (32) are shaped by using H∞ optimization to achieve the desired performance
where
Therefore, the requirements cannot be fulfilled simultaneously at all frequency range. Normally, good tracking performance and overshoot reduction are required at low frequency range, noise attenuation and robust stability are required at high frequency range.
Therefore, the controller can be designed with small S(s) at low frequency and small T(s) at high frequency as per the desired control performances.
Structure of the mixed sensitivity of S/KS/T H∞ controller of the RDIP system is shown in Figure 7. In order to achieve the desired performance of the robust controller, three weighting functions

Structure of the mixed sensitivity H∞ controller. The nominal plant and the controller respectively presented by GN
and K. u is known as the control input vector. z
1, z
2, and z3 represent weighted error

Standard feedback system configuration.
In Figure 8, GA
illustrates the plant GN
augmented with We
, Wu
, and Wp
. The plant consists of two inputs and two outputs.
where
Substitution of all sensitivity functions in equation (32) into the performance signals,
Design objective of the controller is to determine the controller that minimizes the cost function of the system expressed by
When the cost function is defined as the infinity norm of N
Weighting function design
Selection of the weighting functions, We , Wu , and Wp , is important in designing the mixed sensitivity H∞ controller. Weighting function We is for the sensitivity, S(s). Shaping S(s) improves tracking performance and reduces overshoot of the response. The following diagonal matrix is selected for We as expressed in equation (39). Each diagonal element follows equation (40)
where A, ω0, and M represent the desired steady state error, bandwidth, and sensitivity peak, respectively.
Frequency response of the inverse of We
is shown in Figure 9. The figure shows that the magnitudes of

Frequency response of the inverse of sensitivity weighting functions.
The system dynamics model is always not exactly the same as the actual system. The difference is called model uncertainty. The model uncertainty is expressed by
where GN(s) represents nominal model. Δ(s) is model uncertainty. Frequency responses of arm, inner pendulum, and outer pendulum with model uncertainties are shown in Figure 10(a) to (c).

Frequency responses of the nominal model and the perturbed system: (a) arm, (b) inner pendulum, and (c) outer pendulum.
System perturbation is determined from
In order to design a robust controller to achieve the desired performance, the complementary sensitivity function has to satisfy
To evaluate robustness of the controllers, variation of moments of inertia of the arm and both pendulums
where
Shaping T(s) is desirable for noise attenuation and for robust stability with respect to multiplicative output uncertainty. Stability of the closed loop system with variation of the model parameters and measured noise attenuation are ensured by WP .
The following diagonal matrix is selected for WP .
Each diagonal element follows equation (46).
Frequency responses of the inverse of the selected complementary sensitivity weighting functions are shown in Figure 11. The figure shows that the magnitudes of

Frequency response of the inverse of complementary sensitivity weighting functions.

The system uncertainties and the complementary sensitivity weighting functions.
It can be seen that all the uncertainties, Δ(s), are below the respective weighting functions. Hence, the selected weighting functions satisfy equation (43).
Wu
is the weighting function of
Simulation and experimental results
This section shows simulation and experimental results of the mixed sensitivity H∞ controller in comparison with LQR. To find optimal gain, KLQR, of LQR, the state weighting matrix, Q, and the input weighting matrix, R, are selected as follows
In the RDIP system, the most important states are angles of the inner and the outer pendulums. Therefore, weights of these states are set to high values than the other states. With these weighting matrices, angles of the inner and the outer pendulums are equally weighted. Based on the selected weighting matrices, the optimal gain of LQR is obtained as follows.
In the mixed sensitivity H∞ controller, weighting functions are defined as explained in weighting functions design session and the state space model of the system in equation (29) are used. The controller K is obtained as follows
where
Simulation results
Balancing performance of the nominal RDIP system using the mixed sensitivity H∞ controller and LQR is shown in Figures 13 and 14. The initial states are set at

Time domain responses of inner pendulum (nominal).

Time domain responses of outer pendulum (nominal).
As shown in Figures 13 and 14, the settling time of the inner and the outer pendulums using LQR is only around 97% and 94% of the mixed sensitivity H∞ controller, respectively. The peak value of the inner and the outer pendulums using LQR is only around 33% and 29% of the mixed sensitivity H∞ controller, respectively.
Even though both controllers have similar settling time, the other performances on the nominal plant using LQR are better than the mixed sensitivity H∞ controller. The results prove that both the mixed sensitivity H∞ controller and LQR can balance both inner and outer pendulums under nominal condition. However, LQR has better control performance than the mixed sensitivity H∞ controller on the nominal system.
Uncertainty from parameter variation
In order to evaluate robustness of the controllers, moments of inertia of the arm and the pendulums are varied from their nominal values for ±10%. Step response comparison of the arm with moment of inertia variation is shown in Figures 15 and 16.

Step response of the arm using LQR under uncertainty. LQR: linear quadratic regulator.

Step response of the arm using the mixed sensitivity H∞ controller under uncertainty.
The results show that settling time and rise time of the proposed controller is less than LQR. There is no overshoot in the proposed controller. The proposed mixed sensitivity H∞ controller gives better performance than LQR under parameter variation.
In order to further confirm the control performance, step response comparison of the arm at the minimum (case 1) and the maximum (case 2) moments of inertia are considered. Figure 17(a) and (b) shows the comparison of step response obtained from both controllers at the minimum (case 1) and maximum (case 2) moments of inertia.

Step response comparison of the arm at (a) minimum and (b) maximum moments of inertia.
In this simulation, the following values are applied
where
Subscript A, I, and O represent arm, inner, and outer pendulum. It is clearly seen that the proposed mixed sensitivity H∞ controller can stabilize the system without overshoot and shorter settling time than LQR at both case 1 and case 2.
Disturbance rejection
In order to evaluate disturbance rejection performance of the proposed controller, a perturbation with 0.0349 rad amplitude is applied on the inner pendulum and the outer pendulum at the 10th second. Figures 18 and 19 show disturbance rejection performance of the system when the inner and outer pendulums are disturbed.

Time response of (a) inner pendulum and (b) outer pendulum when inner pendulum is perturbed.

Time response of (a) inner pendulum and (b) outer pendulum when outer pendulum is perturbed.
The results show that after the deviation from the upright position of both pendulums for some period of time, both controllers re-stabilize the system. However, the time domain performances of the proposed controller, such as settling time, peak value, and rise time, are shorter than LQR as summarized in Table 5.
Comparison of the time domain performance specification for disturbance rejection.
LQR: linear quadratic regulator.
The results show that peak value of the inner and the outer pendulums of the mixed sensitivity H∞ controller are only 23% and 27.5% of LQR when the inner pendulum is perturbed and only 9.7% and 11% when the outer pendulum is perturbed. It clearly proves that all time domain performances of the mixed sensitivity H∞ controller are better than LQR under perturbation.
Tracking performance
In order to evaluate tracking performance of the RDIP system, various steps reference trajectory is applied. Tracking performance of the proposed controller is shown in Figure 20. From the result, the arm can track the reference trajectory without overshoots while balancing both pendulums using the proposed controller.

Response of the system in tracking the reference step trajectory of the arm using the proposed controller.
Experimental results
In order to verify the robustness of the proposed controller, several experiments are conducted on the developed RDIP system. USB to TTL module based on CH340 chip is used in collecting experimental data from the system. Figures 21 and 22 illustrate balancing performance on the nominal system using LQR and the proposed mixed sensitivity H∞ controller, respectively.

Balancing performance on the nominal system using LQR. LQR: linear quadratic regulator.

Balancing performance on the nominal system using the proposed controller.
The experimental results show that both pendulum angles fluctuate around ±0.01 rad. Even though the pendulum angles fluctuate, both controllers are able to stabilize the system. The experimental results show that the inner and outer pendulums can be balanced at the upright position by using both controllers at the nominal condition.
To evaluate disturbance rejection performance, a disturbance is applied to the inner pendulum. The disturbance force makes a change of pendulum angle. Figure 23 shows experimental result of pendulum angles using LQR under disturbance. From the result, LQR cannot stabilize the system under the disturbance.

Experimental results of the pendulum angles under disturbance using LQR. LQR: linear quadratic regulator.
Figure 24 shows experimental result of the system using the proposed mixed sensitivity H∞ controller under disturbance. From the result, responses of both pendulums oscillate due to the applied disturbance force; however, the proposed mixed sensitivity controller is able to stabilize both pendulums to the upright position within short time period.

Experimental results of the pendulum angles under disturbance using the proposed controller.
The system states deviation due to applied several impulse disturbances are shown in Figure 25. The control input is shown in Figure 26. From the result, the control input fluctuates with the applied disturbances. However, it is still within the supplied capacity. Snapshots from the balancing experiment of RDIP system are shown in Figure 27.

Experimental results of both pendulums and arm under disturbance using mixed sensitivity H∞ controller.

Control input of the system.

Snapshots from balancing experiment of RDIP system. RDIP: rotary double inverted pendulum.
Conclusion
Mixed sensitivity of S/KS/T H∞ controller was proposed to balance a RDIP system. The real RDIP system was built as per design. Hardware of the system was realized and explained in detail. The RDIP system was driven by a DC motor at the rotating arm. STM32F407 microcontroller was selected as the controller of the system. Dynamic model of the system was derived using Lagrange equation of motion. Mixed sensitivity control synthesis and weighing functions selection were presented. The proposed mixed sensitivity H∞ controller was applied to control the RDIP system. The proposed mixed sensitivity H∞ controller was evaluated in comparison with LQR by both simulation and experiment. In the simulation, balancing performance on the nominal system, tracking performance, disturbance rejection, and robustness performance under uncertainty were considered. Experiments were conducted to prove the results from the simulation. Even though the pendulum angles fluctuated around the upright position with small variation, both controllers could stabilize the nominal system. However, it was observed that transient response of the nominal system using LQR was better than the proposed controller. However, the proposed mixed sensitivity H∞ controller showed better performance than LQR with the presence of disturbances and uncertainties. LQR could not stabilize the RDIP system under the disturbance while the proposed mixed sensitivity H∞ controller could successfully control the RDIP system.
Footnotes
Declaration of conflicting interests
The author(s) declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.
Funding
The author(s) received no financial support for the research, authorship, and/or publication of this article.
