From 576021dd08a710986753b8dbdd52662c783a4c71 Mon Sep 17 00:00:00 2001 From: Lucio Rossi Date: Tue, 12 Mar 2024 17:34:48 +0100 Subject: [PATCH 1/2] increased limits on move_pid and rotate_pid + 0.01 Ki --- src/definitions/robot_definitions.h | 10 +++++----- src/motor_control/motor_control.h | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/definitions/robot_definitions.h b/src/definitions/robot_definitions.h index 129ba41..2291ca9 100644 --- a/src/definitions/robot_definitions.h +++ b/src/definitions/robot_definitions.h @@ -18,7 +18,7 @@ #define WHEEL_DIAMETER_MM 34.0 // Motor Control and mechanical parameters -#define CONTROL_LIMIT 4096 // PWM resolution +#define CONTROL_LIMIT 4095 // PWM resolution #define MOTOR_LIMIT 70.0 // Mechanical RPM limit speed of used motors #define MOTOR_CPR 6.0 // Resolution of the encoder @@ -42,17 +42,17 @@ const float MOTOR_RATIO = MOTOR_CPR*MOTOR_GEAR_RATIO; // Kinematics control #define ROTATE_KP_DEFAULT 5.0 -#define ROTATE_KI_DEFAULT 0.0 +#define ROTATE_KI_DEFAULT 0.01 #define ROTATE_KD_DEFAULT 0.001 #define ROTATE_CONTROL_PERIOD 0.02 -#define ROTATE_MAX_SPEED 45.0 +#define ROTATE_MAX_SPEED 170.0 #define ROTATE_THRESHOLD 1 #define MOVE_KP_DEFAULT 5.0 -#define MOVE_KI_DEFAULT 0.0 +#define MOVE_KI_DEFAULT 0.01 #define MOVE_KD_DEFAULT 0.001 #define MOVE_CONTROL_PERIOD 0.02 -#define MOVE_MAX_SPEED 45.0 +#define MOVE_MAX_SPEED 130.0 #define MOVE_THRESHOLD 3 #define MOVEMENT_DISABLED 0 diff --git a/src/motor_control/motor_control.h b/src/motor_control/motor_control.h index 4908003..e3ffa5a 100644 --- a/src/motor_control/motor_control.h +++ b/src/motor_control/motor_control.h @@ -19,7 +19,7 @@ #include "../definitions/robot_definitions.h" #include "pid_controller.h" -#define CONTROL_LIMIT 4095 +//#define CONTROL_LIMIT 4095 #define MEM_SIZE 5 #define CONTROL_MODE_NORMAL 0 #define CONTROL_MODE_LINEAR 1 From 80c61dd04f529d01327874da24bcb6d5b0b0a658 Mon Sep 17 00:00:00 2001 From: Lucio Rossi Date: Tue, 12 Mar 2024 18:54:29 +0100 Subject: [PATCH 2/2] move and rotate pids Kp to 4.0 --- src/definitions/robot_definitions.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/definitions/robot_definitions.h b/src/definitions/robot_definitions.h index 2291ca9..d1b04c7 100644 --- a/src/definitions/robot_definitions.h +++ b/src/definitions/robot_definitions.h @@ -41,14 +41,14 @@ const float MOTOR_RATIO = MOTOR_CPR*MOTOR_GEAR_RATIO; // Kinematics control -#define ROTATE_KP_DEFAULT 5.0 +#define ROTATE_KP_DEFAULT 4.0 #define ROTATE_KI_DEFAULT 0.01 #define ROTATE_KD_DEFAULT 0.001 #define ROTATE_CONTROL_PERIOD 0.02 #define ROTATE_MAX_SPEED 170.0 #define ROTATE_THRESHOLD 1 -#define MOVE_KP_DEFAULT 5.0 +#define MOVE_KP_DEFAULT 4.0 #define MOVE_KI_DEFAULT 0.01 #define MOVE_KD_DEFAULT 0.001 #define MOVE_CONTROL_PERIOD 0.02