|
|
@ -22,7 +22,7 @@ static TMC4361A motora; |
|
|
|
static TMC4361A motorb; |
|
|
|
static ZCanCmder zcanCmder; |
|
|
|
static ZCanBasicOrderModule zcanBasicOrderModule; |
|
|
|
// static ZCANXYRobotCtrlModule zcanXYRobotCtrlModule;
|
|
|
|
static ZCANXYRobotCtrlModule zcanXYRobotCtrlModule; |
|
|
|
static XYRobotCtrlModule xyRobotCtrlModule; |
|
|
|
|
|
|
|
void umain() { |
|
|
@ -96,7 +96,6 @@ void umain() { |
|
|
|
return 123; |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
/*******************************************************************************
|
|
|
|
* zcanXYRobotCtrlModule * |
|
|
|
*******************************************************************************/ |
|
|
@ -110,22 +109,31 @@ void umain() { |
|
|
|
input[6].initAsInput(ARM_SENSOR7_GPIO, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, false); |
|
|
|
input[7].initAsInput(ARM_SENSOR8_GPIO, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, false); |
|
|
|
|
|
|
|
xyRobotCtrlModule.initialize(&motora, &motorb, &input[6], &input[7], 1.0f); |
|
|
|
xyRobotCtrlModule.set_speed(1000000); |
|
|
|
xyRobotCtrlModule.set_acc(3000000); |
|
|
|
xyRobotCtrlModule.set_dec(3000000); |
|
|
|
xyRobotCtrlModule.set_zero_robottype(xyRobotCtrlModule.corexy); |
|
|
|
xyRobotCtrlModule.set_shaft(false, false); |
|
|
|
// zcanXYRobotCtrlModule.initialize(&zcanCmder, 1, &xyRobotCtrlModule);
|
|
|
|
|
|
|
|
// ARM_SENSOR1_GPIO.initAsInput(STM32_GPIO::kInput_risingAndFallingIrq, true);
|
|
|
|
// ARM_SENSOR2_GPIO.initAsInput(STM32_GPIO::kInput_risingAndFallingIrq, true);
|
|
|
|
// ARM_SENSOR3_GPIO.initAsInput();
|
|
|
|
// ARM_SENSOR4_GPIO.initAsInput();
|
|
|
|
// ARM_SENSOR5_GPIO.initAsInput();
|
|
|
|
// ARM_SENSOR6_GPIO.initAsInput();
|
|
|
|
// ARM_SENSOR7_GPIO.initAsInput(STM32_GPIO::kInput_risingAndFallingIrq, true);
|
|
|
|
// ARM_SENSOR8_GPIO.initAsInput(STM32_GPIO::kInput_risingAndFallingIrq, true);
|
|
|
|
{ |
|
|
|
xyRobotCtrlModule.initialize(&motora, &motorb, &input[6], &input[7], 1.0f); |
|
|
|
XYRobotCtrlModule::run_param_t param; |
|
|
|
xyRobotCtrlModule.read_run_param(param); |
|
|
|
param.robot_type = XYRobotCtrlModule::corexy; |
|
|
|
param.distance_scale = 1000; // = 1.0
|
|
|
|
param.x_shaft = false; |
|
|
|
param.y_shaft = false; |
|
|
|
param.ihold = 1; |
|
|
|
param.irun = 3; |
|
|
|
param.maxspeed = 1000000; |
|
|
|
param.acc = 3000000; |
|
|
|
param.dec = 3000000; |
|
|
|
xyRobotCtrlModule.set_run_param(param); |
|
|
|
|
|
|
|
XYRobotCtrlModule::run_to_zero_param_t run_to_zero_param; |
|
|
|
xyRobotCtrlModule.read_run_to_zero_param(run_to_zero_param); |
|
|
|
run_to_zero_param.move_to_zero_max_d = 5120000; |
|
|
|
run_to_zero_param.leave_from_zero_max_d = 5120000; |
|
|
|
run_to_zero_param.speed = 30000; |
|
|
|
run_to_zero_param.dec = 600000; |
|
|
|
xyRobotCtrlModule.set_run_to_zero_param(run_to_zero_param); |
|
|
|
|
|
|
|
zcanXYRobotCtrlModule.initialize(&zcanCmder, 1, &xyRobotCtrlModule); |
|
|
|
} |
|
|
|
|
|
|
|
while (true) { |
|
|
|
OSDefaultSchduler::getInstance()->loop(); |
|
|
|