Architecture — Speed and Yaw-Rate Loops

← Back to Lab 2 overview

In progress. Block diagrams and full parameter tables to be added. The vector source for the architecture diagram lives at book/w07_lab_usv_pid/chapter/usv_control_architecture.drawio.

Speed (Surge) Loop

TBD — block diagram, parameter table, logging channels.

The PID block tuned in this lab uses the ATC_SPEED_* parameter group. The target enters from the RC throttle stick scaled by CRUISE_SPEED; the measurement is GPS ground speed.

Yaw-Rate (Steering) Loop

TBD — block diagram, parameter table, logging channels.

The PID block tuned in this lab uses the ATC_STR_RAT_* parameter group. The target enters from the RC steering stick scaled by ACRO_TURN_RATE; the measurement is the EKF estimate of body-frame yaw rate.

Logging Channels

The signals analyzed in this lab and their source log messages:

Signal Log channel Units Notes
Speed setpoint THR_DesSpeed m/s Output of the speed PID’s input filter
Speed (measured) GPS_Spd m/s GPS ground speed; rate set by GPS1_RATE_MS
Throttle command RCOU_C3 PWM Normalized to [−1, +1] in MATLAB analysis
Yaw-rate setpoint STER_DesTurnRate rad/s Output of the yaw-rate PID’s input filter
Yaw rate (measured) STER_TurnRate rad/s EKF estimate
Rudder command RCOU_C1 PWM Normalized to [−1, +1] in MATLAB analysis
Speed PID internals PIDT_* Tar, Act, P, I, D, FF, Out
Yaw-rate PID internals PIDS_* Tar, Act, P, I, D, FF, Out

PIDT_Tar / PIDS_Tar are the controller-internal targets (after rate limiting, when active). PIDT_Act / PIDS_Act are the measured-value inputs to the PID. The four term fields decompose the controller output; their sum is Out.

Tunable Parameters

TBD — distinguish between preset values that should not change during the lab and the gains students adjust in experiment C.