Skip to content

Commit

Permalink
Merge branch 'testing' into newlaunchlookupmode
Browse files Browse the repository at this point in the history
  • Loading branch information
mathbrook committed May 31, 2024
2 parents 83549b4 + 354f128 commit 9db262e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions include/parameters.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#define D_KI 0.3
#define D_KD 0.5
#define D_OUTPUT_MIN 0.0 // Minimum output of the PID controller
#define D_OUTPUT_MAX 2400 // Max output of the PID controller
#define D_OUTPUT_MAX 1600 // Max output of the PID controller
#define BANGBANG_RANGE 1000.0
#define PID_TIMESTEP 100.0
#define PID_MODE false //enable cruise control
Expand All @@ -28,8 +28,8 @@
const unsigned long LAUNCHCONTROL_RELEASE_DELAY = 1500;
#define WHEELSPEED_TOOTH_COUNT 18 // Wheel Speed sensor tooth coutn
const float WHEEL_CIRCUMFERENCE = 0.229*PI*2;
const float FRONT_SPROCKET_TEETH = 16; // Updated 5/29/24 for 228hv
const float REAR_SPROCKET_TEETH = 29; // Updated 5/29/24 for 228hv
const float FRONT_SPROCKET_TEETH = 10;
const float REAR_SPROCKET_TEETH = 37;
const float FINAL_DRIVE = FRONT_SPROCKET_TEETH/REAR_SPROCKET_TEETH;
#define RPM_TIMEOUT 1000 // Timeout for wheel speed RPM to reset to 0
#define MIN_BRAKE_PEDAL 400 // ~0.5v, set on 2-29-2024
Expand Down Expand Up @@ -75,9 +75,9 @@ const double FILTERING_ALPHA_1HZ = 2 * 3.14 * cutoff_1hz / (1 + 2 * 3.14 * cutof
// Note that the variable max_torque is uin8_t
// So it will overflow past a value of 255
const uint8_t TORQUE_1 = 10; // 1st Torque setting
const uint8_t TORQUE_2 = 120; //2nd torque setting
const uint8_t TORQUE_3 = 180; //3rd torque setting
const uint8_t TORQUE_4 = 240; //4th torque setting
const uint8_t TORQUE_2 = 54; //2nd torque setting
const uint8_t TORQUE_3 = 110; //3rd torque setting
const uint8_t TORQUE_4 = 160; //4th torque setting
// List of torque modes (Nm)
const int torque_mode_list[]={TORQUE_1,TORQUE_2,TORQUE_3,TORQUE_4};

Expand Down
2 changes: 1 addition & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ void setup()
}
Serial.printf("Last torque mode (from EEPROM: %d)\n",last_mode);
mcu_status.set_torque_mode(last_mode); // TODO torque modes should be an enum
mcu_status.set_max_torque(torque_mode_list[last_mode-1]); // TORQUE_1=60nm, 2=120nm, 3=180nm, 4=240nm
mcu_status.set_max_torque(torque_mode_list[last_mode-1]); // TORQUE_1=10nm, 2=54nm, 3=180nm, 4=240nm
state_machine.init_state_machine(mcu_status);
}

Expand Down

0 comments on commit 9db262e

Please sign in to comment.