From 3b900f1d8a7d9810cae08d9d66c7d7d03b7d7e25 Mon Sep 17 00:00:00 2001 From: Simon Frei Date: Sun, 18 Dec 2022 10:32:06 +0100 Subject: [PATCH] use tuned params (pid and turn) --- ADIS_Sumo/Sumo/Pid.c | 10 +++++----- ADIS_Sumo/Sumo/Turn.c | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ADIS_Sumo/Sumo/Pid.c b/ADIS_Sumo/Sumo/Pid.c index aa8b125..062c482 100644 --- a/ADIS_Sumo/Sumo/Pid.c +++ b/ADIS_Sumo/Sumo/Pid.c @@ -630,11 +630,11 @@ void PID_Init(void) { lineFwConfig.lastError = 0; lineFwConfig.integral = 0; #elif PL_IS_INTRO_ZUMO_ROBOT2 || PL_IS_INTRO_ZUMO_K22 - lineFwConfig.pFactor100 = 5500; + lineFwConfig.pFactor100 = 4000;//5500; lineFwConfig.iFactor100 = 15; - lineFwConfig.dFactor100 = 100; + lineFwConfig.dFactor100 = 500;//100; lineFwConfig.iAntiWindup = 100000; - lineFwConfig.maxSpeedPercent = 40; + lineFwConfig.maxSpeedPercent = 25;//40; lineFwConfig.lastError = 0; lineFwConfig.integral = 0; #else @@ -672,11 +672,11 @@ void PID_Init(void) { posLeftConfig.iAntiWindup = 200; posLeftConfig.maxSpeedPercent = 40; #elif (PL_CONFIG_APP_LINE_FOLLOWING || PL_CONFIG_APP_LINE_MAZE) /* line/maze, high speed */ - posLeftConfig.pFactor100 = 1000; + posLeftConfig.pFactor100 = 2000;//1000; posLeftConfig.iFactor100 = 2; posLeftConfig.dFactor100 = 50; posLeftConfig.iAntiWindup = 200; - posLeftConfig.maxSpeedPercent = 40; + posLeftConfig.maxSpeedPercent = 35;//40; #else /* defaults */ posLeftConfig.pFactor100 = 1000; posLeftConfig.iFactor100 = 1; diff --git a/ADIS_Sumo/Sumo/Turn.c b/ADIS_Sumo/Sumo/Turn.c index 094f59e..966ce2b 100644 --- a/ADIS_Sumo/Sumo/Turn.c +++ b/ADIS_Sumo/Sumo/Turn.c @@ -63,11 +63,11 @@ #define TURN_STEPS_POST_LINE_TIMEOUT_MS 500 #define TURN_STEPS_STOP_TIMEOUT_MS 150 #elif PL_IS_INTRO_ZUMO_K22 /* no LiPo */ - #define TURN_STEPS_90 720 + #define TURN_STEPS_90 650//720 /*!< number of steps for a 90 degree turn */ - #define TURN_STEPS_LINE 100 /*230*/ + #define TURN_STEPS_LINE 170//100 /*230*/ /*!< number of steps stepping over the line */ - #define TURN_STEPS_POST_LINE 150 + #define TURN_STEPS_POST_LINE 240//150 /*!< number of steps after the line, before making a turn */ #define TURN_STEPS_90_TIMEOUT_MS 1000 #define TURN_STEPS_LINE_TIMEOUT_MS 200