Skip to content

Rudder: control model, state machine and PLRS-IMU integration - #60

Closed
georgesleen wants to merge 147 commits into
mainfrom
rudder-working-branch
Closed

Rudder: control model, state machine and PLRS-IMU integration#60
georgesleen wants to merge 147 commits into
mainfrom
rudder-working-branch

Conversation

@georgesleen

Copy link
Copy Markdown
Contributor

Brings rudder-working-branch into main. 147 commits, none previously
merged, so main has none of the rudder control or IMU work.

What's in it

  • rudder-control-model module: PID/RUDDER, ESTIMATOR, STATE_MACHINE,
    and tunable RUDDER_PARAMS, with host-side tests
  • plrs-imu driver and protocol (PLRS_IMU_PROTOCOL.h) plus protocol tests
  • PLRS-IMU added as a git submodule under firmware/, bumped to mag-primary
    heading (#71)
  • RawAttitude (0x03) decode and a fused/raw attitude source selector, with the
    rudder defaulting to raw MTi
  • Heading telemetry published regardless of GNSS validity; steering gated on
    the GNSS-anchor flag
  • Rudder debug CAN TX failure made non-fatal

Verification

Not read back from hardware. The local build of this branch is dated the same
day as the branch tip and contains the PLRS-IMU work, but the rudder board
itself was not dumped, so "flashed matches source" is assumed here rather than
verified, unlike the wingsail PR.

Reviewer notes

Diff is large (624 files) but mostly vendored ST HAL drivers. Excluding
Drivers/, Debug/ and Release/ it is 158 files.

Worth deciding before merge, all pre-existing on the branch:

  • Two compiled binaries are tracked:
    firmware/drv-modules/rudder-control-model/test_pid.exe and
    test_state_machine.exe (~346 KB each). These look like build artifacts and
    probably should not be in the repo.
  • History includes several scratch commits ("checking out?", "building",
    "checking out controller bs", a revert of a same-branch merge). Consider
    whether to squash on merge.
  • Per the README this needs two sign-offs, one from an ELEC lead.

alisha1697 and others added 30 commits March 8, 2025 19:41
Should work? unless I overlooked something or tested it wrong

Signed-off-by: alisha1697 <143849351+alisha1697@users.noreply.github.com>
Signed-off-by: alisha1697 <143849351+alisha1697@users.noreply.github.com>
Signed-off-by: alisha1697 <143849351+alisha1697@users.noreply.github.com>
Signed-off-by: alisha1697 <143849351+alisha1697@users.noreply.github.com>
Signed-off-by: alisha1697 <143849351+alisha1697@users.noreply.github.com>
Signed-off-by: hml04 <160178026+hml04@users.noreply.github.com>
Signed-off-by: ELEC_lead-ubcsailbot <electrical@ubcsailbot.org>
Signed-off-by: ELEC_lead-ubcsailbot <electrical@ubcsailbot.org>
Signed-off-by: ELEC_lead-ubcsailbot <electrical@ubcsailbot.org>
Signed-off-by: ELEC_lead-ubcsailbot <electrical@ubcsailbot.org>
Signed-off-by: alisha1697 <143849351+alisha1697@users.noreply.github.com>
Added how to power the encoder on the PCB and adjusted a couple of settings in order to get the encoder working,

Signed-off-by: JoshuaO956 <148372526+JoshuaO956@users.noreply.github.com>
- receives out of range IDs

Signed-off-by: Alisha Siddiqui <143849351+alisha1697@users.noreply.github.com>
Signed-off-by: Alisha Siddiqui <143849351+alisha1697@users.noreply.github.com>
Signed-off-by: Alisha Siddiqui <143849351+alisha1697@users.noreply.github.com>
Signed-off-by: Alisha Siddiqui <143849351+alisha1697@users.noreply.github.com>
Signed-off-by: Alisha Siddiqui <143849351+alisha1697@users.noreply.github.com>
Signed-off-by: Alisha Siddiqui <143849351+alisha1697@users.noreply.github.com>
Signed-off-by: Alisha Siddiqui <143849351+alisha1697@users.noreply.github.com>
Signed-off-by: Alisha Siddiqui <143849351+alisha1697@users.noreply.github.com>
Signed-off-by: JoshuaO956 <148372526+JoshuaO956@users.noreply.github.com>
georgesleen and others added 26 commits June 21, 2026 17:15
* added parameter tuning for generic rudder controller paramters

* oops
A failed FDCAN debug-frame transmit called Error_Handler(), which traps the
whole controller (and stops IMU servicing) whenever no CAN bus is present,
e.g. on the bench. Count failures in can_tx_failures instead, and reset
can_frame_tx_time each attempt so TX keeps its 100ms cadence.
…N bus failures (this can probably be removed lowkey genuinely kirk but maybe it's useful?)
…tps://github.com/UBCSailbot/com-module-firmware into dev/georgesleen/imu_communication_module"

This reverts commit 5ee0054, reversing
changes made to cea67f1.
Co-Authored-By: Claude Fable 5 <claude-fable-5@anthropic.com>
Co-Authored-By: Claude Fable 5 <claude-fable-5@anthropic.com>
Bring in generic rudder param tuning (#56) and the CANFD heartbeat.
Conflicts resolved toward the IMU branch's control model: kept the real
irons() and the RudderSM_Update state machine over the working branch's
return-0 stub, and adopted the param-tuning CAN IDs (PID coeffs 0x200,
generic params 0x210). Pin the PLRS-IMU submodule to main (now ae4b540).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@georgesleen

Copy link
Copy Markdown
Contributor Author

Superseded by #62, which merges this branch together with the other two module branches into a single integration branch. The conflicts between the three (24 between wingsail and rudder, 1 between wingsail and pdb) are resolved there once rather than falling to whichever PR merges last. This PR can stay open for reference, but merging it directly would leave the other two conflicting against main.

@georgesleen

Copy link
Copy Markdown
Contributor Author

Closing in favour of #62, which contains this branch's tip along with the other three module branches. The conflicts between them are resolved once there rather than falling to whichever of these merged last. Nothing is lost: the tip of this branch is an ancestor of integration/modules-to-main.

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.

8 participants