From 37ddede95735f55635c1d10b4f0e1f5feebded11 Mon Sep 17 00:00:00 2001 From: Mathewos Samson Date: Fri, 31 May 2024 01:43:10 -0400 Subject: [PATCH] update max torque for 208!!! yay --- include/parameters.hpp | 8 ++++---- src/main.cpp | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/parameters.hpp b/include/parameters.hpp index a98247c..31eb85e 100644 --- a/include/parameters.hpp +++ b/include/parameters.hpp @@ -16,7 +16,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 @@ -64,9 +64,9 @@ const double FILTERING_ALPHA_10HZ = 2 * 3.14 * cutoff_10hz / (1 + 2 * 3.14 * cut // 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}; diff --git a/src/main.cpp b/src/main.cpp index 441369c..aa564d1 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -118,7 +118,7 @@ void setup() mcu_status.set_inverter_powered(true); // note VCU does not control inverter power on rev3 mcu_status.set_torque_mode(1); // TODO torque modes should be an enum - mcu_status.set_max_torque(TORQUE_1); // TORQUE_1=60nm, 2=120nm, 3=180nm, 4=240nm + mcu_status.set_max_torque(TORQUE_1); // TORQUE_1=10nm, 2=54nm, 3=180nm, 4=240nm state_machine.init_state_machine(mcu_status); }