Main torque vectoring control loop.
More...
#include <stdint.h>
#include "can_library/generated/TORQUE_VECTOR.h"
#include "common/utils/max.h"
#include "sensors.h"
#include "vcu.h"
◆ control_init()
| void control_init |
( |
void | | ) |
|
◆ control_loop()
| void control_loop |
( |
void | | ) |
|
◆ is_any_crit_stale()
| static bool is_any_crit_stale |
( |
| ) |
|
|
inlinestatic |
◆ report_vcu_settings()
| static void report_vcu_settings |
( |
| ) |
|
|
inlinestatic |
◆ vcu_driver_request_CALLBACK()
| void vcu_driver_request_CALLBACK |
( |
void | | ) |
|
◆ is_regen_enabled
| volatile bool is_regen_enabled = true |
◆ is_tv_enabled
| volatile bool is_tv_enabled = true |
◆ last_vcu_settings_tx
| volatile uint32_t last_vcu_settings_tx = 0 |
◆ pVCU
◆ vcu_mode
| volatile vcu_mode_t vcu_mode = VCU_MODE_TUNING |
◆ vcu_settings
| volatile vcu_settings_data_t vcu_settings[5] |
Initial value:= {
[VCU_MODE_ACCEL] = {
.lateral_gain = 50,
.longitudinal_gain = 50,
.electronic_brake_bias = 50
},
[VCU_MODE_SKIDPAD] = {
.lateral_gain = 50,
.longitudinal_gain = 50,
.electronic_brake_bias = 50
},
[VCU_MODE_AUTOCROSS] = {
.lateral_gain = 50,
.longitudinal_gain = 50,
.electronic_brake_bias = 50
},
[VCU_MODE_ENDURANCE] = {
.lateral_gain = 50,
.longitudinal_gain = 50,
.electronic_brake_bias = 50
},
[VCU_MODE_TUNING] = {
.lateral_gain = 50,
.longitudinal_gain = 50,
.electronic_brake_bias = 50
}
}
◆ xVCU
◆ yVCU