|
|
@ -65,6 +65,7 @@ int32_t XYRobotCtrlModule::module_active_cfg() { |
|
|
|
m_stepM2->enable(false); |
|
|
|
|
|
|
|
m_stepM1->setIHOLD_IRUN(m_cfg.ihold, m_cfg.irun, m_cfg.iholddelay); |
|
|
|
m_stepM1->setGlobalScale(m_cfg.iglobalscaler); |
|
|
|
m_stepM1->setScale(m_cfg.one_circle_pulse / 2); |
|
|
|
m_stepM1->setScaleDenominator(m_cfg.one_circle_pulse_denominator); |
|
|
|
m_stepM1->set_vstart(m_cfg.vstart); |
|
|
@ -78,6 +79,7 @@ int32_t XYRobotCtrlModule::module_active_cfg() { |
|
|
|
m_stepM1->set_enc_resolution(m_cfg.enc_resolution); |
|
|
|
|
|
|
|
m_stepM2->setIHOLD_IRUN(m_cfg.ihold, m_cfg.irun, m_cfg.iholddelay); |
|
|
|
m_stepM2->setGlobalScale(m_cfg.iglobalscaler); |
|
|
|
m_stepM2->setScale(m_cfg.one_circle_pulse / 2); |
|
|
|
m_stepM2->setScaleDenominator(m_cfg.one_circle_pulse_denominator); |
|
|
|
m_stepM2->set_vstart(m_cfg.vstart); |
|
|
@ -149,8 +151,18 @@ int32_t XYRobotCtrlModule::xymotor_read_pos(int32_t* x, int32_t* y) { |
|
|
|
} |
|
|
|
|
|
|
|
#define UPDATE_CFG(key) PROCESS_REG(kreg_xyrobot_##key, REG_GET(m_cfg.key), REG_SET(m_cfg.key))
|
|
|
|
|
|
|
|
int32_t XYRobotCtrlModule::module_xxx_reg(int32_t param_id, bool read, int32_t& val) { |
|
|
|
int32_t ret = __module_xxx_reg(param_id, read, val); |
|
|
|
if (ret != 0) { |
|
|
|
return ret; |
|
|
|
} |
|
|
|
|
|
|
|
if (!read) { |
|
|
|
module_active_cfg(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
int32_t XYRobotCtrlModule::__module_xxx_reg(int32_t param_id, bool read, int32_t& val) { |
|
|
|
switch (param_id) { |
|
|
|
UPDATE_CFG(robot_type); |
|
|
|
UPDATE_CFG(one_circle_pulse); |
|
|
@ -185,6 +197,7 @@ int32_t XYRobotCtrlModule::module_xxx_reg(int32_t param_id, bool read, int32_t& |
|
|
|
return err::kmodule_not_find_reg; |
|
|
|
break; |
|
|
|
} |
|
|
|
|
|
|
|
return 0; |
|
|
|
} |
|
|
|
|
|
|
@ -423,7 +436,7 @@ void XYRobotCtrlModule::befor_motor_move() { |
|
|
|
creg.module_status = 1; |
|
|
|
creg.module_errorcode = 0; |
|
|
|
|
|
|
|
module_active_cfg(); |
|
|
|
// module_active_cfg();
|
|
|
|
xymotor_enable(1); |
|
|
|
} |
|
|
|
void XYRobotCtrlModule::after_motor_move() { |
|
|
|