Skip to content

Feedforward power limiting - #1992

Draft
efabiyi wants to merge 4 commits into
masterfrom
vc_power_limiting
Draft

Feedforward power limiting#1992
efabiyi wants to merge 4 commits into
masterfrom
vc_power_limiting

Conversation

@efabiyi

@efabiyi efabiyi commented May 3, 2026

Copy link
Copy Markdown
Contributor

Change List

  • motor_table.h : AMK A2370DD characterization data as compile-time constexpr arrays.
  • motor_table.cpp: interpolation logic for the lookup tables
  • current_limiter.hpp/ .cpp: Current limiting. Call init() once at startup, update() every control cycle. Takes per-wheel (speed, torque, temperature, measured current) and outputs per-wheel (speed command, positive torque limit, negative torque limit). Assumes arrays are monotonically increasing. The feedback term trims the scaling factor and accounts for steady state drift and bias.

Known Limitations

  • Prediction accuracy depends heavily on the quality of inverter characterization data, as well as our own state estimation
  • Feedback trim gain Kp needs to be tuned

@efabiyi
efabiyi requested a review from shayana18 May 3, 2026 06:53
@Lucien950 Lucien950 added the Vehicle Controls Torque Vectoring, Regen, Brake/Drive Diffs label May 3, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bomboclatt

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe put the humungous table into cpp file so that every single hpp which includes this is not immediately ddosd

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also do double check that we do have the flash memory to be able to do this

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is very true will do

static constexpr float SPEED_MAX_RPM = 20000.0f;
static constexpr float CURRENT_MAX_A = 105.0f;

static constexpr float RPM_TO_RAD_PER_SEC = (2.0f * 3.14159265358979323846f) / 60.0f;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we have a M_PI_F macro somewhere

@efabiyi
efabiyi force-pushed the vc_power_limiting branch from 6b5d61b to 179968d Compare May 12, 2026 23:08
@efabiyi
efabiyi requested a review from Aditya-Dhiman4 May 15, 2026 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Vehicle Controls Torque Vectoring, Regen, Brake/Drive Diffs

Development

Successfully merging this pull request may close these issues.

3 participants