Skip to main content

Module racing_mppi_powertrain

Module racing_mppi_powertrain 

Source
Expand description

Reference-free racing MPPI with a motor-lag and battery-sag powertrain.

This deepens crate::racing_mppi_motor one more level: between the commanded rotor thrusts and the rigid-body physics it inserts a powertrain with two unmodeled-by-the-planner effects that every real racing quad has.

  1. First-order motor lag. A rotor cannot change thrust instantly; the actual thrust tracks the command through a first-order spin-up lag with time constant motor_tau. Aggressive attitude flicks are therefore smeared in time — the torque the body actually feels lags the command.
  2. Battery sag. The available per-rotor thrust ceiling is not constant. It droops instantaneously with electrical load (internal resistance) and permanently as the pack’s state of charge falls over the run. A drone that flies hard early has less authority late in the race.

The powertrain is built by composition: it reuses MotorQuadParams::step verbatim for the translational and rotational physics and only adds the actuator front-end (lagged rotor thrusts plus a battery state). With the PowertrainParams::ideal constructor — zero lag, no discharge, no sag — it reduces exactly to the motor-level model, which is the baseline the benchmark compares against.

Structs§

ChargeBudget
Powertrain-aware MPPI controller.
PowertrainLapReport
Lap-progress, attitude, and powertrain (lag + battery) metrics.
PowertrainMppiController
PowertrainParams
Powertrain parameters layered on top of the base motor model.
PowertrainState
State of the powertrain-level quadrotor.

Functions§

simulate_powertrain_race
Drive the powertrain-unaware MPPI controller through the real powertrain.
simulate_powertrain_race_aware
Drive the powertrain-aware MPPI controller through the real powertrain.
simulate_powertrain_race_budgeted
Drive a charge-budgeted powertrain-aware controller through the powertrain.