## 3 CDHS Controller with Luenberger Observer
### The Luenberger Observer  
The flexible deformation of the joint harmonic reducer is the most sensitive component that reacts to changes in joint stiffness and external load inertia. However, due to the reliability requirements of the space environment, a sensor for detecting harmonic deformation cannot be installed inside the joint. Instead, the working state of the internal transmission mechanism of the joint can be estimated through a state observer [32]. In this paper, a Luenberger state observer is constructed based on the joint dynamics model. The specific calculation process is as follows:  
Take the reducer position \(q_{g}\) and the reducer speed \(\dot{q}_{g}\) as the state observation vector \(\mathbf{x}\), and take the motor position \(q_{m}\), motor speed \(\dot{q}_{m}\), motor acceleration \(\ddot{q}_{m}\), joint output position \(q_{l}\), and joint output speed \(\dot{q}_{l}\) that can be directly measured as the input vector \(\mathbf{U}\).  
\[\mathbf{X}=\left[q_{g},\dot{q}_{g}\right]^{T} \tag{16}\]  
\[\mathbf{U}=\left[q_{m},q_{l},\dot{q}_{m},\dot{q}_{l},\dot{q}_{m}\right] \tag{17}\]  
Figure 5: The structure of CDHS controller.  
According to the joint dynamics state space model Formula (5), the following formula is obtained.  
\[\dot{\mathrm{x}}_{1}=\mathrm{x}_{2} \tag{18}\]  
\[\dot{\mathrm{x}}_{2}=-\frac{\mathrm{k}_{g}+\mathrm{k}_{b}}{\mathrm{I}_{g}} \mathrm{x}_{1}-\frac{\mathrm{d}_{mg}+\mathrm{d}_{gl}+\mathrm{d}_{g}}{\mathrm{I}_ {g}}\mathrm{x}_{2}+\mathbf{BU} \tag{19}\]  
\[\mathbf{Y}=-\mathrm{k}_{g}\mathrm{x}_{1}-\mathrm{d}_{mg}\mathrm{x}_{2}+ \mathbf{DU} \tag{20}\]  
where \(\mathbf{B}\) and \(\mathbf{D}\) are the coefficients corresponding to the state observer.  
\[\mathbf{B}=\begin{bmatrix}0&0&0&0&0\\ \frac{k_{g}}{l_{g}}&\frac{k_{b}}{l_{g}}&\frac{d_{mg}}{l_{g}}&\frac{d_{pb}}{l_{g }}&0\end{bmatrix} \tag{21}\]  
\[\mathbf{D}=\begin{bmatrix}k_{g}&d_{mg}&d_{m}&0&I_{m}\end{bmatrix} \tag{22}\]  
Define a Luenberger state observer based on the above calculation.  
\[\left\{\begin{aligned} \dot{\mathbf{X}}&=& \mathbf{AX}+\mathbf{Bu}_{q}+\mathbf{L}(\mathbf{y}-\mathbf{Cx})\\ &\mathbf{Y}=\mathbf{CX}+\mathbf{DU}\end{aligned}\right. \tag{23}\]  
\[\mathbf{A}=\begin{bmatrix}0&1\\ -\frac{k_{g}+k_{b}}{l_{g}}&-\frac{d_{mg}+d_{gl}+d_{g}}{l_{g}}\end{bmatrix} \tag{24}\]  
\[\mathbf{C}=\begin{bmatrix}-k_{g}&-d_{mg}\end{bmatrix} \tag{25}\]  
Let the estimation error be \(e=x-\dot{x}\). Then, the observation error dynamic equation is as follows:  
\[\dot{e}=(\mathbf{A}-\mathbf{LC})\boldsymbol{e} \tag{26}\]  
The characteristic state equation of the system is as follows:  
\[|\mathbf{\Lambda}\mathbf{I}-(\mathbf{A}-\mathbf{LC})|=0 \tag{27}\]  
\[\mathbf{L}=\begin{bmatrix}\lambda_{1}\\ \lambda_{2}\end{bmatrix} \tag{28}\]  
\[\lambda^{2}+\begin{bmatrix}k_{g}+\frac{\left(1+l_{g}\right)d_{mg}+d_{g}+d_{gl }}{l_{g}}\end{bmatrix}\lambda+\frac{\left(1+l_{g}+d_{g}+d_{gl}\right)k_{g}+k_{ b}\big{(}1-d_{mg}\big{)}d_{g}}{l_{g}}=0 \tag{29}\]  
The characteristic equation of the state observer is calculated to obtain \(\lambda_{1}\) and \(\lambda_{2}\), and then the estimated value \(\hat{\boldsymbol{x}}\) of the state observation vector \(\mathbf{x}\) is calculated in real-time according to Equation (29).