#include <LoadCellVectoringController.h>
◆ TorqueControllerLoadCellVectoring() [1/2]
| TorqueControllerLoadCellVectoring::TorqueControllerLoadCellVectoring |
( |
float |
rearTorqueScale, |
|
|
float |
regenTorqueScale |
|
) |
| |
|
inline |
load cell TC with tunable F/R torque balance. Accel torque balance can be tuned independently of regen torque balance
- Parameters
-
| writeout | the reference to the torque controller output being sent that contains the drivetrain command |
| rearTorqueScale | 0 to 2 scale on forward torque to rear wheels. 0 = FWD, 1 = Balanced, 2 = RWD |
| regenTorqueScale | same as rearTorqueScale but applies to regen torque split. 0 = All regen torque on the front, 1 = 50/50, 2 = all regen torque on the rear |
Definition at line 51 of file LoadCellVectoringController.h.
56 {
59 }
float rearRegenTorqueScale_
TorqueControllerOutput_s writeout_
float frontRegenTorqueScale_
const DrivetrainCommand_s TC_COMMAND_NO_TORQUE
DrivetrainCommand_s command
◆ TorqueControllerLoadCellVectoring() [2/2]
| TorqueControllerLoadCellVectoring::TorqueControllerLoadCellVectoring |
( |
| ) |
|
|
inline |
default contructor with balanced default values: rearTorqueScale = 1.0, regenTorqueScale = 1.0
Definition at line 61 of file LoadCellVectoringController.h.
TorqueControllerLoadCellVectoring()
default contructor with balanced default values: rearTorqueScale = 1.0, regenTorqueScale = 1....
◆ evaluate()
- Note
- refer to parent class for function documentation
Implements Controller.
Definition at line 96 of file LoadCellVectoringController.cpp.
97{
100}
void tick(const SysTick_s &tick, const PedalsSystemData_s &pedalsData, const LoadCellInterfaceOutput_s &loadCellData)
Calculates speed set point based on normal force applied to wheels individually.
LoadCellInterfaceOutput_s loadcell_data
PedalsSystemData_s pedals_data
◆ tick()
Calculates speed set point based on normal force applied to wheels individually.
- Parameters
-
Definition at line 4 of file LoadCellVectoringController.cpp.
9{
10
11 if (
tick.triggers.trigger100)
12 {
13
18
19 for (int i = 0; i < 4; i++)
20 {
22 for (
int FIROffset = 0; FIROffset <
numFIRTaps_; FIROffset++)
23 {
26 }
27 }
31
32
38
40
42 {
43
44 float sumNormalForce = 0.0f;
45 for (int i = 0; i < 4; i++)
46 {
48 }
49
50
51
53 float torquePool;
54 float torqueRequest;
55
56 if (accelRequest >= 0.0)
57 {
58
59
61
66
71 }
72 else
73 {
74
75
77
82
87 }
88 }
89 else
90 {
92 }
93 }
94}
const int errorCountThreshold_
float loadCellForcesRaw_[4][numFIRTaps_]
static const int numFIRTaps_
int loadCellsErrorCounter_[4]
float FIRTaps_[numFIRTaps_]
float loadCellForcesFiltered_[4]
const float AMK_MAX_TORQUE
const float MAX_REGEN_TORQUE
float inverter_torque_limit[NUM_MOTORS]
float speeds_rpm[NUM_MOTORS]
veh_vec< float > loadCellForcesFiltered
veh_vec< AnalogConversion_s > loadCellConversions
◆ errorCountThreshold_
| const int TorqueControllerLoadCellVectoring::errorCountThreshold_ = 25 |
|
private |
◆ FIRCircBufferHead
| int TorqueControllerLoadCellVectoring::FIRCircBufferHead = 0 |
|
private |
◆ FIRSaturated_
| bool TorqueControllerLoadCellVectoring::FIRSaturated_ = false |
|
private |
◆ FIRTaps_
| float TorqueControllerLoadCellVectoring::FIRTaps_[numFIRTaps_] |
|
private |
Initial value:= {
0.07022690881526232,
0.27638313122745306,
0.408090001549378,
0.27638313122745306,
0.07022690881526232}
Definition at line 31 of file LoadCellVectoringController.h.
◆ frontRegenTorqueScale_
| float TorqueControllerLoadCellVectoring::frontRegenTorqueScale_ = 1.0 |
|
private |
◆ frontTorqueScale_
| float TorqueControllerLoadCellVectoring::frontTorqueScale_ = 1.0 |
|
private |
◆ loadCellForcesFiltered_
| float TorqueControllerLoadCellVectoring::loadCellForcesFiltered_[4] = {} |
|
private |
◆ loadCellForcesRaw_
| float TorqueControllerLoadCellVectoring::loadCellForcesRaw_[4][numFIRTaps_] = {} |
|
private |
◆ loadCellsErrorCounter_
| int TorqueControllerLoadCellVectoring::loadCellsErrorCounter_[4] = {} |
|
private |
◆ numFIRTaps_
| const int TorqueControllerLoadCellVectoring::numFIRTaps_ = 5 |
|
staticprivate |
◆ ready_
| bool TorqueControllerLoadCellVectoring::ready_ = false |
|
private |
◆ rearRegenTorqueScale_
| float TorqueControllerLoadCellVectoring::rearRegenTorqueScale_ = 1.0 |
|
private |
◆ rearTorqueScale_
| float TorqueControllerLoadCellVectoring::rearTorqueScale_ = 1.0 |
|
private |
◆ writeout_
The documentation for this class was generated from the following files: