|
@ -39,7 +39,7 @@ class WidthDetector { |
|
|
APPDM* m_dm; |
|
|
APPDM* m_dm; |
|
|
|
|
|
|
|
|
int32_t m_bullet_distance = 33; // 理论值33,这里取保守值20
|
|
|
int32_t m_bullet_distance = 33; // 理论值33,这里取保守值20
|
|
|
int32_t m_bullet_full_distance = 168; |
|
|
|
|
|
|
|
|
int32_t m_bullet_full_distance = 127; |
|
|
|
|
|
|
|
|
public: |
|
|
public: |
|
|
void init(IntelligentWindingRobotCtrl::config_t* cfg, APPDM* dm) { |
|
|
void init(IntelligentWindingRobotCtrl::config_t* cfg, APPDM* dm) { |
|
@ -177,7 +177,7 @@ class WidthDetector { |
|
|
wait_module_idle(14); |
|
|
wait_module_idle(14); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
bool isFull() { return g_nowdpos > m_bullet_full_distance - 10; } |
|
|
|
|
|
|
|
|
bool isFull() { return g_nowdpos > m_bullet_full_distance - 20; } |
|
|
bool isHasBullet() { return g_nowdpos > 5; } |
|
|
bool isHasBullet() { return g_nowdpos > 5; } |
|
|
bool isRemoveLineEnd() { return g_nowdpos < m_bullet_distance + 10; } |
|
|
bool isRemoveLineEnd() { return g_nowdpos < m_bullet_distance + 10; } |
|
|
}; |
|
|
}; |
|
@ -224,7 +224,7 @@ int32_t IntelligentWindingRobotCtrl::initialize_device() { |
|
|
cfg.m15_paifei_press_torque = 330; |
|
|
cfg.m15_paifei_press_torque = 330; |
|
|
|
|
|
|
|
|
cfg.m16_xianlajin_reset_pos = 2047; |
|
|
cfg.m16_xianlajin_reset_pos = 2047; |
|
|
cfg.m16_xianlajin_cook_line_end_ready_pos = 1959; |
|
|
|
|
|
|
|
|
cfg.m16_xianlajin_cook_line_end_ready_pos = 1900; |
|
|
cfg.m16_xianlajin_tight_line_pos = 1966; |
|
|
cfg.m16_xianlajin_tight_line_pos = 1966; |
|
|
cfg.m16_xianlajin_winding_low_pos = 1885; |
|
|
cfg.m16_xianlajin_winding_low_pos = 1885; |
|
|
cfg.m16_xianlajin_winding_high_pos = 1815; |
|
|
cfg.m16_xianlajin_winding_high_pos = 1815; |
|
@ -245,12 +245,12 @@ int32_t IntelligentWindingRobotCtrl::initialize_device() { |
|
|
cfg.xy_platform_takeline_pos_y = 7047; |
|
|
cfg.xy_platform_takeline_pos_y = 7047; |
|
|
|
|
|
|
|
|
cfg.xy_platform_enter_line_pos_x = 17625; |
|
|
cfg.xy_platform_enter_line_pos_x = 17625; |
|
|
cfg.xy_platform_enter_line_pos_y = 6700; |
|
|
|
|
|
|
|
|
cfg.xy_platform_enter_line_pos_y = 6600; |
|
|
//
|
|
|
//
|
|
|
cfg.z_axis_cook_bullet_pos = 3277; |
|
|
|
|
|
|
|
|
cfg.z_axis_cook_bullet_pos = 3400; // 3277
|
|
|
cfg.z_axis_take_clip_pos = 6850; |
|
|
cfg.z_axis_take_clip_pos = 6850; |
|
|
cfg.z_axis_take_line_high = 3500; |
|
|
cfg.z_axis_take_line_high = 3500; |
|
|
cfg.z_axis_transfer_line_high = 2675; |
|
|
|
|
|
|
|
|
cfg.z_axis_transfer_line_high = 2275; |
|
|
cfg.z_axis_remove_line_high = 3567; |
|
|
cfg.z_axis_remove_line_high = 3567; |
|
|
|
|
|
|
|
|
cfg.m2_zerooff = 1110; |
|
|
cfg.m2_zerooff = 1110; |
|
@ -474,9 +474,9 @@ int32_t IntelligentWindingRobotCtrl::m22_scissors_move_reset_pos() { |
|
|
WAIT_MODULES_IDLE(22); |
|
|
WAIT_MODULES_IDLE(22); |
|
|
m_dm->motor_move_to(22, 1250, 0, 0); |
|
|
m_dm->motor_move_to(22, 1250, 0, 0); |
|
|
} |
|
|
} |
|
|
int32_t IntelligentWindingRobotCtrl::m22_scissors_cut() { return m_dm->motor_move_to(22, 2070, 0, 0); } |
|
|
|
|
|
|
|
|
int32_t IntelligentWindingRobotCtrl::m22_scissors_cut() { return m_dm->motor_move_to(22, 2500, 0, 0); } |
|
|
int32_t IntelligentWindingRobotCtrl::m23_laxian_motor_move_to_reset_pos() { return m_dm->motor_move_to_torque(23, 2040, 200, 0); } |
|
|
int32_t IntelligentWindingRobotCtrl::m23_laxian_motor_move_to_reset_pos() { return m_dm->motor_move_to_torque(23, 2040, 200, 0); } |
|
|
int32_t IntelligentWindingRobotCtrl::m23_laxian_motor_move_to_tight_line_pos() { return m_dm->motor_rotate_with_torque(23, -1, 40); } |
|
|
|
|
|
|
|
|
int32_t IntelligentWindingRobotCtrl::m23_laxian_motor_move_to_tight_line_pos() { return m_dm->motor_move_to_torque(23, 1800, 40, 0); } |
|
|
int32_t IntelligentWindingRobotCtrl::m4_zreset() { m_dm->motor_move_to_zero_backward(4, 450, 300, 2000, 0); } |
|
|
int32_t IntelligentWindingRobotCtrl::m4_zreset() { m_dm->motor_move_to_zero_backward(4, 450, 300, 2000, 0); } |
|
|
int32_t IntelligentWindingRobotCtrl::m4_zmove_to(int32_t pos) { |
|
|
int32_t IntelligentWindingRobotCtrl::m4_zmove_to(int32_t pos) { |
|
|
ZLOGI(TAG, "zmove_to %d", pos); |
|
|
ZLOGI(TAG, "zmove_to %d", pos); |
|
@ -744,6 +744,7 @@ int32_t IntelligentWindingRobotCtrl::step_winding() { |
|
|
} |
|
|
} |
|
|
m_dm->module_stop(2); |
|
|
m_dm->module_stop(2); |
|
|
stop_probe_bullet_pos(); |
|
|
stop_probe_bullet_pos(); |
|
|
|
|
|
WAIT_MODULES_IDLE(16); |
|
|
ZLOGI(TAG, "step_winding end...."); |
|
|
ZLOGI(TAG, "step_winding end...."); |
|
|
return 0; |
|
|
return 0; |
|
|
} |
|
|
} |
|
@ -764,12 +765,18 @@ int32_t IntelligentWindingRobotCtrl::step_winding_lineend_prepare(int bulletinde |
|
|
m_dm->motor_move_to_acctime(2, cfg.m2_zerooff, 30, 100); |
|
|
m_dm->motor_move_to_acctime(2, cfg.m2_zerooff, 30, 100); |
|
|
wait_module_idle(2); |
|
|
wait_module_idle(2); |
|
|
WAIT_MODULES_IDLE(13); |
|
|
WAIT_MODULES_IDLE(13); |
|
|
|
|
|
m_dm->motor_move_to_torque(23, 1900, 40, 0); |
|
|
|
|
|
WAIT_MODULES_IDLE(23); |
|
|
|
|
|
|
|
|
|
|
|
m16_xianlajin_move_to_cook_lineend_ready_pos(); |
|
|
|
|
|
WAIT_MODULES_IDLE(16); |
|
|
|
|
|
|
|
|
xymove_to_bullet_pos(bulletindex); |
|
|
xymove_to_bullet_pos(bulletindex); |
|
|
substep_zaxis_do_bullet_action(kBulletBulletHolderPos, kTakeBulletCase, kReleaseLine); |
|
|
substep_zaxis_do_bullet_action(kBulletBulletHolderPos, kTakeBulletCase, kReleaseLine); |
|
|
xymove_to(cfg.xy_platform_cook_bullet_pos_x, cfg.xy_platform_cook_bullet_pos_y); |
|
|
xymove_to(cfg.xy_platform_cook_bullet_pos_x, cfg.xy_platform_cook_bullet_pos_y); |
|
|
m16_xianlajin_move_to_tight_line_pos(); |
|
|
|
|
|
|
|
|
WAIT_MODULES_IDLE(16); |
|
|
substep_zaxis_do_bullet_action(kCookPos, kTakeBackBullet, kReleaseLine); |
|
|
substep_zaxis_do_bullet_action(kCookPos, kTakeBackBullet, kReleaseLine); |
|
|
|
|
|
|
|
|
return 0; |
|
|
return 0; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -805,18 +812,19 @@ mini_servo_move_to 6 1550 600 500 |
|
|
eq20_move_to 1 1110 30 100 |
|
|
eq20_move_to 1 1110 30 100 |
|
|
mini_servo_move_to 6 1850 600 500 |
|
|
mini_servo_move_to 6 1850 600 500 |
|
|
#endif
|
|
|
#endif
|
|
|
m23_laxian_motor_move_to_tight_line_pos(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// m23_laxian_motor_move_to_tight_line_pos();
|
|
|
|
|
|
#if 0
|
|
|
int32_t velocity = 30; |
|
|
int32_t velocity = 30; |
|
|
int32_t acctime = 10; |
|
|
int32_t acctime = 10; |
|
|
|
|
|
|
|
|
m_dm->motor_move_to_acctime(2, cfg.m2_zerooff, velocity, acctime); |
|
|
m_dm->motor_move_to_acctime(2, cfg.m2_zerooff, velocity, acctime); |
|
|
WAIT_MODULES_IDLE(2); |
|
|
WAIT_MODULES_IDLE(2); |
|
|
|
|
|
|
|
|
m16_xianlajin_move_to_cook_lineend_low_pos(); //
|
|
|
|
|
|
WAIT_MODULES_IDLE(16); //
|
|
|
WAIT_MODULES_IDLE(16); //
|
|
|
m_dm->motor_move_to_acctime(2, cfg.m2_zerooff + 1000, velocity, acctime); // 沟位置
|
|
|
m_dm->motor_move_to_acctime(2, cfg.m2_zerooff + 1000, velocity, acctime); // 沟位置
|
|
|
WAIT_MODULES_IDLE(2); //
|
|
|
WAIT_MODULES_IDLE(2); //
|
|
|
|
|
|
m16_xianlajin_move_to_cook_lineend_low_pos(); //
|
|
|
|
|
|
WAIT_MODULES_IDLE(16); //
|
|
|
m_dm->motor_move_to_acctime(2, cfg.m2_zerooff - 1600, velocity, acctime); // 逆向上线位置
|
|
|
m_dm->motor_move_to_acctime(2, cfg.m2_zerooff - 1600, velocity, acctime); // 逆向上线位置
|
|
|
WAIT_MODULES_IDLE(2); //
|
|
|
WAIT_MODULES_IDLE(2); //
|
|
|
m16_xianlajin_move_to_cook_lineend_high_pos(); //
|
|
|
m16_xianlajin_move_to_cook_lineend_high_pos(); //
|
|
@ -832,19 +840,67 @@ mini_servo_move_to 6 1850 600 500 |
|
|
m_dm->motor_move_to_acctime(2, cfg.m2_zerooff, velocity, acctime); //
|
|
|
m_dm->motor_move_to_acctime(2, cfg.m2_zerooff, velocity, acctime); //
|
|
|
WAIT_MODULES_IDLE(2); //
|
|
|
WAIT_MODULES_IDLE(2); //
|
|
|
m16_xianlajin_move_to_cook_lineend_low_pos(); //
|
|
|
m16_xianlajin_move_to_cook_lineend_low_pos(); //
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#if 0
|
|
|
|
|
|
motor_move_to 16 1850 300 0 |
|
|
|
|
|
motor_move_to_acctime 2 1400 5 50 |
|
|
|
|
|
motor_move_to 16 1800 300 0 |
|
|
|
|
|
motor_move_to_acctime 2 2200 5 50 |
|
|
|
|
|
motor_move_to 16 1800 300 0 |
|
|
|
|
|
motor_move_to_acctime 2 -200 1 50 |
|
|
|
|
|
motor_move_to 16 1741 300 0 |
|
|
|
|
|
motor_move_to_acctime 2 1000 5 50 |
|
|
|
|
|
motor_move_to 16 1850 300 0 |
|
|
|
|
|
motor_move_to_acctime 2 -200 5 50 |
|
|
|
|
|
motor_move_to 16 1741 300 0 |
|
|
|
|
|
motor_move_to_acctime 2 1100 5 50 |
|
|
|
|
|
motor_move_to 16 1850 300 0 |
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
// m_dm->motor_move_to(16,1980,300,0);
|
|
|
|
|
|
m_dm->motor_move_to(16, 1850, 300, 0); |
|
|
|
|
|
wait_module_idle(16); |
|
|
|
|
|
m_dm->motor_move_to_acctime(2, 1400, 5, 50); |
|
|
|
|
|
wait_module_idle(2); |
|
|
|
|
|
m_dm->motor_move_to(16, 1850, 300, 0); |
|
|
|
|
|
wait_module_idle(16); |
|
|
|
|
|
m_dm->motor_move_to_acctime(2, 2200, 5, 50); |
|
|
|
|
|
wait_module_idle(2); |
|
|
|
|
|
m_dm->motor_move_to(16, 1800, 300, 0); |
|
|
|
|
|
wait_module_idle(16); |
|
|
|
|
|
m_dm->motor_move_to_acctime(2, -200, 3, 50); |
|
|
|
|
|
osDelay(4000); |
|
|
|
|
|
wait_module_idle(2); |
|
|
|
|
|
m_dm->motor_move_to(16, 1741, 300, 0); |
|
|
|
|
|
wait_module_idle(16); |
|
|
|
|
|
m_dm->motor_move_to_acctime(2, 1000, 5, 50); |
|
|
|
|
|
wait_module_idle(2); |
|
|
|
|
|
m_dm->motor_move_to(16, 1850, 300, 0); |
|
|
|
|
|
wait_module_idle(16); |
|
|
|
|
|
m_dm->motor_move_to_acctime(2, -200, 5, 50); |
|
|
|
|
|
wait_module_idle(2); |
|
|
|
|
|
m_dm->motor_move_to(16, 1741, 300, 0); |
|
|
|
|
|
wait_module_idle(16); |
|
|
|
|
|
m_dm->motor_move_to_acctime(2, 1100, 5, 50); |
|
|
|
|
|
wait_module_idle(2); |
|
|
|
|
|
m_dm->motor_move_to(16, 1850, 300, 0); |
|
|
|
|
|
wait_module_idle(16); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
int32_t IntelligentWindingRobotCtrl::step_winding_take_bullet_from_cooking_to_origin_pos(int bulletindex) { |
|
|
int32_t IntelligentWindingRobotCtrl::step_winding_take_bullet_from_cooking_to_origin_pos(int bulletindex) { |
|
|
|
|
|
m16_xianlajin_move_to_reset(); |
|
|
m4_zmove_to(0); |
|
|
m4_zmove_to(0); |
|
|
WAIT_MODULES_IDLE(4); |
|
|
WAIT_MODULES_IDLE(4); |
|
|
xymove_to(cfg.xy_platform_cook_bullet_pos_x, cfg.xy_platform_cook_bullet_pos_y); |
|
|
xymove_to(cfg.xy_platform_cook_bullet_pos_x, cfg.xy_platform_cook_bullet_pos_y); |
|
|
WAIT_MODULES_IDLE(3); |
|
|
WAIT_MODULES_IDLE(3); |
|
|
m12_jiaxian_move_to_clamp_pos(); |
|
|
m12_jiaxian_move_to_clamp_pos(); |
|
|
substep_zaxis_do_bullet_action(kCookPos, kTakeBullet, kTakeLine, [this]() { |
|
|
|
|
|
m22_scissors_cut(); |
|
|
|
|
|
WAIT_MODULES_IDLE(22); |
|
|
|
|
|
m22_scissors_move_reset_pos(); |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
WAIT_MODULES_IDLE(12); |
|
|
|
|
|
m22_scissors_cut(); |
|
|
|
|
|
WAIT_MODULES_IDLE(22); |
|
|
|
|
|
m22_scissors_move_reset_pos(); |
|
|
|
|
|
|
|
|
|
|
|
substep_zaxis_do_bullet_action(kCookPos, kTakeBullet, kReleaseLine, [this]() {}); |
|
|
WAIT_MODULES_IDLE(22); |
|
|
WAIT_MODULES_IDLE(22); |
|
|
|
|
|
|
|
|
xymove_to_bullet_pos(bulletindex); |
|
|
xymove_to_bullet_pos(bulletindex); |
|
|