Skip to content

Commit

Permalink
Merge branch 'main' into testing
Browse files Browse the repository at this point in the history
  • Loading branch information
mathbrook committed May 31, 2024
2 parents 9ec6193 + 37ddede commit 5ea5667
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 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 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 5ea5667

Please sign in to comment.