From 551694b6301b8410cc076c47ffa29dc945007d86 Mon Sep 17 00:00:00 2001 From: zhaohe Date: Wed, 6 Sep 2023 05:39:29 +0800 Subject: [PATCH] update --- README.md | 36 +++++++++++++++++++++++++++++++++++- usrc/main.cpp | 30 +++++++++++++++--------------- 2 files changed, 50 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 085e360..d7f06df 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,36 @@ 开发板资料 -http://47.111.11.73/docs/boards/stm32/zdyz_stm32f407_explorer.html \ No newline at end of file +http://47.111.11.73/docs/boards/stm32/zdyz_stm32f407_explorer.html + + +步进电机指令 +step_motor_setvelocity 1 2000 +step_motor_setvelocity 2 2000 +step_motor_setvelocity 3 2000 +step_motor_setvelocity 4 2000 + + +step_motor_moveby 1 51200 +step_motor_moveby 2 51200 +step_motor_moveby 3 51200 +step_motor_moveby 4 40000 + + +迷你步进电机指令 + +stepmotor45_moveTo 1 512 +stepmotor45_moveTo 2 512 +stepmotor45_moveTo 3 512 +stepmotor45_moveTo 4 512 +stepmotor45_moveTo 5 512 +stepmotor45_moveTo 6 512 + +stepmotor45_moveBy 1 -25600 + +stepmotor45_moveBy 2 -25600 +stepmotor45_moveBy 3 -25600 +stepmotor45_moveBy 4 -25600 + +stepmotor45_moveBy 1 25600 +stepmotor45_moveBy 2 25600 +stepmotor45_moveBy 3 25600 +stepmotor45_moveBy 4 25600 \ No newline at end of file diff --git a/usrc/main.cpp b/usrc/main.cpp index 134b936..fd9dedd 100644 --- a/usrc/main.cpp +++ b/usrc/main.cpp @@ -42,77 +42,77 @@ static StepMotor45::cfg_t cfg1 = { .max_pos = -1, .enable_zero_limit = false, .enable_max_pos_limit = false, - .mirror = false, + .mirror = true, .zeroPin = PinNull, .zeroPinMirror = false, .driverPin = {PB15, PD11, PD12, PD13}, - .driverPinMirror = false, + .driverPinMirror = true, }; static StepMotor45::cfg_t cfg2 = { .max_pos = -1, .enable_zero_limit = false, .enable_max_pos_limit = false, - .mirror = false, + .mirror = true, .zeroPin = PinNull, .zeroPinMirror = false, .driverPin = {PG2, PG3, PG4, PG5}, - .driverPinMirror = false, + .driverPinMirror = true, }; static StepMotor45::cfg_t cfg3 = { .max_pos = -1, .enable_zero_limit = false, .enable_max_pos_limit = false, - .mirror = false, + .mirror = true, .zeroPin = PinNull, .zeroPinMirror = false, .driverPin = {PG6, PG7, PG8, PC6}, - .driverPinMirror = false, + .driverPinMirror = true, }; static StepMotor45::cfg_t cfg4 = { .max_pos = -1, .enable_zero_limit = false, .enable_max_pos_limit = false, - .mirror = false, + .mirror = true, .zeroPin = PinNull, .zeroPinMirror = false, - .driverPin = {PC7, PC8, PC9, PA8}, - .driverPinMirror = false, + .driverPin = {PE0, PE2, PE4, PE6}, + .driverPinMirror = true, }; static StepMotor45::cfg_t cfg5 = { .max_pos = -1, .enable_zero_limit = false, .enable_max_pos_limit = false, - .mirror = false, + .mirror = true, .zeroPin = PinNull, .zeroPinMirror = false, - .driverPin = {PA13, PA14, PA15, PC10}, - .driverPinMirror = false, + .driverPin = {PC13, PE5, PE3, PE1}, + .driverPinMirror = true, }; static StepMotor45::cfg_t cfg6 = { .max_pos = -1, .enable_zero_limit = false, .enable_max_pos_limit = false, - .mirror = false, + .mirror = true, .zeroPin = PinNull, .zeroPinMirror = false, .driverPin = {PC12, PD3, PD5, PD7}, - .driverPinMirror = false, + .driverPinMirror = true, }; map screw_lead = { @@ -400,7 +400,7 @@ void Main::run() { g_step_motor[i++].initialize(15, 10000, &m_IflytopCanMaster); g_step_motor[i++].initialize(16, 10000, &m_IflytopCanMaster); - // g_step_motor45[0].initialize(cfg1); + g_step_motor45[0].initialize(cfg1); g_step_motor45[1].initialize(cfg1); g_step_motor45[2].initialize(cfg2); g_step_motor45[3].initialize(cfg3);