1#ifndef DRIVETRAINSYSTEM
2#define DRIVETRAINSYSTEM
8#include "MCUInterface.h"
12template <
typename InverterType>
18 DrivetrainSystem(
const std::array<InverterType *, 4> &
inverters,
MCUInterface *mcu_interface,
int init_time_limit_ms, uint16_t min_hv_voltage = 60,
int min_cmd_period_ms = 1,
float max_torque_setpoint_nm = 21.42)
100#include "DrivetrainSystem.tpp"
MCUInterface * mcu_interface_
void enable_drivetrain_hv_(unsigned long curr_time)
unsigned long last_disable_cmd_time_
unsigned long drivetrain_initialization_phase_start_time_
DrivetrainDynamicReport_s dynamic_data_
unsigned long last_reset_cmd_time_
bool handle_inverter_startup(unsigned long curr_time)
float lambda_magnetic_flux_wb_
float max_torque_setpoint_nm_
void enable_drivetrain_reset()
bool drivetrain_error_occured()
void command_drivetrain_debug()
void command_drivetrain(const DrivetrainCommand_s &data)
bool check_drivetrain_quit_dc_on_()
unsigned long last_general_cmd_time_
DrivetrainSystem(const std::array< InverterType *, 4 > &inverters, MCUInterface *mcu_interface, int init_time_limit_ms, uint16_t min_hv_voltage=60, int min_cmd_period_ms=1, float max_torque_setpoint_nm=21.42)
order of array: 0: FL, 1: FR, 2: RL, 3: RR
std::array< InverterType *, 4 > inverters_
bool inverter_init_timeout(unsigned long curr_time)
void tick(const SysTick_s &tick)
unsigned long last_reset_pressed_time_
bool drivetrain_enabled_()
void command_drivetrain_no_torque()
unsigned long reset_interval_
unsigned long curr_system_millis_
DrivetrainDynamicReport_s get_dynamic_data()
unsigned long last_no_torque_cmd_time_
void check_reset_condition()
bool hv_over_threshold_on_drivetrain()
DrivetrainCommand_s current_drivetrain_command_
unsigned int min_cmd_period_
Stores setpoints for a command to the Drivetrain, containing speed and torque setpoints for each moto...