PER Firmware
Loading...
Searching...
No Matches
torque_controller.c File Reference

Vehicle torque request calculation. More...

#include "torque_controller.h"
#include "can_library/generated/MAIN_MODULE.h"
#include "common/utils/min.h"
Include dependency graph for torque_controller.c:

Functions

static torque_request_t zero_torque_request (void)
 
static torque_request_t direct_mapped_regen (void)
 
static torque_request_t direct_mapped_throttle (void)
 
static torque_request_t torque_vectoring_request (void)
 
torque_request_t torque_controller_get_request (void)
 

Variables

static constexpr float WHEEL_RADIUS_IN = 8.0f
 
static constexpr float GEAR_RATIO = 12.51f
 
static constexpr float WHEEL_CIRCUMFERENCE_IN = 2.0f * 3.14159f * WHEEL_RADIUS_IN
 
static constexpr float OUTPUT_REV_PER_MOTOR_REV = 1.0f / GEAR_RATIO
 
static constexpr float INCHES_PER_MOTOR_REV = WHEEL_CIRCUMFERENCE_IN * OUTPUT_REV_PER_MOTOR_REV
 
static constexpr float MINUTES_PER_HOUR = 60.0f
 
static constexpr float INCHES_PER_MILE = 63360.0f
 
static constexpr float RPM_TO_MPH = INCHES_PER_MOTOR_REV * MINUTES_PER_HOUR / INCHES_PER_MILE
 

Detailed Description

Vehicle torque request calculation.

Author
Irving Wang (irvin.nosp@m.gw@p.nosp@m.urdue.nosp@m..edu)

Function Documentation

◆ direct_mapped_regen()

static torque_request_t direct_mapped_regen ( void )
static
Here is the caller graph for this function:

◆ direct_mapped_throttle()

static torque_request_t direct_mapped_throttle ( void )
static
Here is the caller graph for this function:

◆ torque_controller_get_request()

torque_request_t torque_controller_get_request ( void )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ torque_vectoring_request()

static torque_request_t torque_vectoring_request ( void )
static
Here is the caller graph for this function:

◆ zero_torque_request()

static torque_request_t zero_torque_request ( void )
static
Here is the caller graph for this function:

Variable Documentation

◆ GEAR_RATIO

float GEAR_RATIO = 12.51f
staticconstexpr

◆ INCHES_PER_MILE

float INCHES_PER_MILE = 63360.0f
staticconstexpr

◆ INCHES_PER_MOTOR_REV

float INCHES_PER_MOTOR_REV = WHEEL_CIRCUMFERENCE_IN * OUTPUT_REV_PER_MOTOR_REV
staticconstexpr

◆ MINUTES_PER_HOUR

float MINUTES_PER_HOUR = 60.0f
staticconstexpr

◆ OUTPUT_REV_PER_MOTOR_REV

float OUTPUT_REV_PER_MOTOR_REV = 1.0f / GEAR_RATIO
staticconstexpr

◆ RPM_TO_MPH

float RPM_TO_MPH = INCHES_PER_MOTOR_REV * MINUTES_PER_HOUR / INCHES_PER_MILE
staticconstexpr

◆ WHEEL_CIRCUMFERENCE_IN

float WHEEL_CIRCUMFERENCE_IN = 2.0f * 3.14159f * WHEEL_RADIUS_IN
staticconstexpr

◆ WHEEL_RADIUS_IN

float WHEEL_RADIUS_IN = 8.0f
staticconstexpr