|
|
@ -77,13 +77,11 @@ void Subboard10HbotV2::initialize() { |
|
|
|
ZLOGI(TAG, "motorb initialize TMC51X0:%x", motora.readICVersion()); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/*******************************************************************************
|
|
|
|
* zcanXYRobotCtrlModule * |
|
|
|
*******************************************************************************/ |
|
|
|
static ZGPIO input[4]; |
|
|
|
|
|
|
|
|
|
|
|
input[0].initAsInput(EXT_INPUT_IO0); |
|
|
|
input[1].initAsInput(EXT_INPUT_IO1); |
|
|
|
input[2].initAsInput(EXT_INPUT_IO2); |
|
|
@ -92,33 +90,38 @@ void Subboard10HbotV2::initialize() { |
|
|
|
static XYRobotCtrlModule::config_t xy_defaultcfg; |
|
|
|
XYRobotCtrlModule::create_default_cfg(xy_defaultcfg); |
|
|
|
|
|
|
|
#define LEVEL1_A 15
|
|
|
|
#define LEVEL2_A 40
|
|
|
|
#define START_AND_STOP_V 30
|
|
|
|
#define V1 200
|
|
|
|
|
|
|
|
xy_defaultcfg.robot_type = XYRobotCtrlModule::khbot; |
|
|
|
xy_defaultcfg.one_circle_pulse = 7344; |
|
|
|
xy_defaultcfg.one_circle_pulse_denominator = 1; |
|
|
|
xy_defaultcfg.ihold = 1; |
|
|
|
xy_defaultcfg.ihold = 10; |
|
|
|
xy_defaultcfg.irun = 31; |
|
|
|
xy_defaultcfg.iholddelay = 100; |
|
|
|
xy_defaultcfg.iglobalscaler = 32; |
|
|
|
xy_defaultcfg.vstart = TMC5130_DEFAULT__MOTOR_VSTART; |
|
|
|
xy_defaultcfg.a1 = TMC5130_DEFAULT__MOTOR_A1; |
|
|
|
xy_defaultcfg.amax = TMC5130_DEFAULT__MOTOR_AMAX; |
|
|
|
xy_defaultcfg.v1 = TMC5130_DEFAULT__MOTOR_V1; |
|
|
|
xy_defaultcfg.dmax = TMC5130_DEFAULT__MOTOR_DMAX; |
|
|
|
xy_defaultcfg.d1 = TMC5130_DEFAULT__MOTOR_D1; |
|
|
|
xy_defaultcfg.vstop = TMC5130_DEFAULT__MOTOR_VSTOP; |
|
|
|
xy_defaultcfg.tzerowait = TMC5130_DEFAULT__MOTOR_TZEROWAIT; |
|
|
|
xy_defaultcfg.iglobalscaler = 128; |
|
|
|
xy_defaultcfg.vstart = START_AND_STOP_V; |
|
|
|
xy_defaultcfg.a1 = LEVEL1_A; |
|
|
|
xy_defaultcfg.amax = LEVEL2_A; |
|
|
|
xy_defaultcfg.v1 = V1; |
|
|
|
xy_defaultcfg.dmax = LEVEL2_A; |
|
|
|
xy_defaultcfg.d1 = LEVEL1_A; |
|
|
|
xy_defaultcfg.vstop = START_AND_STOP_V; |
|
|
|
xy_defaultcfg.tzerowait = 10; |
|
|
|
xy_defaultcfg.enc_resolution = 1000; |
|
|
|
xy_defaultcfg.enable_enc = 1; |
|
|
|
xy_defaultcfg.x_shaft = 0; |
|
|
|
xy_defaultcfg.x_shaft = 1; |
|
|
|
xy_defaultcfg.y_shaft = 1; |
|
|
|
xy_defaultcfg.default_velocity = 300; |
|
|
|
xy_defaultcfg.default_velocity = 800; |
|
|
|
xy_defaultcfg.shift_x = 0; |
|
|
|
xy_defaultcfg.shift_y = 0; |
|
|
|
xy_defaultcfg.min_x = 0; |
|
|
|
xy_defaultcfg.min_y = 0; |
|
|
|
xy_defaultcfg.max_x = 0; |
|
|
|
xy_defaultcfg.max_y = 0; |
|
|
|
xy_defaultcfg.run_to_zero_speed = 40; |
|
|
|
xy_defaultcfg.min_x = -20; |
|
|
|
xy_defaultcfg.min_y = -20; |
|
|
|
xy_defaultcfg.max_x = 55150; |
|
|
|
xy_defaultcfg.max_y = 41500; |
|
|
|
xy_defaultcfg.run_to_zero_speed = 80; |
|
|
|
xy_defaultcfg.look_zero_edge_speed = 10; |
|
|
|
|
|
|
|
xyRobotCtrlModule.initialize(getmoduleId(1), &motora, &motorb, &input[0], 4, xy_defaultcfg); |
|
|
|