From 62a49c14895b6d77ceda92f55bbb15dbe2780cab Mon Sep 17 00:00:00 2001 From: zhaohe Date: Tue, 25 Jun 2024 21:04:08 +0800 Subject: [PATCH] update --- usrc/subboards/subboard10_hbot_v2/pri_board.h | 18 +++++++++--------- .../subboard10_hbot_v2/subboard10_hbot_v2.cpp | 7 ++----- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/usrc/subboards/subboard10_hbot_v2/pri_board.h b/usrc/subboards/subboard10_hbot_v2/pri_board.h index c5727cd..bc4ab9c 100644 --- a/usrc/subboards/subboard10_hbot_v2/pri_board.h +++ b/usrc/subboards/subboard10_hbot_v2/pri_board.h @@ -30,8 +30,8 @@ * 电机1 * ***********************************************************************************************************************/ -#define MOTOR1_CSN PA4 -#define MOTOR1_ENN PB7 +#define MOTOR1_CSN PA4 +#define MOTOR1_ENN PB7 #define MOTOR1_REFL PD0 #define MOTOR1_REFR PinNull @@ -42,10 +42,10 @@ #define MOTOR1_MOTOR_ONE_CIRCLE_PULSE 60 #define MOTOR1_MOTOR_ONE_CIRCLE_PULSE_DENOMINATOR 1 #define MOTOR1_STEPMOTOR_IHOLD 1 -#define MOTOR1_STEPMOTOR_IRUN 5 +#define MOTOR1_STEPMOTOR_IRUN 7 #define MOTOR1_STEPMOTOR_IHOLDDELAY 100 -#define MOTOR1_STEPMOTOR_IGLOBALSCALER 0 -#define MOTOR1_MOTOR_DEFAULT_VELOCITY 500 +#define MOTOR1_STEPMOTOR_IGLOBALSCALER 32 +#define MOTOR1_MOTOR_DEFAULT_VELOCITY 800 #define MOTOR1_MIN_D 0 #define MOTOR1_MAX_D 0 #define MOTOR1_MOTOR_RUN_TO_ZERO_SPEED 400 @@ -63,8 +63,8 @@ * 电机2 * ***********************************************************************************************************************/ -#define MOTOR2_CSN PC4 -#define MOTOR2_ENN PE13 +#define MOTOR2_CSN PC4 +#define MOTOR2_ENN PE13 #define MOTOR2_REFL PinNull #define MOTOR2_REFR PinNull @@ -75,9 +75,9 @@ #define MOTOR2_MOTOR_ONE_CIRCLE_PULSE 80 #define MOTOR2_MOTOR_ONE_CIRCLE_PULSE_DENOMINATOR 1 #define MOTOR2_STEPMOTOR_IHOLD 1 -#define MOTOR2_STEPMOTOR_IRUN 5 +#define MOTOR2_STEPMOTOR_IRUN 7 #define MOTOR2_STEPMOTOR_IHOLDDELAY 100 -#define MOTOR2_STEPMOTOR_IGLOBALSCALER 0 +#define MOTOR2_STEPMOTOR_IGLOBALSCALER 32 #define MOTOR2_MOTOR_DEFAULT_VELOCITY 500 #define MOTOR2_MIN_D 0 #define MOTOR2_MAX_D 0 diff --git a/usrc/subboards/subboard10_hbot_v2/subboard10_hbot_v2.cpp b/usrc/subboards/subboard10_hbot_v2/subboard10_hbot_v2.cpp index e80402f..420f799 100644 --- a/usrc/subboards/subboard10_hbot_v2/subboard10_hbot_v2.cpp +++ b/usrc/subboards/subboard10_hbot_v2/subboard10_hbot_v2.cpp @@ -21,7 +21,7 @@ using namespace iflytop; * IMPL * ***********************************************************************************************************************/ void Subboard10HbotV2::initialize() { - // IO_INIT(); + IO_INIT(); GService::inst()->getZCanProtocolParser()->registerModule(this); // PB12 @@ -40,15 +40,12 @@ void Subboard10HbotV2::initialize() { TMC51X0_1_SD_MODE.initAsOutput(PB4, iflytop::ZGPIO::kMode_nopull, false, false); TMC51X0_2_SPI_MODE.initAsOutput(PE11, iflytop::ZGPIO::kMode_nopull, false, true); TMC51X0_2_SD_MODE.initAsOutput(PE12, iflytop::ZGPIO::kMode_nopull, false, false); - + osDelay(10); motorPowerEnPin.initAsOutput(PB12, iflytop::ZGPIO::kMode_nopull, true, true); - osDelay(100); - TMC5130_MOTOR_INITER(/*motorid*/ 1, /*moduleid*/ 1); TMC5130_MOTOR_INITER(/*motorid*/ 2, /*moduleid*/ 2); - #if 0 /*********************************************************************************************************************** * ID1 *