|
MCU
|
#include <PedalsSystem.h>

Public Member Functions | |
| PedalsSystem (const PedalsParams &accelParams, const PedalsParams &brakeParams) | |
| pedals system class that evaluates pedals for both accel and brake percent as well as implausibilities More... | |
| void | setParams (const PedalsParams &accelParams, const PedalsParams &brakeParams) |
| const PedalsSystemData_s & | getPedalsSystemData () |
| PedalsSystemData_s | getPedalsSystemDataCopy () |
| float | getMechBrakeActiveThreshold () |
| void | tick (const SysTick_s &tick, const AnalogConversion_s &accel1, const AnalogConversion_s &accel2, const AnalogConversion_s &brake) |
| overloaded tick function that runs the evaluation of the pedals system. evaluates brake using only min and max params for sensor 1 (min_pedal_1 / max_pedal_1). More... | |
| void | tick (const SysTick_s &tick, const AnalogConversion_s &accel1, const AnalogConversion_s &accel2, const AnalogConversion_s &brake1, const AnalogConversion_s &brake2) |
| PedalsSystemData_s | evaluate_pedals (const AnalogConversion_s &accel1, const AnalogConversion_s &accel2, const AnalogConversion_s &brake1, const AnalogConversion_s &brake2, unsigned long curr_time) |
| PedalsSystemData_s | evaluate_pedals (const AnalogConversion_s &accel1, const AnalogConversion_s &accel2, const AnalogConversion_s &brake, unsigned long curr_time) |
Private Member Functions | |
| float | remove_deadzone_ (float conversion_input, float deadzone) |
| bool | max_duration_of_implausibility_exceeded_ (unsigned long curr_time) |
| bool | evaluate_pedal_implausibilities_ (const AnalogConversion_s &pedalData1, const AnalogConversion_s &pedalData2, const PedalsParams ¶ms, float max_percent_diff) |
| Evaluate pedal implausibilities_ determines if there is a software implausibility in the pedals caused by them going out of range. Our max/min sensor ranges are calcuated from the pedal min/max values The pedal min/max values are defined in MCU_defs and are the real world raw values that we determine from the pedal output. The max/min sensor values are then a certain percent higher than these real world values as determined by the implausibility margin. This protects against physical damage to the sensor or pedal, but will not accidentally trip implausibility if pedal values fluctuate. More... | |
| bool | evaluate_pedal_implausibilities_ (const AnalogConversion_s &pedalData, const PedalsParams ¶ms) |
| overloaded pedal implaus check that doesnt need to check for percent diff between sensors since only one sensor More... | |
| bool | evaluate_brake_and_accel_pressed_ (const AnalogConversion_s &accelPedalData1, const AnalogConversion_s &accelPedalData2, const AnalogConversion_s &brakePedalData1, const AnalogConversion_s &brakePedalData2) |
| function to determine if the pedals and the brakes are pressed at the same time. evaluates brake being pressed with mech brake activation threshold AFTER removing deadzones for both brake and accel More... | |
| bool | evaluate_brake_and_accel_pressed_ (const AnalogConversion_s &accelPedalData1, const AnalogConversion_s &accelPedalData2, const AnalogConversion_s &brakePedalData) |
| overloaded version that evaluates with only one brake pedal value More... | |
| bool | evaluate_pedal_oor (const AnalogConversion_s &pedalData, int min, int max) |
| This checks to see if any pedal sensor is out of range :(. More... | |
| bool | evaluate_min_max_pedal_implausibilities_ (const AnalogConversion_s &pedalData, int min, int max, float implaus_margin_scale) |
| bool | pedal_is_active_ (float pedal1ConvertedData, float pedal2ConvertedData, const PedalsParams ¶ms, bool check_mech_activation) |
| check whether or not pedal is active according to input parameters. returns true if either pedal is over threshold. removes the deadzone before checking. More... | |
Private Attributes | |
| PedalsSystemData_s | data_ {} |
| PedalsParams | accelParams_ {} |
| PedalsParams | brakeParams_ {} |
| unsigned long | implausibilityStartTime_ |
Definition at line 41 of file PedalsSystem.h.
|
inline |
pedals system class that evaluates pedals for both accel and brake percent as well as implausibilities
| accelParams | accel pedal parameters. by rules, 2 sensors must be used for redundancy and evaluated w.r.t each other |
| brakeParams | brake pedal params. when used with only one pedal sensor, the pedal parameter evaluation for brakes only looks at the min and max for min_pedal_1 / max_pedal_1 |
Definition at line 48 of file PedalsSystem.h.
|
private |
overloaded version that evaluates with only one brake pedal value
| accelPedalData1 | |
| accelPedalData2 | |
| brakePedalData |
Definition at line 205 of file PedalsSystem.cpp.
|
private |
function to determine if the pedals and the brakes are pressed at the same time. evaluates brake being pressed with mech brake activation threshold AFTER removing deadzones for both brake and accel
| accelPedalData1 | |
| accelPedalData2 | |
| brakePedalData1 | |
| brakePedalData2 |
Definition at line 219 of file PedalsSystem.cpp.
|
private |
| pedalData | |
| min | |
| max | |
| implaus_margin_scale |
Definition at line 151 of file PedalsSystem.cpp.
|
private |
overloaded pedal implaus check that doesnt need to check for percent diff between sensors since only one sensor
| pedalData | |
| params |
Definition at line 124 of file PedalsSystem.cpp.
|
private |
Evaluate pedal implausibilities_ determines if there is a software implausibility in the pedals caused by them going out of range. Our max/min sensor ranges are calcuated from the pedal min/max values The pedal min/max values are defined in MCU_defs and are the real world raw values that we determine from the pedal output. The max/min sensor values are then a certain percent higher than these real world values as determined by the implausibility margin. This protects against physical damage to the sensor or pedal, but will not accidentally trip implausibility if pedal values fluctuate.
| pedalData1 | |
| pedalData2 | |
| params | |
| max_percent_diff |
Definition at line 129 of file PedalsSystem.cpp.
|
private |
This checks to see if any pedal sensor is out of range :(.
| PedalData | The analog pedal Value |
Definition at line 251 of file PedalsSystem.cpp.
| PedalsSystemData_s PedalsSystem::evaluate_pedals | ( | const AnalogConversion_s & | accel1, |
| const AnalogConversion_s & | accel2, | ||
| const AnalogConversion_s & | brake, | ||
| unsigned long | curr_time | ||
| ) |
| accel1 | |
| accel2 | |
| brake | |
| curr_time |
Definition at line 21 of file PedalsSystem.cpp.
| PedalsSystemData_s PedalsSystem::evaluate_pedals | ( | const AnalogConversion_s & | accel1, |
| const AnalogConversion_s & | accel2, | ||
| const AnalogConversion_s & | brake1, | ||
| const AnalogConversion_s & | brake2, | ||
| unsigned long | curr_time | ||
| ) |
| accel1 | |
| accel2 | |
| brake1 | |
| brake2 | |
| curr_time |
Definition at line 64 of file PedalsSystem.cpp.
|
inline |
Definition at line 72 of file PedalsSystem.h.
|
inline |
Definition at line 62 of file PedalsSystem.h.
|
inline |
Definition at line 67 of file PedalsSystem.h.
|
private |
Definition at line 111 of file PedalsSystem.cpp.
|
private |
check whether or not pedal is active according to input parameters. returns true if either pedal is over threshold. removes the deadzone before checking.
| pedal1ConvertedData | the value 0 to 1 of the first pedal without deadzone removed |
| pedal2ConvertedData | ... second pedal 0 to 1 val |
| params | the pedal parameters for this specific pedal |
| check_mech_activation | if this is true, function will check percentages against the mechanical activation percentage |
Definition at line 234 of file PedalsSystem.cpp.
|
private |
Definition at line 189 of file PedalsSystem.cpp.
|
inline |
Definition at line 55 of file PedalsSystem.h.
| void PedalsSystem::tick | ( | const SysTick_s & | tick, |
| const AnalogConversion_s & | accel1, | ||
| const AnalogConversion_s & | accel2, | ||
| const AnalogConversion_s & | brake | ||
| ) |
overloaded tick function that runs the evaluation of the pedals system. evaluates brake using only min and max params for sensor 1 (min_pedal_1 / max_pedal_1).
| tick | current system time tick |
| accel1 | accel 1 sensor reading with scaled and offset value from 0 to 1 |
| accel2 | accel 2 sensor reading with scaled and offset value from 0 to 1 |
| brake | brake sensor reading with scaled and offset value from 0 to 1 |
Definition at line 12 of file PedalsSystem.cpp.
| void PedalsSystem::tick | ( | const SysTick_s & | tick, |
| const AnalogConversion_s & | accel1, | ||
| const AnalogConversion_s & | accel2, | ||
| const AnalogConversion_s & | brake1, | ||
| const AnalogConversion_s & | brake2 | ||
| ) |
| tick | |
| accel1 | |
| accel2 | |
| brake1 | |
| brake2 |
Definition at line 7 of file PedalsSystem.cpp.
|
private |
Definition at line 125 of file PedalsSystem.h.
|
private |
Definition at line 126 of file PedalsSystem.h.
|
private |
Definition at line 124 of file PedalsSystem.h.
|
private |
Definition at line 127 of file PedalsSystem.h.