Go to the source code of this file.
◆ TORQUE_ERROR_MARGIN
#define TORQUE_ERROR_MARGIN 0.05 |
◆ 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 TorqueMonitor.h.
◆ checkTorqueLimits()
Checks if the actual torque is within the defined limits and desired range.
TODO: move into torque police
- Note
- FIXME: When should each torque condition be in place?
- Parameters
-
- Returns
- The actual status of the torque.
Definition at line 58 of file TorqueControl.c.
58 {
61 }
64 }
65
68
71 }
72
74}
#define TORQUE_ERROR_MARGIN
◆ initTorqueControl()
void initTorqueControl |
( |
TorqueControl * |
tc, |
|
|
int |
hz, |
|
|
float |
maxTorque |
|
) |
| |
Initializes the Torque Control Actuator with initial settings.
- Parameters
-
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.
4 {
12}
void initControllerSystem(ControllerSystem *controller, const char *name, int hz, ControllerType type)
Initializes the Controller System with initial settings.
void updateTorqueControl(void *tc)
Updates the Torque Control Actuator based on sensor inputs and calculations.
int torqueSafetyCheck(void *tc)
Checks the safety of the torque with multiple monitors.
int(* safety)(void *self)
void(* update)(void *self)
◆ sendTorqueCommand()
◆ setDesiredTorque()
Sets the desired torque for the Torque Control Actuator.
- Note
- FIXME: Update to this to a map in the future.
- Parameters
-
tc | A pointer to the TorqueControl structure. |
torque | The desired torque to be set (in Nm). |
Definition at line 27 of file TorqueControl.c.
27 {
29 printf("Torque Control Actuator is not in a safe state\n");
30 return;
31 }
33 printf("Desired torque exceeds the maximum allowed torque\n");
34 return;
35 }
37}
◆ setTorque()
◆ updateTorqueControl()
void updateTorqueControl |
( |
void * |
tc | ) |
|
Updates the Torque Control Actuator based on sensor inputs and calculations.
- Parameters
-
Definition at line 43 of file TorqueControl.c.
43 {
46 printf("Torque Control Actuator is not in a safe state\n");
47 return;
48 }
51 printf("Torque Control Actuator is not in OK\n");
52 return;
53 }
54
55
56}
TorqueStatus checkTorqueLimits(TorqueControl *tc)
Checks if the actual torque is within the defined limits and desired range.