Red Bird Racing VCU v2
 
Loading...
Searching...
No Matches
PedalConstants Namespace Reference

Namespace for pedal-related constants, such as thresholds and calculation parameters. This is to avoid polluting the Pedal class with intermediate results. More...

Variables

constexpr uint8_t MIN_REGEN_KMH = 10
 
constexpr uint8_t GEAR_RATIO_NUMERATOR = 60
 
constexpr uint8_t GEAR_RATIO_DENOMINATOR = 13
 
constexpr uint8_t WHEEL_DIAMETER_INCH = 13
 
constexpr uint16_t MAX_MOTOR_RPM = 7000
 
constexpr uint16_t MAX_TORQUE_VAL = 32767
 
constexpr uint16_t INCH_PER_KM = 39370
 
constexpr uint8_t MINUTES_PER_HOUR = 60
 
constexpr double PI_ = 3.1415926535897932384626433832795
 
constexpr int16_t MIN_REGEN_RPM_VAL
 

Detailed Description

Namespace for pedal-related constants, such as thresholds and calculation parameters. This is to avoid polluting the Pedal class with intermediate results.

Variable Documentation

◆ GEAR_RATIO_DENOMINATOR

constexpr uint8_t PedalConstants::GEAR_RATIO_DENOMINATOR = 13
constexpr

Gear ratio denominator of the drivetrain.

Definition at line 46 of file Pedal.hpp.

◆ GEAR_RATIO_NUMERATOR

constexpr uint8_t PedalConstants::GEAR_RATIO_NUMERATOR = 60
constexpr

Gear ratio numerator of the drivetrain.

Definition at line 45 of file Pedal.hpp.

◆ INCH_PER_KM

constexpr uint16_t PedalConstants::INCH_PER_KM = 39370
constexpr

Inches per kilometer.

Definition at line 53 of file Pedal.hpp.

◆ MAX_MOTOR_RPM

constexpr uint16_t PedalConstants::MAX_MOTOR_RPM = 7000
constexpr

Maximum motor RPM.

Definition at line 50 of file Pedal.hpp.

◆ MAX_TORQUE_VAL

constexpr uint16_t PedalConstants::MAX_TORQUE_VAL = 32767
constexpr

Maximum torque value for motor controller.

Definition at line 51 of file Pedal.hpp.

◆ MIN_REGEN_KMH

constexpr uint8_t PedalConstants::MIN_REGEN_KMH = 10
constexpr

Minimum speed (km/h) for regenerative braking to be active.

Definition at line 44 of file Pedal.hpp.

◆ MIN_REGEN_RPM_VAL

constexpr int16_t PedalConstants::MIN_REGEN_RPM_VAL
constexpr
Initial value:
=
(double)MIN_REGEN_KMH / MINUTES_PER_HOUR * INCH_PER_KM / WHEEL_DIAMETER_INCH / PI_ * GEAR_RATIO_NUMERATOR / GEAR_RATIO_DENOMINATOR * MAX_TORQUE_VAL / MAX_MOTOR_RPM

Final RPM = KMH -> Inches per Hour -> Inch per minute -> RPM at wheel -> RPM at motor Minimum RPM for regenerative braking to be active.

Definition at line 58 of file Pedal.hpp.

Referenced by Pedal::pedalTorqueMapping().

◆ MINUTES_PER_HOUR

constexpr uint8_t PedalConstants::MINUTES_PER_HOUR = 60
constexpr

Minutes per hour.

Definition at line 54 of file Pedal.hpp.

◆ PI_

constexpr double PedalConstants::PI_ = 3.1415926535897932384626433832795
constexpr

Value of pi, unnamed to avoid clashing with Arduino.h's definition.

Definition at line 55 of file Pedal.hpp.

◆ WHEEL_DIAMETER_INCH

constexpr uint8_t PedalConstants::WHEEL_DIAMETER_INCH = 13
constexpr

Wheel diameter in inches.

Definition at line 49 of file Pedal.hpp.