# Design and Implementation of Model Predictive Control for a Gyroscopic Inverted Pendulum
## 1 Introduction  
The gyroscopic effect has many applications over a wide range of technical fields. Since this effect generates large torque with fast responses, it is used for both the active and passive stabilization of unstable dynamic systems. A conventional application of the gyroscopic effect is the stabilization of a ship's roll motion, as discussed by [PERSON] and [PERSON] [1]. In aerospace and astronautic engineering, the gyroscopic effect is used in attitude guidance systems for spacecraft and satellites [2; 3]. [PERSON] and [PERSON] [4; 5] applied it to develop a balance assistance device for humans. Single-track vehicles, such bicycles, are highly unstable at low speeds. The history and state-of-the-art discussions on topic of bicycle dynamics and control were reviewed comprehensively by [PERSON] and [PERSON] [6]. In a study of bicycle stability, [PERSON] et al. [7] analysed the eigenvalues of a linearized bicycle model that was experimentally validated by [PERSON] [8]. Results of these works showed the relationship of the bicycle's stability with its longitudinal speed. To explain the self-stablizing characteristic of a bicycle, [PERSON] et al. [9] built a two-mass-skate bicycle model. After conducting experiments with this bicycle model, the authors found three parameters that were very important for self-stability: the front wheel spin angular momentum, the trail, and front-assembly mass distribution. Adjusting one of these three parameters can passively enhance the self-stable ability of a bicycle. To actively stabilize a bicycle, there are several methods, such as steering using the handle bar [10; 11; 12], moving the centre of mass [13; 14], and using a gyroscope. In applications using gyroscopes to stabilize single-track vehicles, [PERSON] et al. [15] derived a mathematical model of a bicycle augmented with a gyroscope. However, no control strategies for this system were proposed. [PERSON] et al. in their work [16] used a control moment gyro as an actuator to stabilize a small bicycle. By using proportional-derivative (PD) controllers, a stationary bicycle with initial angle of \(11.6^{\circ}\) was stabilized and continued to oscillate around the upright position with steady-state errors of \(\pm 1.5^{\circ}\). [PERSON] et al. [17] designed an autonomous bicycle steered by the gyroscopic effect of a flywheel, where a sliding mode control algorithm is used for stabilization control of a static bicycle. The experimental results showed good performance in disturbance rejection, though chattering appeared in the control inputs. When applying robustness control, [PERSON] and [PERSON] [18] proposed using particle swarm optimization-based \(H_{2}/H_{\infty}\) controller to balance a gyroscope-controlled bicycle. Though this prototype could move forward and backward at a low speed, its motions seem unnatural since the lean angle of the bicycle was kept as zero all the time to avoid the continuous rotation of the flywheel's gimbal angle. [PERSON] et al. [19] designed a gyroscopic balancer for a riderless bicycle, and then verified their fuzzy sliding mode control with a standstill bicycle under impact disturbances. [PERSON] and [PERSON] [20] extended this work by developing a more complicated control algorithm. Their adaptive fuzzy sliding mode controller stabilized the bicycle when moving forward, though it failed to control the bicycle under the impact of constant disturbances by centrifugal forces. To stabilize a bicycle using a gyroscope, an inverted pendulum-like model has been used to simplify the controller design processes [17; 18; 19; 20]. Furthermore, the use of an inverted pendulum for control algorithm design and verification is very common in studies of balancing problems. For example, [PERSON] et al. [21] used this approach to simulate an electric bicycle with power steering systems. [PERSON] et al. [22] used a gyroscopic inverted pendulum to benchmark an adaptive control algorithm for a single-wheel pendulum robot.