CHAPTER 4: CONTROLLER DESIGN AND SIMULATION RESULTS
4.6 SWING UP CONTROL OF INVERTED PENDULUM
The objective in swing up control is to move the pendulum from the downward position to the unstable upright position by moving the cart horizontally. As noted in chapter two, several techniques have been applied in the solution of this problem with the most common methods being the energy control, the passivity based control or the use of the position and velocity of the pendulum to determine how the cart should be moved such that the pendulum gains enough momentum to swing up[34]. The position and velocity control (PV) approach as well as the passivity control methods are both demonstrated in this section.
4.6.1 SWING UP BY POSITION VELOCITY(PV) CONTROL [34]
PV control uses the pendulum angle and angular velocity to generate the reference cart positions to be used by an independent controller designed to steer the cart to any desired position. A state feedback control for the cart position is designed which controls the cart using its position and chosen to drive the pendulum away from the pendant position using the smallest displacement of the cart as possible. is the reference distance fed to the cart.
4.6.2 TUNING AND SIMULATION OF PV CONTROL SWING UP
The complete Simulink/MATLAB design for the controller is shown in Appendix A(Figs A7.1-A7.3).
The gains and are chosen using a trial and error approach but keeping in mind that larger values would generate bigger reference values for the cart and therefore violate the constraint on cart length. Tuning the parameters for almost equal values of the ratios and was found to guarantee swing up as long as exceeds and exceeds . Also a dynamic saturation is included in the output of the PV controller to restrict the range of values it calculates to the maximum and minimum cart distance of . After swing up, control is switched to the sliding mode controller designed in section 4.2.4 at . The wide domain of attraction of the sliding mode controller is exploited here as the PV controller can only swing the pendulum to about without violating the constraints on the cart length. The feedback linearized controller with zero dynamics control(FL/ZDC) was also used to stabilize the pendulum successfully. Figure
50
4.12 shows the response of the pendulum using controller with parameters set at
, and with a cart reference of 0.3m to track after swing up. From Figure 4.12, it is observed that swing up occurs after about 40 seconds and the sliding mode controller stabilizes the pendulum in about 1second. The control voltage and cart variation are both within the constraints of the system. The peak variation of the cart distance is observed to lie between and while the control action varies between .
Figure 4.12 :Swing Up, Tracking and Stabilization of pendulum with PV and FL/SMC
Figure 4.13:Swing Up, Tracking and Stabilization of PV control with noise and disturbance
51
Figure 4.13 shows the PV controller can resist disturbance(at 10s,20s,35s,70s,80s,90s) of about 0.2 in both output with small noise also added and all system constraints met. This shows it is robust. Chattering on the controller due to the discontinuous nature of sliding mode control is observed but it is small and can be ignored.
4.6.3 SWING UP BY ENERGY CONTROL USING PASSIVITY OF PENDULUM [18,4]
This method of swinging up the pendulum exploits the fact that the pendulum is a dissipative system. According to [4], this means there is no internal creation of energy within the system and so the storage energy function of the system at any time is less than or equal to the sum of equilibrium point(upright position) to itself. The swing up control tasks therefore lies in designing the control action to take the system to this homoclinic orbit by using an appropriate Lyapunov function candidate[18].
To apply this technique, the system in the form of (3.13) is shown in (4.53) for convenience.
To check the passivity of the system, we evaluate the derivative of the total energy of the system and check if it satisfies the mathematical condition for passivity in (4.52). Note that is symmetric and has a determinant which is always positive
making a positive definite matrix for all . Also it can be observed that : (4.55)
An important result to be used later when establishing the passivity of the pendulum.
52
PASSIVITY OF THE INVERTED PENDULUM(IP): Let =Total Energy of Pendulum, then
(4.56) where is the Kinetic Energy and is the Potential Energy of the pendulum when
starting from the downward pendent position.
(4.57) But
(4.58) Hence, (4.59) But from (4.54), (4.60) Putting (4.60) in (4.59) and simplifying, we obtain
(4.61) Substituting (4.55) in (4.61) we get
(4.62) Integrating (4.62) on both sides we get:
(4.63) Assuming at time the pendulum swings from an angle of , then , and (4.64) Equation (4.64) establishes the passivity property of the inverted pendulum. The homoclinic orbit of the pendulum can therefore be computed as the trajectory corresponding to zero energy and zero velocity of cart. i.e. and ; Substituting these values in the energy equation in (4.57) gives the homoclinic orbit as:
. (4.65) Our goal now is to design a controller that is attracted to the homoclinic orbit above. Consider now, the Lyapunov function candidate :
(4.66)
53
We defined in terms of the variables that need to be stabilized(made zero) in order to be in the homoclinic orbit . The control action can therefore be designed to make negative definite.
; We desire to be negative definite for asymptotic stability, so we let
(4.71) Equating (4.70) to (4.71) and making the subject after relevant computations yields the control
action designed as,
54
swing up to occur. From Fig. 4.14, the pendulum swings constantly at increasing amplitudes from an original position of until it reaches where the switchover to a linear stabilizing LQR controller is done. It can be observed from Fig. 4.14 that the swing up occurs after about seconds and the LQR controller stabilizes the pendulum in less than 1 second. The energy of the pendulum can be seen from Fig. 4.14 to approach zero from a value of after 4seconds. The control action used is within the constraints of the system and lies between . The cart distance varies between which satisfies the constraint on cart length. This swing up strategy was observed to have a wide domain of attraction as it could swing the pendulum up to about of the vertical equilibrium position while meeting all system constraints.
This controller can therefore be combined with any stabilizing controller in a hybrid control structure to swing up the inverted pendulum.
Figure 4.15 shows the performance of the swing up controller in the presence of noise(noise power: 0.004units) and disturbances. It is evident from the figure that the controller maintains good swing up and tracking performance while rejecting disturbance and noise. The effect the noise had on the controller was to delay the swing up time from 4seconds to 6seconds and to reduce the domain of attraction of the swing up controller from to about if all constraints within the system must be met. The control action lies within the constrained value of .
Figure 4.14:Swing Up using Energy and Passivity of Pendulum
55
Figure 4.15:Swing Up and tracking with disturbance and noise of Passivity -Energy control