Skip to content

Commit

Permalink
Added missing matrix elements and fixed syntax issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
iamazadi committed Sep 10, 2024
1 parent 909a8d4 commit b8fb21d
Showing 1 changed file with 27 additions and 11 deletions.
38 changes: 27 additions & 11 deletions docs/src/reactionwheelunicycle.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Description = "How the reaction wheel unicycle works."

``\dot{z} = 0``

``\frac{d}{dt}(\frac{\partial L}{\dot{q}_i}) - \frac{\partial L}{q_i} = Q_i + \sum_{k=1}^n {\lambda}_k a_{ki}``
``\frac{d}{dt}(\frac{\partial L}{\partial \dot{q}_i}) - \frac{\partial L}{\partial q_i} = Q_i + \sum_{k=1}^n {\lambda}_k a_{ki}``

``i = 1, \ldots, m``

Expand All @@ -24,12 +24,28 @@ Description = "How the reaction wheel unicycle works."

``{}_{w2}^{g}T = {}_{cp}^{g}T \times {}_{w2}^{cp}T = \begin{bmatrix} cos(\delta) & -sin(\delta) cos(\alpha) & sin(\delta) sin(\alpha) & x + r_w sin(\delta) sin(\alpha) \\ sin(\delta) & cos(\delta) cos(\alpha) & -cos(\delta) sin(\alpha) & y - r_w cos(\delta) sin(\alpha) \\ 0 & sin(\alpha) & cos(\alpha) & r_w cos(\alpha) \\ 0 & 0 & 0 & 1 \end{bmatrix}``

``{}^{w2}P_w = \begin{bmatrix} 0 \\ 0 \\ 0 \\ 1 \end{bmatrix}``

``{}^gP_w = {}_{w2}^gT \times {}^{w2}P_w = \begin{bmatrix} x + r_w sin(\alpha) sin(\delta) \\ y - r_w sin(\alpha) cos(\delta) \\ r_w cos(\alpha) \\ 1 \end{bmatrix}``

``{}_c^{w2}T = \begin{bmatrix} cos(\beta) & 0 & sin(\beta) & 0 \\ 0 & 1 & 0 & 0 \\ -sin(\beta) & 0 & cos(\beta) & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix} \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & l_c \\ 0 & 0 & 0 & 1 \end{bmatrix} = \begin{bmatrix} cos(\beta) & 0 & sin(\beta) & l_c sin(\beta) \\ 0 & 1 & 0 & 0 \\ -sin(\beta) & 0 & cos(\beta) & l_c cos(\beta) \\ 0 & 0 & 0 & 1 \end{bmatrix}``

``{}_c^gT = {}_{w2}^gT \times {}_c^{w2}T = \begin{bmatrix} {}_c^gt_{11} & -sin(\delta) cos(\alpha) & {}_c^gt_{13} & {}_c^gt_{14} \\ {}_c^gt_{21} & cos(\delta) cos(\alpha) & {}_c^gt_{23} & {}_c^gt_{24} \\ -cos(\alpha) sin(\beta) & sin(\alpha) & cos(\alpha) cos(\beta) & {}_c^gt_{34} \\ 0 & 0 & 0 & 1 \end{bmatrix}``

``{}_c^gt_{11} = cos(\beta) cos(\delta) - sin(\alpha) sin(beta) sin(\delta)``

``{}_c^gt_{13} = sin(\beta) cos(\delta) + sin(\alpha) cos(\beta) sin(\delta)``

``{}_c^gt_{14} = x + r_w sin(\delta) sin(\alpha) + l_c sin(\beta) cos(\delta) + l_c sin(\alpha) cos(\beta) sin(\delta)``

``{}_c^gt_{21} = cos(\beta) sin(\delta) + sin(\alpha) sin(\beta) cos(\delta)``

``{}_c^gt_{23} = sin(\beta) sin(\delta) - sin(\alpha) cos(\beta) cos(\delta)``

``{}_c^gt_{24} = y - r_w cos(\delta) sin(\alpha) + l_c sin(\beta) sin(\delta) - l_c sin(\alpha) cos(\beta) cos(\delta)``

``{}_c^gt_{34} = r_w cos(\alpha) + l_c cos(\alpha) cos(\beta)``

``{}^cP_c = \begin{bmatrix} 0 \\ 0 \\ 0 \\ 1 \end{bmatrix}``

