From ddbe4178de6601b71e5dad8173bb1a223832eec7 Mon Sep 17 00:00:00 2001 From: TonyZhang Date: Wed, 13 Mar 2024 23:21:45 +0800 Subject: [PATCH] modify flash configs and adjust pa_hero's feedback for pid params --- config/RM_Board_Linux.cfg | 22 ------------------- config/RM_Board_Mac.cfg | 22 ------------------- config/{RM_Board_Win.cfg => RM_F4_Stlink.cfg} | 0 config/openocd_flash.sh | 4 ++-- .../param_adjusts/pa_hero/pa_hero.cpp | 3 ++- 5 files changed, 4 insertions(+), 47 deletions(-) delete mode 100644 config/RM_Board_Linux.cfg delete mode 100644 config/RM_Board_Mac.cfg rename config/{RM_Board_Win.cfg => RM_F4_Stlink.cfg} (100%) diff --git a/config/RM_Board_Linux.cfg b/config/RM_Board_Linux.cfg deleted file mode 100644 index 383254da..00000000 --- a/config/RM_Board_Linux.cfg +++ /dev/null @@ -1,22 +0,0 @@ -source [find interface/stlink-v2.cfg] - -set WORKAREASIZE 0x8000 - -transport select hla_swd - -# Enable debug when in low power modes -set ENABLE_LOW_POWER 1 - -# Stop Watchdog counters when halt -set STOP_WATCHDOG 1 - -# STLink Debug clock frequency -set CLOCK_FREQ 1800 - -# Use software system reset -reset_config trst_only combined -set CONNECT_UNDER_RESET 0 - -source [find target/stm32f4x.cfg] - -stm32f4x.cpu configure -rtos ChibiOS \ No newline at end of file diff --git a/config/RM_Board_Mac.cfg b/config/RM_Board_Mac.cfg deleted file mode 100644 index 78e37136..00000000 --- a/config/RM_Board_Mac.cfg +++ /dev/null @@ -1,22 +0,0 @@ -source [find interface/stlink-V2.cfg] - -set WORKAREASIZE 0x8000 - -transport select hla_swd - -# Enable debug when in low power modes -set ENABLE_LOW_POWER 1 - -# Stop Watchdog counters when halt -set STOP_WATCHDOG 1 - -# STLink Debug clock frequency -set CLOCK_FREQ 1800 - -# Use software system reset -reset_config trst_only combined -set CONNECT_UNDER_RESET 0 - -source [find target/stm32f4x.cfg] - -stm32f4x.cpu configure -rtos chibios \ No newline at end of file diff --git a/config/RM_Board_Win.cfg b/config/RM_F4_Stlink.cfg similarity index 100% rename from config/RM_Board_Win.cfg rename to config/RM_F4_Stlink.cfg diff --git a/config/openocd_flash.sh b/config/openocd_flash.sh index 02687f62..4766621b 100755 --- a/config/openocd_flash.sh +++ b/config/openocd_flash.sh @@ -16,8 +16,8 @@ cd "$config_base" exit_cmd="exit" # default flash file: hero flash_file="../build/HERO.elf" -# default flash config file: RM_Board_Win.cfg -config_file="RM_Board_Win.cfg" +# default flash config file: RM_F4_Stlink.cfg +config_file="RM_F4_Stlink.cfg" diff --git a/dev/application/param_adjusts/pa_hero/pa_hero.cpp b/dev/application/param_adjusts/pa_hero/pa_hero.cpp index 0a58698d..7ce42739 100644 --- a/dev/application/param_adjusts/pa_hero/pa_hero.cpp +++ b/dev/application/param_adjusts/pa_hero/pa_hero.cpp @@ -204,13 +204,14 @@ DEF_SHELL_CMD_START(cmd_echo_param) unsigned pid_id = Shell::atoi(argv[1]); if (pid_id > 1) { + // TODO, pid_id=2 for autostraightening Shell::printf("Invalid pid ID %d" SHELL_NEWLINE_STR, pid_id); return false; } PIDController::pid_params_t pid_param = {0,0,0,0,0}; pid_param = CANMotorController::getPIDParams((CANMotorCFG::motor_id_t)motor_id, (pid_id == 0)); - Shell::printf("kp: %.2f, ki: %.2f, kd: %.2f, i_limit: %.2f, out_limit: %.2f" SHELL_NEWLINE_STR, + Shell::printf("!kp:%u,%.2f,ki:%.2f,kd:%.2f,il:%.2f,ol:%.2f" SHELL_NEWLINE_STR,pid_id, pid_param.kp, pid_param.ki, pid_param.kd, pid_param.i_limit, pid_param.out_limit); return true; // command executed successfully DEF_SHELL_CMD_END