Skip to content

refactor: fix controls algorithm not gimbaling correctly#41

Draft
Random121 wants to merge 7 commits into
embedded-software/stagefrom
embedded-software/refactor/fix-controls
Draft

refactor: fix controls algorithm not gimbaling correctly#41
Random121 wants to merge 7 commits into
embedded-software/stagefrom
embedded-software/refactor/fix-controls

Conversation

@Random121
Copy link
Copy Markdown
Contributor

No description provided.

@Random121 Random121 requested a review from Shengw3n April 6, 2026 01:16
@Random121 Random121 changed the base branch from main to embedded-software/stage April 6, 2026 01:16
Comment thread embedded-software/firmware/ulysses-flight-controller/Core/Src/tasks/controls.c Outdated
Comment thread embedded-software/firmware/ulysses-flight-controller/Core/Src/tasks/controls.c Outdated
Random121 and others added 5 commits April 19, 2026 10:19
Flight controls algorithm should only be ran during flight to prevent error accumulation in PID controller.
- compute_command_torque: add Kp and Kd gain matrices + angular rate
  feedback (spec eq 3.8). Was using raw phi with no gains or damping.
- update_thrust_direction: use -z convention (spec eq 5.6). Was using
  +z which flipped s_t_hat from [0,0,-1] to [0,0,+1] after first step.
- compute_gimbal_angles: match spec eq 5.7 signs for -z convention.
- compute_gyroscopic_torque: omega x (I*omega), not (I*omega) x omega.
- compute_thrust_magnitude: negate dot product for -z thrust convention.
- Update all 93 unit tests to match corrected pipeline. 0 failures.
@Shengw3n Shengw3n force-pushed the embedded-software/refactor/fix-controls branch from 09818d5 to 9b245da Compare April 19, 2026 17:20
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

Successfully merging this pull request may close these issues.

3 participants