``{}^gP_c = {}_c^gT \times {}^cP_c = \begin{bmatrix} {}^gp_{c1} \\ {}^gp_{c2} \\ {}^gp_{c3} \\ 1 \end{bmatrix}``
Expand All @@ -38,9 +54,9 @@ Description = "How the reaction wheel unicycle works."

``{}^gp_{c2} = y - r_w sin(\alpha) cos(\delta) - l_c cos(\beta) sin(\alpha) cos(\delta) + l_c sin(\beta) sin(\delta)``

``{}^gp_{c3} = r_w * cos(\alpha) + l_c cos(\beta) cos(\alpha)``
``{}^gp_{c3} = r_w cos(\alpha) + l_c cos(\beta) cos(\alpha)``

``{}_r^cT = \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & l_cr \\ 0 & 0 & 0 & 1 \end{bmatrix} \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & cos(\gamma) & -sin(\gamma) & 0 \\ 0 & sin(\gamma) & cos(\gamma) & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix} \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & l_r \\ 0 & 0 & 0 & 1 \end{bmatrix} = \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & cos(\gamma) & -sin(\gamma) & -l_r sin(\gamma) \\ 0 & sin(\gamma) & cos(\gamma) & l_cr + l_r cos(\gamma) \\ 0 & 0 & 0 & 1 \end{bmatrix}``
``{}_r^cT = \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & l_{cr} \\ 0 & 0 & 0 & 1 \end{bmatrix} \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & cos(\gamma) & -sin(\gamma) & 0 \\ 0 & sin(\gamma) & cos(\gamma) & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix} \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & l_r \\ 0 & 0 & 0 & 1 \end{bmatrix} = \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & cos(\gamma) & -sin(\gamma) & -l_r sin(\gamma) \\ 0 & sin(\gamma) & cos(\gamma) & l_{cr} + l_r cos(\gamma) \\ 0 & 0 & 0 & 1 \end{bmatrix}``

``{}_r^gT = {}_c^gT \times {}_r^cT = \begin{bmatrix} {}_r^gt_{11} & {}_r^gt_{12} & {}_r^gt_{13} & {}_r^gt_{14} \\ {}_r^gt_{21} & {}_r^gt_{22} & {}_r^gt_{23} & {}_r^gt_{24} \\ -cos(\alpha) sin(\beta) & {}_r^gt_{32} & {}_r^gt_{33} & {}_r^gt_{34} \\ 0 & 0 & 0 & 1 \end{bmatrix}``

Expand All @@ -50,43 +66,43 @@ Description = "How the reaction wheel unicycle works."

``{}_r^gt_{13} = sin(\delta) cos(\alpha) sin(\gamma) + cos(\delta) sin(\beta) cos(\gamma) + sin(\delta) sin(\alpha) cos(\beta) cos(\gamma)``

``{}_r^gt_{14} = l_r sin(\delta) cos(\alpha) sin(\gamma) + (l_cr + l_r cos(\gamma)) (cos(\delta) sin(\beta) + sin(\delta) sin(\alpha) cos(\beta)) + l_c sin(\beta) cos(\delta) + l_c cos(\beta) sin(\delta) sin(\alpha) + x + r_w sin(\delta) sin(\alpha)``
``{}_r^gt_{14} = l_r sin(\delta) cos(\alpha) sin(\gamma) + (l_{cr} + l_r cos(\gamma)) (cos(\delta) sin(\beta) + sin(\delta) sin(\alpha) cos(\beta)) + l_c sin(\beta) cos(\delta) + l_c cos(\beta) sin(\delta) sin(\alpha) + x + r_w sin(\delta) sin(\alpha)``

``{}_r^gt_{21} = cos(\beta) sin(\delta) + sin(\alpha) sin(\beta) cos(\delta)``

``{}_r^gt_{22} = cos(\delta) cos(\alpha) cos(\gamma) + sin(\delta) sin(\beta) sin(\gamma) - cos(\delta) sin(\alpha) cos(\beta) sin(\gamma)``

``{}_r^gt_{23} = -cos(\delta) cos(\alpha) sin(\gamma) + sin(\delta) sin(\beta) cos(\gamma) - cos(\delta) sin(\alpha) cos(\beta) cos(\gamma)``

