Vehicle Control Unit
0.01
This is the c library for controlling the car.
Loading...
Searching...
No Matches
Core
Inc
Systems
Controller
TorqueControl.h
Go to the documentation of this file.
1
#ifndef RENSSELAERMOTORSPORT_TORQUE_CONTROL_H
2
#define RENSSELAERMOTORSPORT_TORQUE_CONTROL_H
3
4
#include "../ControllerSystem.h"
5
#include "../../Utils/Constants.h"
6
#include "
Apps.h
"
7
8
typedef
enum
{
9
TORQUE_OK
,
10
TORQUE_RTD
,
11
TORQUE_LOW
,
12
TORQUE_OVER_LIMIT
,
13
TORQUE_UNDER_LIMIT
,
14
TORQUE_SENSOR_ERROR
,
15
TORQUE_BRAKE_FIGHT
16
}
TorqueStatus
;
17
18
typedef
struct
{
19
ControllerSystem
base
;
20
Apps
*
apps
;
21
float
desiredTorque
;
22
float
maxAllowedTorque
;
23
TorqueStatus
status
;
24
}
TorqueControl
;
25
33
void
initTorqueControl
(
TorqueControl
* tc,
Apps
* apps,
int
hz,
float
maxTorque);
34
41
int
startTorqueControl
(
TorqueControl
* tc);
42
49
int
setDesiredTorque
(
ControllerSystem
* controller);
50
51
#endif
// RENSSELAERMOTORSPORT_TORQUE_CONTROL_H
Apps.h
: Contains the logic for the two app sensors.
TorqueStatus
TorqueStatus
Definition:
TorqueControl.h:8
TORQUE_OK
@ TORQUE_OK
Definition:
TorqueControl.h:9
TORQUE_LOW
@ TORQUE_LOW
Definition:
TorqueControl.h:11
TORQUE_UNDER_LIMIT
@ TORQUE_UNDER_LIMIT
Definition:
TorqueControl.h:13
TORQUE_SENSOR_ERROR
@ TORQUE_SENSOR_ERROR
Definition:
TorqueControl.h:14
TORQUE_OVER_LIMIT
@ TORQUE_OVER_LIMIT
Definition:
TorqueControl.h:12
TORQUE_BRAKE_FIGHT
@ TORQUE_BRAKE_FIGHT
Definition:
TorqueControl.h:15
TORQUE_RTD
@ TORQUE_RTD
Definition:
TorqueControl.h:10
setDesiredTorque
int setDesiredTorque(ControllerSystem *controller)
Sets the desired torque for the Torque Control Actuator.
Definition:
TorqueControl.c:27
startTorqueControl
int startTorqueControl(TorqueControl *tc)
Starts the Torque Control Actuator.
Definition:
TorqueControl.c:13
initTorqueControl
void initTorqueControl(TorqueControl *tc, Apps *apps, int hz, float maxTorque)
Initializes the Torque Control Actuator with initial settings.
Definition:
TorqueControl.c:6
Apps
Definition:
Apps.h:22
ControllerSystem
Definition:
ControllerSystem.h:29
TorqueControl
Definition:
TorqueControl.h:18
TorqueControl::base
ControllerSystem base
Definition:
TorqueControl.h:19
TorqueControl::apps
Apps * apps
Definition:
TorqueControl.h:20
TorqueControl::maxAllowedTorque
float maxAllowedTorque
Definition:
TorqueControl.h:22
TorqueControl::status
TorqueStatus status
Definition:
TorqueControl.h:23
TorqueControl::desiredTorque
float desiredTorque
Definition:
TorqueControl.h:21
Generated by
1.9.5