# Dynamic Stability of an Electric Monowheel System Using LQG-Based Adaptive Control
## 6 Reference Model Assisted Adaptive Control  
Adaptive control law and adaptive laws [36; 37] are formulated using a reference model-assisted adaptive control structure to make the system adaptive to various changes in parameters. The dynamic equations [38] of our system are  
\[\dot{x}_{1}(t)=x_{3}(t), \tag{12}\]  
\[\dot{x}_{2}(t)=x_{4}(t), \tag{13}\]  
\[\dot{x}_{3}(t)=-\frac{B}{M}x_{3}(t)-\frac{S}{M}p_{1}x_{2}(t)+\frac{1}{M}u(t), \tag{14}\]  
\[\dot{x}_{4}(t)=\frac{B}{M}p_{2}x_{3}(t)+gp_{2}x_{2}(t)+\frac{S}{M}p_{3}x_{2}(t )-\frac{1}{M}p_{2}u(t), \tag{15}\]  
where \(B\) is the constant coefficient of friction, \(M\) is the mass of the monowheel, and \(g\) is the acceleration due to gravity. \(p_{1}\), \(p_{2}\) and \(p_{3}\) are the variable parameters, where \(p_{1}=m\), \(p_{2}=\frac{1}{l}\) and \(p_{3}=\frac{m}{l}\). Here, \(m\) represents the rider mass and \(l\) represents the rider height,  
Figure 16: Velocity response of the system at different masses. (**a**) Weight = 30 kg. (**b**) Weight = 180 kg. which will vary from person to person. Equations (14) and (15) have been derived in [38] through analyses similar to those mentioned in Sections 3 and 3.1. For ease of analysis, certain mathematical adjustments have been made. Let us define  
\[x_{5}(t)=x_{4}(t)+p_{2}x_{3}(t), \tag{16}\]  
and so through differentiation on both sides, we get  
\[\dot{x}_{5}(t)=\dot{x}_{4}(t)+\dot{p}_{2}x_{3}(t)=p_{2}\,g\,x_{2}(t). \tag{17}\]  
Our nominal model is thus chosen as  
\[\dot{x}_{1}(t) = x_{3}(t),\] \[\dot{x}_{2}(t) = x_{5}(t)-p_{2}x_{3}(t),\] \[\dot{x}_{3}(t) = -\frac{B}{M}x_{3}(t)-\frac{g}{M}p_{1}x_{2}(t)+\frac{1}{M}u(t),\] \[\dot{x}_{2}(t)=x_{4}(t), \tag{13}\]0  
Expressing in state-space format,\( \begin{bmatrix}\dot{x}_{1}\\ \dot{x}_{2}\\ \dot{x}_{3}\\ \dot{x}_{5}\end{bmatrix} = \begin{bmatrix}0&0&1&0\\ 0&0&-p_{2}&1\\ 0&-\frac{g}{M}p_{1}&-\frac{B}{M}&0\\ 0&gp_{2}&0&0\end{bmatrix}\begin{bmatrix}x_{1}\\ x_{2}\\ x_{3}\\ x_{5}\end{bmatrix} + \begin{bmatrix}0\\ 0\\ \frac{1}{M}\\ 0\end{bmatrix} u(t)\). We are only interested in the velocity and angle response; i.e., the states \(x_{3}\) and \(x_{2}\). Since the state \(x_{1}\) does not directly govern any of the other states, as well as being irrelevant to our further analysis, it has been eliminated in order to reduce redundancy. Hence, the new state space equations after re-writing states \([x_{2},x_{3},x_{5}]\) as \([z_{1},z_{2},z_{3}]\) are given as  
\[\dot{z}_{1} = -p_{2}z_{2}+z_{3}, \tag{18}\] \[\dot{z}_{2} = -\frac{g}{M}p_{1}z_{1}-\frac{B}{M}z_{2}+\frac{1}{M}u(t),\] (19) \[\dot{z}_{3} = gp_{2}z_{1}. \tag{20}\]  
The corresponding reference model has been chosen as follows:  
\[\dot{z}_{1} = -\dot{p}_{2}z_{2}+\dot{z}_{3}, \tag{21}\] \[\dot{\delta}_{2} = -\frac{g}{M}\dot{\rho}_{1}\dot{z}_{1}-\frac{B}{M}\dot{\delta}_{2} +\frac{1}{M}\dot{a}(t),\] (22) \[\dot{\delta}_{3} = g\dot{p}_{2}\dot{z}_{1}. \tag{23}\]  
The state error is defined as \(e_{i}=\dot{x}_{i}-x_{i}\), where \(i=1,2,3\) for this system. The tracking error dynamics corresponding to each state are formulated as follows  
\[\dot{e}_{1} = -\dot{p}_{2}e_{2}-\dot{p}_{2}z_{2}+e_{3}, \tag{24}\] \[\dot{e}_{2} = -\frac{g}{M}\dot{\rho}_{1}e_{1}-\frac{g}{M}\dot{\rho}_{1}z_{1}- \frac{B}{M}e_{2}+\frac{1}{M}(\dot{a}-u),\] (25) \[\dot{e}_{3} = g\dot{p}_{2}e_{1}+g\dot{p}_{2}z_{1}, \tag{26}\]  
where \(\dot{p}_{i}=\dot{p}_{i}-p_{i}(i=1,2)\). From these tracking errors, the adaptive update laws are  
\[\dot{\rho}_{1} = \frac{\alpha_{2}g}{\beta_{1}M}z_{1}(t)e_{2}(t), \tag{27}\] \[\dot{z}_{2} = -\frac{g}{M}p_{1}z_{1}-\frac{B}{M}z_{2}+\frac{1}{M}u(t),\]0  
where \(\beta_{i}>0\), \(i=1,2\) are adaptation gains to provide desired control authority over the transient behavior. Coefficients \(\alpha_{i}>0\), \(i=1,2,3\) are chosen to provide a constrained solution such that the suffix pertains to the error dynamics in which the parameter error term appears. The adaptive control law is chosen as  
\[\dot{z}_{2} = -\frac{g}{M}p_{1}z_{1}-\frac{B}{M}z_{2}+\frac{1}{M}u(t),\]1