Vehicle Control Unit 0.01
This is the c library for controlling the car.
|
#include "../ControllerSystem.h"
Go to the source code of this file.
Classes | |
struct | TorqueControl |
Macros | |
#define | TORQUE_ERROR_MARGIN 0.05 |
Enumerations | |
enum | TorqueStatus { TORQUE_OK , TORQUE_OVER_LIMIT , TORQUE_UNDER_LIMIT , TORQUE_SENSOR_ERROR , TORQUE_OK , TORQUE_OVER_LIMIT , TORQUE_UNDER_LIMIT , TORQUE_SENSOR_ERROR } |
Functions | |
void | initTorqueControl (TorqueControl *tc, int hz, float maxTorque) |
Initializes the Torque Control Actuator with initial settings. More... | |
void | setDesiredTorque (TorqueControl *tc, float torque) |
Sets the desired torque for the Torque Control Actuator. More... | |
void | setActualTorque (TorqueControl *tc, float torque) |
void | updateTorqueControl (void *tc) |
Updates the Torque Control Actuator based on sensor inputs and calculations. More... | |
TorqueStatus | checkTorqueLimits (TorqueControl *tc) |
Checks if the actual torque is within the defined limits and desired range. More... | |
void | sendTorqueCommand (const TorqueControl *tc) |
int | torqueSafetyCheck (void *tc) |
Checks the safety of the torque with multiple monitors. More... | |
#define TORQUE_ERROR_MARGIN 0.05 |
Definition at line 6 of file TorqueControl.h.
enum TorqueStatus |
Enumerator | |
---|---|
TORQUE_OK | |
TORQUE_OVER_LIMIT | |
TORQUE_UNDER_LIMIT | |
TORQUE_SENSOR_ERROR | |
TORQUE_OK | |
TORQUE_OVER_LIMIT | |
TORQUE_UNDER_LIMIT | |
TORQUE_SENSOR_ERROR |
Definition at line 9 of file TorqueControl.h.
TorqueStatus checkTorqueLimits | ( | TorqueControl * | tc | ) |
Checks if the actual torque is within the defined limits and desired range.
TODO: move into torque police
tc | A pointer to the TorqueControl structure. |
Definition at line 58 of file TorqueControl.c.
void initTorqueControl | ( | TorqueControl * | tc, |
int | hz, | ||
float | maxTorque | ||
) |
Initializes the Torque Control Actuator with initial settings.
tc | A pointer to the TorqueControl structure. |
hz | Rate at which the sensor is called (in hz). |
maxTorque | The maximum torque limit set for the system (in Nm). |
Definition at line 4 of file TorqueControl.c.
void sendTorqueCommand | ( | const TorqueControl * | tc | ) |
void setActualTorque | ( | TorqueControl * | tc, |
float | torque | ||
) |
Definition at line 39 of file TorqueControl.c.
void setDesiredTorque | ( | TorqueControl * | tc, |
float | torque | ||
) |
Sets the desired torque for the Torque Control Actuator.
tc | A pointer to the TorqueControl structure. |
torque | The desired torque to be set (in Nm). |
Definition at line 27 of file TorqueControl.c.
int torqueSafetyCheck | ( | void * | tc | ) |
Checks the safety of the torque with multiple monitors.
tc | A pointer to the TorqueControl structure. |
Definition at line 76 of file TorqueControl.c.
void updateTorqueControl | ( | void * | tc | ) |
Updates the Torque Control Actuator based on sensor inputs and calculations.
tc | A pointer to the TorqueControl structure. |
Definition at line 43 of file TorqueControl.c.