``{}_r^gt_{24} = -l_r cos(\delta) cos(\alpha) sin(\gamma) + (l_cr + l_r cos(\gamma)) (sin(\delta) sin(\beta) - cos(\delta) sin(\alpha) cos(\beta)) + l_c sin(\beta) sin(\delta) - l_c cos(\beta) cos(\delta) sin(\alpha) + y - r_w cos(\delta) sin(\alpha)``
``{}_r^gt_{24} = -l_r cos(\delta) cos(\alpha) sin(\gamma) + (l_{cr} + l_r cos(\gamma)) (sin(\delta) sin(\beta) - cos(\delta) sin(\alpha) cos(\beta)) + l_c sin(\beta) sin(\delta) - l_c cos(\beta) cos(\delta) sin(\alpha) + y - r_w cos(\delta) sin(\alpha)``

``{}_r^gt_{32} = sin(\alpha) cos(\gamma) + cos(\alpha) cos(\beta) sin(\gamma)``

``{}_r^gt_{33} = -sin(\alpha) sin(\gamma) + cos(\alpha) cos(\beta) cos(\gamma)``

``{}_r^gt_{34} = -l_r sin(\alpha) sin(\gamma) + (l_cr + l_r cos(\gamma)) cos(\alpha) cos(\beta) + l_c cos(\beta) cos(\alpha) + r_w cos(\alpha)``
``{}_r^gt_{34} = -l_r sin(\alpha) sin(\gamma) + (l_{cr} + l_r cos(\gamma)) cos(\alpha) cos(\beta) + l_c cos(\beta) cos(\alpha) + r_w cos(\alpha)``

``{}^rP_r = \begin{bmatrix} 0 \\ 0 \\ 0 \\ 1 \end{bmatrix}``

``{}^gP_r = {}_r^gT \times {}^rP_r = \begin{bmatrix} {}^gp_{r1} \\ {}^gp_{r2} \\ {}^gp_{r3} \\ 1 \end{bmatrix}``

``{}^gp_{r1} = x + r_w sin(\alpha) sin(\delta) + (l_c + l_cr) cos(\beta) sin(\alpha) sin(\delta) + (l_c + l_cr) sin(\beta) cos(\delta) + l_r cos(\gamma) cos(\beta) sin(\alpha) si(\delta) + l_r cos(\gamma) sin(\beta) cos(\delta) + l_r sin(\gamma) cos(\alpha) sin(\delta)``
``{}^gp_{r1} = x + r_w sin(\alpha) sin(\delta) + (l_c + l_{cr}) cos(\beta) sin(\alpha) sin(\delta) + (l_c + l_{cr}) sin(\beta) cos(\delta) + l_r cos(\gamma) cos(\beta) sin(\alpha) sin(\delta) + l_r cos(\gamma) sin(\beta) cos(\delta) + l_r sin(\gamma) cos(\alpha) sin(\delta)``

``{}^gp_{r2} = y - r_w sin(\alpha) cos(\delta) - (l_c + l_cr) cos(\beta) sin(\alpha) cos(\delta) + (l_c + l_cr) sin(\beta) sin(\delta) - l_r cos(\gamma) cos(\beta) sin(\alpha) cos(\delta) + l_r cos(\gamma) sin(\beta) sin(\delta) - l_r sin(\gamma) cos(\alpha) cos(\delta)``
``{}^gp_{r2} = y - r_w sin(\alpha) cos(\delta) - (l_c + l_{cr}) cos(\beta) sin(\alpha) cos(\delta) + (l_c + l_{cr}) sin(\beta) sin(\delta) - l_r cos(\gamma) cos(\beta) sin(\alpha) cos(\delta) + l_r cos(\gamma) sin(\beta) sin(\delta) - l_r sin(\gamma) cos(\alpha) cos(\delta)``

``{}^gp_{r3} = r_w cos(\alpha) + (l_c + l_cr) cos(\beta) cos(\alpha) + l_r cos(\gamma) cos(\beta) cos(\alpha) - l_r sin(\gamma) sin(\alpha)``
``{}^gp_{r3} = r_w cos(\alpha) + (l_c + l_{cr}) cos(\beta) cos(\alpha) + l_r cos(\gamma) cos(\beta) cos(\alpha) - l_r sin(\gamma) sin(\alpha)``

``V_w = \frac{dP_w}{dt}``

``V_c = \frac{dP_c}{dt}``

``V_r = \frac{dP_r}{dt}``

