Skip to content

Commit 3b6b3a4

Browse files
committed
brake fixes
1 parent 4472fd4 commit 3b6b3a4

4 files changed

Lines changed: 15 additions & 15 deletions

File tree

PCU/Core/User/Inc/FEB_PINOUT.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -151,16 +151,16 @@ extern "C"
151151
#define APPS_PLAUSIBILITY_TOLERANCE 10 /* Maximum deviation between sensors (%) */
152152

153153
/* Brake Pressure Sensor Default Calibration — per-sensor, sensor-side mV
154-
* (i.e. before the 2:1 PCB divider; FEB_ADC_GetBrakePressureNVoltage()
154+
* (i.e. before the 5V->3.3V PCB divider; FEB_ADC_GetBrakePressureNVoltage()
155155
* already multiplies by VOLTAGE_DIVIDER_RATIO_BRAKE to give sensor-side V). */
156-
#define BRAKE_PRESSURE_1_MIN_MV 720 /* Sensor 1 @ 0% brake: 0.720 V (measured 2026-05-30) */
157-
#define BRAKE_PRESSURE_1_MAX_MV 1473 /* Sensor 1 @ 100% brake: 1.473 V (measured 2026-05-30) */
158-
#define BRAKE_PRESSURE_2_MIN_MV 633 /* Sensor 2 @ 0% brake: 0.633 V (measured 2026-05-30) */
159-
#define BRAKE_PRESSURE_2_MAX_MV 1165 /* Sensor 2 @ 100% brake: 1.165 V (measured 2026-05-30) */
160-
#define BRAKE_PRESSURE_MIN_PHYSICAL_BAR 0.0f /* Physical minimum: 0 bar */
161-
#define BRAKE_PRESSURE_MAX_PHYSICAL_BAR 200.0f /* Physical maximum: 200 bar */
162-
#define BRAKE_PRESSURE_THRESHOLD_BAR 5 /* Brake activation threshold */
163-
#define BRAKE_PRESSURE_THRESHOLD_PERCENT 2.5f /* Brake activation threshold in percent */
156+
#define BRAKE_PRESSURE_1_MIN_MV 545 /* Sensor 1 @ 0% brake: 0.545 V sensor-side (5/3.3 divider) */
157+
#define BRAKE_PRESSURE_1_MAX_MV 1116 /* Sensor 1 @ 100% brake: 1.116 V sensor-side (5/3.3 divider) */
158+
#define BRAKE_PRESSURE_2_MIN_MV 480 /* Sensor 2 @ 0% brake: 0.480 V sensor-side (5/3.3 divider) */
159+
#define BRAKE_PRESSURE_2_MAX_MV 883 /* Sensor 2 @ 100% brake: 0.883 V sensor-side (5/3.3 divider) */
160+
#define BRAKE_PRESSURE_MIN_PHYSICAL_BAR 0.0f /* Physical minimum: 0 bar */
161+
#define BRAKE_PRESSURE_MAX_PHYSICAL_BAR 200.0f /* Physical maximum: 200 bar */
162+
#define BRAKE_PRESSURE_THRESHOLD_BAR 5 /* Brake activation threshold */
163+
#define BRAKE_PRESSURE_THRESHOLD_PERCENT 2.5f /* Brake activation threshold in percent */
164164
#define BRAKE_PRESSURE_PLAUSIBILITY_TOLERANCE_PERCENT 20.0f /* Max disagreement between brake pressure sensors */
165165

166166
/* Brake Input/Switch Calibration */

PCU/Core/User/Src/FEB_ADC.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,10 +158,10 @@ static ADC_CalibrationTypeDef brake_pressure2_calibration = {
158158
.max_physical = BRAKE_PRESSURE_MAX_PHYSICAL_BAR, /* Physical: 200 bar */
159159
.inverted = false};
160160

161-
#define VOLTAGE_DIVIDER_RATIO (5.0f / 3.3f) /* shutdown, current sense, pre-timing trip */
162-
#define VOLTAGE_DIVIDER_RATIO_BRAKE 2.0f /* brake pressure: 2:1 PCB divider */
163-
#define VOLTAGE_DIVIDER_RATIO_ACCEL1 1.168f /* APPS1: k=0.856 measured (2.16V→1.849V at ADC) */
164-
#define VOLTAGE_DIVIDER_RATIO_ACCEL2 1.0f /* APPS2: direct connection, no resistor divider */
161+
#define VOLTAGE_DIVIDER_RATIO (5.0f / 3.3f) /* shutdown, current sense, pre-timing trip */
162+
#define VOLTAGE_DIVIDER_RATIO_BRAKE (5.0f / 3.3f) /* brake: 5V->3.3V PCB divider */
163+
#define VOLTAGE_DIVIDER_RATIO_ACCEL1 1.168f /* APPS1: k=0.856 measured (2.16V→1.849V at ADC) */
164+
#define VOLTAGE_DIVIDER_RATIO_ACCEL2 1.0f /* APPS2: direct connection, no resistor divider */
165165

166166
/* Private function prototypes -----------------------------------------------*/
167167
static uint16_t GetAveragedADCValue(ADC_HandleTypeDef *hadc, uint32_t channel, uint8_t samples);

PCU/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.7.2
1+
1.7.3

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.7.2
1+
1.7.3

0 commit comments

Comments
 (0)