# The Optimal Erection of the Inverted Pendulum
###### Abstract  
The erection of the inverted pendulum is a classic control problem, which has appeared in several variants. One of the most challenging is the minimum-time erection of a pendulum that is mounted on a moving cart. The aim is to erect the pendulum from the'straight-down' (stable equilibrium) to a'straight-up' (unstable equilibrium) position in minimum time. The swing-up maneuver is usually addressed using a pre-defined control strategy, e.g., energy-based control or selecting the switching times in a bang-bang structure. The aim of this paper is to show that the minimum-time solution _may_ have a singular arc, with the optimal control taking a _bang-singular-bang_ form. The singular arc segment of the control law is a feedback law that is derived herein with the solution discussed. A sensitivity analysis of the solution structure is also performed by varying the model parameters. Finally, the time-optimal solution is compared with that obtained using an energy-based control strategy.  
inverted pendulum; optimal control; bang-bang; singular arc; optimization; dynamics; multibody systems +
Footnote †: journal: Applied  
controlled horizontal motion of the carriage is used to erect the pendulum and place it in'straight-up' (unstable) equilibrium. In this case, a standard controller is typically designed to ensure stability around the upright position--a swing-up controller is employed to erect the pendulum from the straight-down position. Energy-based control strategies have been widely employed in the swing-up controller design [14; 15; 16]. The basic idea to use the energy rate as the controlled variable in order to increase the total pendulum energy. Using this idea, rule-based fuzzy control is used; see, for example, [17; 18]. Proportional-velocity controllers have been also used [19; 20], with the idea of moving the cart left and right repeatedly with a PID controller, until the pendulum reaches the straight-up position. This research assumed a pre-defined control strategy for the swing-up controller, but without time requirements to perform the maneuver.  
This work deals with the minimum-time erection of an inverted pendulum within a nonlinear optimal-control framework. An early treatment of this problem is tackled in Section 9.3.13 of the classic optimal control book [21] and in [22], where the solution structure is 'assumed' to have a bang-bang structure, with a fixed number of switching times determined by optimization. In [23], the time-optimal swing-up is considered from a theoretical perspective by using geometric control theory. The controlled variable is the cart accelerations and it is shown that, with the formulated problem, no singular arcs are possible.  
In this paper, a deeper investigation of the time-optimal control problem is carried out, but without a pre-defined control structure assumed and by controlling the cart force (instead of its acceleration). In contrast to prior investigations, it is shown that a singular arc may occur under certain circumstances--under these circumstances the control structure is bang-singular-bang in form. The control law in the singular sub-arc is derived analytically and compared with the (sub-optimal) bang-bang solution. A sensitivity analysis with respect to the model parameter and initial condition is performed to highlight the circumstances under which a singular arc occurs. Finally, the optimal solution is compared with an energy-based control strategy.  
A dynamic model of the system is derived in Section 2. The optimal control problem is studied in Section 3. The simulation results are presented in Section 4, with the conclusions given in Section 5.