``{\Omega}_w = \begin{bmatrix} 0 \\ \dot{\theta} \\ 0 \\ 0 \end{bmatrix} + \begin{bmatrix} \dot{\alpha} \\ 0 \\ 0 \\ 0 \end{bmatrix} + {}_g^{w2}T \times \begin{bmatrix} 0 \\ 0 \\ \dot{\delta} \\ 0 \end{bmatrix} = \begin{bmatrix} 0 \\ \dot{\theta} \\ 0 \\ 0 \end{bmatrix} + \begin{bmatrix} \dot{\alpha} \\ 0 \\ 0 \\ 0 \end{bmatrix} + {}_{w2}^gT^{-1} \times \begin{bmatrix} 0 \\ 0 \\ \dot{\delta} \\ 0 \end{bmatrix} = \begin{bmatrix} \dot{\alpha} \\ \dot{\theta} + \dot{\delta} sin(\alpha) \\ \dot{\delta} cos{\alpha} \end{bmatrix}``
``{\Omega}_w = \begin{bmatrix} 0 \\ \dot{\theta} \\ 0 \\ 0 \end{bmatrix} + \begin{bmatrix} \dot{\alpha} \\ 0 \\ 0 \\ 0 \end{bmatrix} + {}_g^{w2}T \times \begin{bmatrix} 0 \\ 0 \\ \dot{\delta} \\ 0 \end{bmatrix} = \begin{bmatrix} 0 \\ \dot{\theta} \\ 0 \\ 0 \end{bmatrix} + \begin{bmatrix} \dot{\alpha} \\ 0 \\ 0 \\ 0 \end{bmatrix} + {}_{w2}^gT^{-1} \times \begin{bmatrix} 0 \\ 0 \\ \dot{\delta} \\ 0 \end{bmatrix} = \begin{bmatrix} \dot{\alpha} \\ \dot{\theta} + \dot{\delta} sin(\alpha) \\ \dot{\delta} cos(\alpha) \end{bmatrix}``

``{\Omega}_c = \begin{bmatrix} 0 \\ \dot{\beta} \\ 0 \\ 0 \end{bmatrix} + {}_{w2}^cT \times \begin{bmatrix} \dot{\alpha} \\ 0 \\ 0 \\ 0 \end{bmatrix} + {}_g^cT \times \begin{bmatrix} 0 \\ 0 \\ \dot{\delta} \\ 0 \end{bmatrix} = \begin{bmatrix} 0 \\ \dot{\beta} \\ 0 \\ 0 \end{bmatrix} + {}_c^{w2}T^{-1} \times \begin{bmatrix} \dot{\alpha} \\ 0 \\ 0 \\ 0 \end{bmatrix} + {}_c^gT^{-1} \times \begin{bmatrix} 0 \\ 0 \\ \dot{\delta} \\ 0 \end{bmatrix} = \begin{bmatrix} \dot{\alpha} cos(\beta) - \dot{\delta} cos(\alpha) sin(\beta) \\ \dot{\beta} + \dot{\delta} sin(\alpha) \\ \dot{\alpha} sin(\beta) + \dot{\delta} cos(\alpha) cos(\beta) \\ 0 \end{bmatrix}``

``{}_r^{w2}T = {}_{w2}^gT \times {}_r^gT``
``{}_r^{w2}T = {}_{w2}^gT^{-1} \times {}_r^gT``

``{\Omega}_r = \begin{bmatrix} \dot{\gamma} \\ 0 \\ 0 \\ 0 \end{bmatrix} + {}_c^rT \times \begin{bmatrix} 0 \\ \dot{\beta} \\ 0 \\ 0 \end{bmatrix} + {}_{w2}^rT \times \begin{bmatrix} \dot{\alpha} \\ 0 \\ 0 \\ 0 \end{bmatrix} + {}_g^rT \times \begin{bmatrix} 0 \\ 0 \\ \dot{\delta} \\ 0 \end{bmatrix} = \begin{bmatrix} \dot{\gamma} \\ 0 \\ 0 \\ 0 \end{bmatrix} + {}_r^cT^{-1} \times \begin{bmatrix} 0 \\ \dot{\beta} \\ 0 \\ 0 \end{bmatrix} + {}_r^{w2}T^{-1} \times \begin{bmatrix} \dot{\alpha} \\ 0 \\ 0 \\ 0 \end{bmatrix} + {}_r^gT^{-1} \times \begin{bmatrix} 0 \\ 0 \\ \dot{\delta} \\ 0 \end{bmatrix} = \begin{bmatrix} \dot{\gamma} + \dot{\alpha} cos(\beta) - \dot{\delta} cos(\alpha) sin(\beta) \\ {\omega}_{r2} \\ {\omega}_{r3} \\ 0 \end{bmatrix}``

Expand Down

0 comments on commit b8fb21d

Please sign in to comment.