|
@ -55,17 +55,17 @@ static void initsubmodule() { |
|
|
input[0].initAsInput(MOTOR0_REFL /*REFL*/, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, true); |
|
|
input[0].initAsInput(MOTOR0_REFL /*REFL*/, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, true); |
|
|
input[1].initAsInput(MOTOR0_REFR /*REFR*/, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, true); |
|
|
input[1].initAsInput(MOTOR0_REFR /*REFR*/, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, true); |
|
|
|
|
|
|
|
|
I_StepMotorCtrlModule::flash_config_t smcm_cfg = {0}; |
|
|
|
|
|
|
|
|
StepMotorCtrlModule::flash_config_t smcm_cfg = {0}; |
|
|
StepMotorCtrlModule::create_default_cfg(smcm_cfg); |
|
|
StepMotorCtrlModule::create_default_cfg(smcm_cfg); |
|
|
smcm_cfg.base_param.distance_scale = 80; |
|
|
|
|
|
smcm_cfg.base_param.distance_scale_denominator = 1; |
|
|
|
|
|
smcm_cfg.base_param.ihold = 1; |
|
|
|
|
|
smcm_cfg.base_param.irun = 8; |
|
|
|
|
|
smcm_cfg.base_param.x_shaft = false; |
|
|
|
|
|
smcm_cfg.base_param.maxspeed = 500; |
|
|
|
|
|
smcm_cfg.base_param.run_to_zero_speed = 100; |
|
|
|
|
|
smcm_cfg.base_param.max_x = 0; |
|
|
|
|
|
smcm_cfg.base_param.min_x = 0; |
|
|
|
|
|
|
|
|
smcm_cfg.base_param.motor_one_circle_pulse = 80; |
|
|
|
|
|
smcm_cfg.base_param.motor_one_circle_pulse_denominator = 1; |
|
|
|
|
|
smcm_cfg.base_param.stepmotor_ihold = 1; |
|
|
|
|
|
smcm_cfg.base_param.stepmotor_irun = 8; |
|
|
|
|
|
smcm_cfg.base_param.motor_shaft = false; |
|
|
|
|
|
smcm_cfg.base_param.motor_default_velocity = 500; |
|
|
|
|
|
smcm_cfg.base_param.motor_run_to_zero_speed = 100; |
|
|
|
|
|
smcm_cfg.base_param.max_d = 0; |
|
|
|
|
|
smcm_cfg.base_param.min_d = 0; |
|
|
|
|
|
|
|
|
g_stepMotorCtrlModule.initialize(initer.get_module_id(1), &g_motor, input, ZARRAY_SIZE(input), nullptr, &smcm_cfg); |
|
|
g_stepMotorCtrlModule.initialize(initer.get_module_id(1), &g_motor, input, ZARRAY_SIZE(input), nullptr, &smcm_cfg); |
|
|
initer.register_module(&g_stepMotorCtrlModule); |
|
|
initer.register_module(&g_stepMotorCtrlModule); |
|
@ -92,17 +92,17 @@ static void initsubmodule() { |
|
|
input[0].initAsInput(MOTOR1_REFL /*REFL*/, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, true); |
|
|
input[0].initAsInput(MOTOR1_REFL /*REFL*/, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, true); |
|
|
input[1].initAsInput(MOTOR1_REFR /*REFR*/, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, true); |
|
|
input[1].initAsInput(MOTOR1_REFR /*REFR*/, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, true); |
|
|
|
|
|
|
|
|
I_StepMotorCtrlModule::flash_config_t smcm_cfg = {0}; |
|
|
|
|
|
|
|
|
StepMotorCtrlModule::flash_config_t smcm_cfg = {0}; |
|
|
StepMotorCtrlModule::create_default_cfg(smcm_cfg); |
|
|
StepMotorCtrlModule::create_default_cfg(smcm_cfg); |
|
|
smcm_cfg.base_param.distance_scale = 80; |
|
|
|
|
|
smcm_cfg.base_param.distance_scale_denominator = 1; |
|
|
|
|
|
smcm_cfg.base_param.ihold = 1; |
|
|
|
|
|
smcm_cfg.base_param.irun = 8; |
|
|
|
|
|
smcm_cfg.base_param.x_shaft = false; |
|
|
|
|
|
smcm_cfg.base_param.maxspeed = 500; |
|
|
|
|
|
smcm_cfg.base_param.run_to_zero_speed = 100; |
|
|
|
|
|
smcm_cfg.base_param.max_x = 0; |
|
|
|
|
|
smcm_cfg.base_param.min_x = 0; |
|
|
|
|
|
|
|
|
smcm_cfg.base_param.motor_one_circle_pulse = 100; |
|
|
|
|
|
smcm_cfg.base_param.motor_one_circle_pulse_denominator = 1; |
|
|
|
|
|
smcm_cfg.base_param.stepmotor_ihold = 4; |
|
|
|
|
|
smcm_cfg.base_param.stepmotor_irun = 16; |
|
|
|
|
|
smcm_cfg.base_param.motor_shaft = true; |
|
|
|
|
|
smcm_cfg.base_param.motor_default_velocity = 50; |
|
|
|
|
|
smcm_cfg.base_param.motor_run_to_zero_speed = 50; |
|
|
|
|
|
smcm_cfg.base_param.max_d = 0; |
|
|
|
|
|
smcm_cfg.base_param.min_d = 0; |
|
|
|
|
|
|
|
|
g_stepMotorCtrlModule.initialize(initer.get_module_id(2), &g_motor, input, ZARRAY_SIZE(input), nullptr, &smcm_cfg); |
|
|
g_stepMotorCtrlModule.initialize(initer.get_module_id(2), &g_motor, input, ZARRAY_SIZE(input), nullptr, &smcm_cfg); |
|
|
initer.register_module(&g_stepMotorCtrlModule); |
|
|
initer.register_module(&g_stepMotorCtrlModule); |
|
@ -122,7 +122,7 @@ static void initsubmodule() { |
|
|
feiteservomotor_bus.initialize(&huart2, &hdma_usart2_rx, &hdma_usart2_tx); |
|
|
feiteservomotor_bus.initialize(&huart2, &hdma_usart2_rx, &hdma_usart2_tx); |
|
|
|
|
|
|
|
|
static MiniRobotCtrlModule::flash_config_t cfg = {0}; |
|
|
static MiniRobotCtrlModule::flash_config_t cfg = {0}; |
|
|
cfg.default_torque = 100; |
|
|
|
|
|
|
|
|
cfg.default_torque = 400; |
|
|
mini_servo.initialize(initer.get_module_id(3), &feiteservomotor_bus, 1, &cfg); |
|
|
mini_servo.initialize(initer.get_module_id(3), &feiteservomotor_bus, 1, &cfg); |
|
|
initer.register_module(&mini_servo); |
|
|
initer.register_module(&mini_servo); |
|
|
} |
|
|
} |
|
|