Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent base rotation representation in Simulink Plant model #6

Open
nickfaraco opened this issue Feb 1, 2024 · 0 comments
Open

Comments

@nickfaraco
Copy link

I'm under the impression that there's a mismatch in the attitude representation of the base (quaternion q0) in the Plant model of the simulink library. The kinematic equation of the quaterion derivative in the State_Intergrator block assumes the q0 quaternion to be the one associated with the rotation matrix that tranforms vectors expressed in the inertial frame into the same vector expressed in the base spacecraft frame. This is in accordance with the fact that, inside the Matrices block, the DCM associated with q0 is transposed before being fed to the Kinematics function, as it requires the matrix to be the one that expresses body-frame vectors in the inertial frame.

The TEE pose retrieved from the Kinematics&Dynamics block therefore expresses the rotation from the end-effector frame to the inertial one (the columns of the matrix are the components of the end-effector frame axes in the inertial frame), as one would expect. In the EndEffector block, however, the DCM extracted from TEE is transposed again before retrieving the quaternion qEE, causing the aforementioned mismatch. The xEE state therefore contains the conjugate of the quaternion it should.

This could be solved in two ways:

  • Change the formulation of the quaternion derivative in the State_Integrator block and completely remove the two transpose blocks in the Matrices and EndEffector blocks. This should be preferred in order for q0 to be always expressed in a consistent manner, in accordance to the required input of the Kinematics function and others
  • Alternatively, it would be sufficient to remove the transpose from the EndEffector block. Easier solution, but q0 in output would still be the conjugate of the quaternion, with respect to the convention used throughout the rest of the library.

Some tests and verifications have shown results in accordance with my hypotesis. If you think I'm wrong, please let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant