Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Power, torque, and negative speedpoint limit #73

Merged
merged 11 commits into from
Apr 19, 2024

Conversation

walkermburns
Copy link
Contributor

@walkermburns walkermburns commented Apr 11, 2024

This PR replaces and completes the limiting functions that were present in the torque controllers.

These have been placed in the TCMUX since they should be applied to all controllers and all drivetrain requests.

The Power limit is a simple powerlimit akin to the one run on HT07. When calculated mechanical power is above the predetermined 63kw mechanical power limit it will scale down all motor torques to be below the 63kw limit while preserving ratios as determined by the torque controllers.

The torque limit works in a similar manner but takes the average torque value across all motors. This will effectively limit the torque output of our motors so that the average torque of all motors at any point in time is the same as the dashboard/ecu torque limit.

The negative speedtest limit function just takes the max of speed setpoint values above 0, preventing the car from commanding backwards motion

closes #66
closes #71

@walkermburns walkermburns self-assigned this Apr 12, 2024
@walkermburns walkermburns added the easy-difficulty 1 day. easy to do label Apr 12, 2024
@walkermburns
Copy link
Contributor Author

Eric has also looked over this in person. This can be merged as soon as we get to test it on the car.

@walkermburns
Copy link
Contributor Author

Tested this last night and discovered/fixed problems with the power calculation.
Still to test:

  • Run full scale accel test to verify that our 63kw mechanical limit properly corresponds to 80kw electrical (can be done after merge)
  • Verify that regen torque is decreasing and stopping before 5kph
  • Verify that torque limit is properly limiting torque requests in straight line accel and passes the sniff test in autocross/skidpad
  • Write tests for negative accel requests and the above

@walkermburns walkermburns merged commit d12cc96 into master Apr 19, 2024
2 checks passed
@RCMast3r RCMast3r deleted the feature/power_and_torque_limit branch April 26, 2024 23:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
easy-difficulty 1 day. easy to do
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Check for negative RPM (reverse) request at the drivetrain level Power Limiting
2 participants