MCU
Loading...
Searching...
No Matches
MCU_rev15_defs.h
Go to the documentation of this file.
1#ifndef __MCU15_H__
2#define __MCU15_H__
3
4#include "PedalsSystem.h"
5
6
7
8// pindefs
9const int ADC1_CS = 34; // Main ECU
10const int ADC2_CS = 33; // FL corner board
11const int ADC3_CS = 29; // FR corner board
12const int SOFTWARE_OK = 8;
13const int WATCHDOG_INPUT = 32;
14
15
16// ADC1 channel defs
25// ADC2 channel defs
30
31//MCU teensy analog channels
33// const int MCU15_NUM_THERMISTORS = 2;
34const int MCU15_THERM_FL = 38;
35const int MCU15_THERM_FR = 41;
36// const int MCU15_THERM_FL_CHANNEL = 0;
37// const int MCU15_THERM_FR_CHANNEL = 1;
38
40// Time intervals
41const unsigned long SETUP_PRESENT_ACTION_INTERVAL = 1000;
42const unsigned long BUZZER_ON_INTERVAL = 2000;
43const unsigned long INVERTER_ENABLING_TIMEOUT_INTERVAL = 5000;
44
45//glv sense conversion
46const float GLV_SENSE_SCALE = .0073 * 4.0865;
47// Communication speeds
48const unsigned long INV_CAN_BAUDRATE = 500000;
49const unsigned long TELEM_CAN_BAUDRATE = 500000;
50
51// APPS/Brake pedal parameters
52// All of these values are the PEDAL min/max
53// the sensor min/max that trip implaus are calculated
54// in the PedalsSystem constructor
55const int ACCEL1_PEDAL_MAX = 3490;
56const int ACCEL2_PEDAL_MAX = 189;
57
58const int ACCEL1_PEDAL_MIN = 2646;
59const int ACCEL2_PEDAL_MIN = 1030;
60
61const int BRAKE1_PEDAL_MAX = 2022;
62const int BRAKE2_PEDAL_MAX = 1668;
63
64const int BRAKE1_PEDAL_MIN = 1192;
65const int BRAKE2_PEDAL_MIN = 2476;
66
67const int ACCEL1_PEDAL_OOR_MIN = 90;
68const int ACCEL2_PEDAL_OOR_MIN = 90;
69
70const int ACCEL1_PEDAL_OOR_MAX = 4000;
71const int ACCEL2_PEDAL_OOR_MAX = 4000;
72
73const int BRAKE1_PEDAL_OOR_MIN = 90;
74const int BRAKE2_PEDAL_OOR_MIN = 90;
75
76const int BRAKE1_PEDAL_OOR_MAX = 4000;
77const int BRAKE2_PEDAL_OOR_MAX = 4000;
78
79const float DEFAULT_PEDAL_DEADZONE = 0.05f;
81
82const float APPS_ACTIVATION_PERCENTAGE = 0.1f;
83const float BRAKE_ACTIVATION_PERCENTAGE = 0.05f;
84const float BRAKE_MECH_THRESH = 0.46f;
85
86// Load Cell Defs to convert raw to lbs
87// lbs = (raw + offset) * scale
88
89const float LOADCELL_FL_SCALE = 0.1053;
91
92const float LOADCELL_FR_SCALE = 0.097;
94
95const float LOADCELL_RL_SCALE = 0.1149;
97
98const float LOADCELL_RR_SCALE = 0.118;
100
101// Steering parameters
102const float PRIMARY_STEERING_SENSE_OFFSET = 0.0; // units are degrees
103const int SECONDARY_STEERING_SENSE_LEFTMOST_BOUND = 790; // 785; // 794 // 812 // 130 deg // 128.95
104const int SECONDARY_STEERING_SENSE_RIGHTMOST_BOUND = 3133; // 3087; // 3075 // 3179 // 134 deg // 132.79
105const int SECONDARY_STEERING_SENSE_CENTER = 1985; // 1945 // 1960 // 1970
106const float STEERING_RANGE_DEGREES = 254.74; //257.0f // 253.0f // 256.05f // 134+130-7(slop)
107const float STEERING_IIR_ALPHA = 0.7f; // shaves off around 1 deg of max discrepancy
108
109// TC parameters
111// percent front wheels
113
114#endif /* __MCU15_H__ */
const int MCU15_BRAKE1_CHANNEL
const int MCU15_STEERING_CHANNEL
const float LOADCELL_FL_SCALE
const int MCU15_THERM_FR
const int MCU15_ACCEL2_CHANNEL
const int BRAKE2_PEDAL_OOR_MIN
const float LOADCELL_FL_OFFSET
const int WATCHDOG_INPUT
const int ACCEL1_PEDAL_MIN
const float SIMPLE_TC_REAR_TORQUE_SCALE
const int BRAKE1_PEDAL_MAX
const int BRAKE2_PEDAL_MIN
const int MCU15_CUR_POS_SENSE_CHANNEL
const int ADC1_CS
Definition: MCU_rev15_defs.h:9
const float DEFAULT_PEDAL_IMPLAUSIBILITY_MARGIN
const int MCU15_GLV_SENSE_CHANNEL
const int BRAKE1_PEDAL_MIN
const int ACCEL1_PEDAL_MAX
const float BRAKE_ACTIVATION_PERCENTAGE
const unsigned long TELEM_CAN_BAUDRATE
const float GLV_SENSE_SCALE
const float LOADCELL_RL_SCALE
const float STEERING_RANGE_DEGREES
const int ACCEL2_PEDAL_OOR_MIN
const int MCU15_THERM_FL
const int ACCEL2_PEDAL_MIN
const int MCU15_FL_POTS_CHANNEL
const float STEERING_IIR_ALPHA
const int DEFAULT_ANALOG_PINS[MCU15_TEENSY_ADC_CHANNELS]
const int BRAKE1_PEDAL_OOR_MIN
const int ACCEL2_PEDAL_MAX
const int ACCEL1_PEDAL_OOR_MAX
const float DEFAULT_PEDAL_DEADZONE
const int SOFTWARE_OK
const float LOADCELL_FR_SCALE
const int MCU15_FR_LOADCELL_CHANNEL
const int MCU15_TEENSY_ADC_CHANNELS
const float APPS_ACTIVATION_PERCENTAGE
const int ACCEL2_PEDAL_OOR_MAX
const int ADC2_CS
const int MCU15_BRAKE2_CHANNEL
const float SIMPLE_TC_REGEN_TORQUE_SCALE
const int MCU15_FL_LOADCELL_CHANNEL
const float LOADCELL_RL_OFFSET
const int SECONDARY_STEERING_SENSE_RIGHTMOST_BOUND
const int MCU15_ACCEL1_CHANNEL
const int ACCEL1_PEDAL_OOR_MIN
const float PRIMARY_STEERING_SENSE_OFFSET
const unsigned long SETUP_PRESENT_ACTION_INTERVAL
const unsigned long INV_CAN_BAUDRATE
const int MCU15_CUR_NEG_SENSE_CHANNEL
const unsigned long BUZZER_ON_INTERVAL
const float BRAKE_MECH_THRESH
const float LOADCELL_RR_OFFSET
const float LOADCELL_RR_SCALE
const int BRAKE2_PEDAL_MAX
const int BRAKE2_PEDAL_OOR_MAX
const float LOADCELL_FR_OFFSET
const int BRAKE1_PEDAL_OOR_MAX
const int MCU15_FR_POTS_CHANNEL
const unsigned long INVERTER_ENABLING_TIMEOUT_INTERVAL
const int SECONDARY_STEERING_SENSE_LEFTMOST_BOUND
const int SECONDARY_STEERING_SENSE_CENTER
const int ADC3_CS