#include <SimpleController.h>
|
| | TorqueControllerSimple (float rearTorqueScale, float regenTorqueScale) |
| | simple TC with tunable F/R torque balance. Accel torque balance can be tuned independently of regen torque balance More...
|
| |
| void | tick (const PedalsSystemData_s &pedalsData) |
| | calculates torque output based off max torque and simple torque scaling metric defined in constructor and adjusts writeout_ accordingly More...
|
| |
| TorqueControllerOutput_s | evaluate (const SharedCarState_s &state) override |
| |
| virtual TorqueControllerOutput_s | evaluate (const SharedCarState_s &state)=0 |
| | This mehod must be implemented by every controller in the Tc Muxer. This is called in the Muxer whenever the drivetrain command is obtained. TorqueControllerMux.cpp to see that in every tick of the system, the active controller must be ticked through this method. More...
|
| |
Definition at line 8 of file SimpleController.h.
◆ TorqueControllerSimple()
| TorqueControllerSimple::TorqueControllerSimple |
( |
float |
rearTorqueScale, |
|
|
float |
regenTorqueScale |
|
) |
| |
|
inline |
simple 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 22 of file SimpleController.h.
27 {
30 }
float frontRegenTorqueScale_
TorqueControllerOutput_s writeout_
float rearRegenTorqueScale_
const DrivetrainCommand_s TC_COMMAND_NO_TORQUE
DrivetrainCommand_s command
◆ evaluate()
- Note
- refer to parent class for function documentation
Implements Controller.
Definition at line 43 of file SimpleController.cpp.
44{
47}
void tick(const PedalsSystemData_s &pedalsData)
calculates torque output based off max torque and simple torque scaling metric defined in constructor...
PedalsSystemData_s pedals_data
◆ tick()
calculates torque output based off max torque and simple torque scaling metric defined in constructor and adjusts writeout_ accordingly
- Parameters
-
| pedalsData | controller calculates acceleration request from the pedals based off of this data |
Definition at line 3 of file SimpleController.cpp.
4{
5
6
7
9 float torqueRequest;
10
11 if (accelRequest >= 0.0)
12 {
13
15
20
25 }
26 else
27 {
28
30
35
40 }
41}
const float AMK_MAX_TORQUE
const float MAX_REGEN_TORQUE
float inverter_torque_limit[NUM_MOTORS]
float speeds_rpm[NUM_MOTORS]
◆ frontRegenTorqueScale_
| float TorqueControllerSimple::frontRegenTorqueScale_ = 1.0 |
|
private |
◆ frontTorqueScale_
| float TorqueControllerSimple::frontTorqueScale_ = 1.0 |
|
private |
◆ rearRegenTorqueScale_
| float TorqueControllerSimple::rearRegenTorqueScale_ = 1.0 |
|
private |
◆ rearTorqueScale_
| float TorqueControllerSimple::rearTorqueScale_ = 1.0 |
|
private |
◆ writeout_
The documentation for this class was generated from the following files: