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

Pedal to torque #254

Open
wants to merge 10 commits into
base: develop
Choose a base branch
from
Open

Pedal to torque #254

wants to merge 10 commits into from

Conversation

Myers-Ty
Copy link
Contributor

Changes

_New pedal to torque transfer curve as shown below. Between 0 and 20% pedal throttle the applied throttle is about halved, then afterwards it slowly approaches a 1:1 applied vs outputted throttle.

image

Test Cases

  • For the function, inputting 0% outputs 0%, inputting 100% outputs 100%, & nothing in between 0 and 100 output negative or over 100%

To Do

  • Test on car and fine tune

Closes #248

@Myers-Ty Myers-Ty self-assigned this Jan 13, 2025
Copy link
Contributor

@caiodasilva2005 caiodasilva2005 left a comment

Choose a reason for hiding this comment

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

Great work! Just a few changes

Core/Src/pedals.c Show resolved Hide resolved
Core/Src/pedals.c Show resolved Hide resolved
@@ -371,8 +390,12 @@ void handle_endurance(dti_t *mc, float mph, float accel_val, float brake_val)
if (brake_val > 650 && (mph * 1.609) > 5) {
brake_pedal_regen(brake_val);
} else {
// accelerating, limit torque
// accelerating, limit torque
#ifndef POWER_REGRESSION_PEDAL_TORQUE_TRANSFER
Copy link
Contributor

Choose a reason for hiding this comment

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

We don't want this for brake regen, just for linear accel -> torque

Copy link
Contributor

@caiodasilva2005 caiodasilva2005 left a comment

Choose a reason for hiding this comment

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

this lgtm. @jr1221 can we get your review on this?

@@ -27,7 +27,7 @@
0x496 /* Throttle signal, Brake signal, IO, Drive enable */

#define TIRE_DIAMETER 16 /* inches */
#define GEAR_RATIO 47 / 13.0 /* unitless */
#define GEAR_RATIO 35 / 13.0 /* unitless */
Copy link
Contributor

Choose a reason for hiding this comment

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

where did you find this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I messaged Abby directly

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.

Implement alternative pedal-to-torque transfer functions
3 participants