|
|
@ -76,8 +76,7 @@ void PipetteModuleV2::create_default_cfg(config_t *defaultcfg) { |
|
|
|
defaultcfg->pump_vstop = 900; |
|
|
|
defaultcfg->aspirate_pump_vel = 500; //
|
|
|
|
defaultcfg->pump_vmax = 1000; |
|
|
|
defaultcfg->aspirate_zmotor_max_move_by = 400; // 50mm,tip头的长度
|
|
|
|
defaultcfg->lld_pump_vel = 80; // lld推荐使用速度为50->200,这里
|
|
|
|
defaultcfg->lld_pump_vel = 80; // lld推荐使用速度为50->200,这里
|
|
|
|
defaultcfg->lld_motor_vel_rpm = 80; |
|
|
|
defaultcfg->lld_detect_period_ms = 1; // 100ms
|
|
|
|
defaultcfg->lld_prepare_pos = PIPETTE_PREPARE_POS; |
|
|
@ -349,11 +348,11 @@ int32_t PipetteModuleV2::pipette_lld_prepare() { |
|
|
|
} |
|
|
|
|
|
|
|
int32_t PipetteModuleV2::pipette_lld_test() { //
|
|
|
|
return do_pipette_lld(true, kplld, m_state.pipette_startz, m_state.pipette_endz, 100, 1000); |
|
|
|
return do_pipette_lld(true, kplld, m_state.lld_startz, m_state.lld_endz - m_state.lld_startz, 100, 1000); |
|
|
|
} |
|
|
|
|
|
|
|
int32_t PipetteModuleV2::pipette_lld() { //
|
|
|
|
return do_pipette_lld(false, m_state.lld_type, m_state.pipette_startz, m_state.pipette_endz - m_state.pipette_startz, m_state.lld_c_threshold, m_state.lld_p_threshold); |
|
|
|
return do_pipette_lld(false, m_state.lld_type, m_state.lld_startz, m_state.lld_endz - m_state.lld_startz, m_state.lld_c_threshold, m_state.lld_p_threshold); |
|
|
|
} |
|
|
|
|
|
|
|
int32_t PipetteModuleV2::pipette_lld_is_detect_liquid(int32_t *detect) { |
|
|
@ -385,14 +384,14 @@ int32_t PipetteModuleV2::pipette_aspirate_prepare() { |
|
|
|
return 0; |
|
|
|
} |
|
|
|
|
|
|
|
int32_t PipetteModuleV2::pipette_set_startz(int32_t startz) { |
|
|
|
ZLOGI(TAG, "pipette_set_startz %d", startz); |
|
|
|
m_state.pipette_startz = startz; |
|
|
|
int32_t PipetteModuleV2::pipette_set_lld_startz(int32_t startz) { |
|
|
|
ZLOGI(TAG, "pipette_set_lld_startz %d", startz); |
|
|
|
m_state.lld_startz = startz; |
|
|
|
return 0; |
|
|
|
} |
|
|
|
int32_t PipetteModuleV2::pipette_set_endz(int32_t endz) { |
|
|
|
ZLOGI(TAG, "pipette_set_endz %d", endz); |
|
|
|
m_state.pipette_endz = endz; |
|
|
|
int32_t PipetteModuleV2::pipette_set_lld_endz(int32_t endz) { |
|
|
|
ZLOGI(TAG, "pipette_set_lld_endz %d", endz); |
|
|
|
m_state.lld_endz = endz; |
|
|
|
return 0; |
|
|
|
} |
|
|
|
|
|
|
@ -417,6 +416,17 @@ int32_t PipetteModuleV2::pipette_set_llf_velocity(int32_t llf_zm_rpm) { |
|
|
|
ZLOGI(TAG, "pipette_set_llf_velocity %d", llf_zm_rpm); |
|
|
|
return 0; |
|
|
|
} |
|
|
|
|
|
|
|
int32_t PipetteModuleV2::pipette_set_llf_startz(int32_t startz) { |
|
|
|
m_state.llf_startz = startz; |
|
|
|
ZLOGI(TAG, "pipette_set_llf_startz %d", startz); |
|
|
|
return 0; |
|
|
|
} |
|
|
|
int32_t PipetteModuleV2::pipette_set_llf_endz(int32_t endz) { |
|
|
|
m_state.llf_endz = endz; |
|
|
|
ZLOGI(TAG, "pipette_set_llf_end %d", endz); |
|
|
|
return 0; |
|
|
|
} |
|
|
|
int32_t PipetteModuleV2::pipette_set_aspirate_operation_verifi_p_thre(int32_t p_thre) { |
|
|
|
m_state.aspirate_cfg_p_thre = p_thre; |
|
|
|
ZLOGI(TAG, "pipette_set_aspirate_operation_verifi_p_thre %d", p_thre); |
|
|
@ -441,14 +451,24 @@ int32_t PipetteModuleV2::pipette_aspirate(int32_t ul) { |
|
|
|
return err::kparam_out_of_range; |
|
|
|
} |
|
|
|
|
|
|
|
// llf_startz
|
|
|
|
// llf_endz
|
|
|
|
|
|
|
|
THREAD_START_WORK([this, ul]() { |
|
|
|
m_state.lld_prepared = 0; |
|
|
|
|
|
|
|
int dul = m_state.load_val_ul + ul <= 0 ? -m_state.load_val_ul : ul; |
|
|
|
DO_IN_THREAD(m_smtp2.pump_aspirate(m_cfg.aspirate_pump_vel, dul)); |
|
|
|
|
|
|
|
int32_t dpos = ul > 0 ? m_cfg.aspirate_zmotor_max_move_by : -m_cfg.aspirate_zmotor_max_move_by; |
|
|
|
if (m_state.aspirate_cfg_llf_zm_rpm != 0) zm_move_by(dpos, m_state.aspirate_cfg_llf_zm_rpm); |
|
|
|
// int32_t dpos = ul > 0 ? m_cfg.aspirate_zmotor_max_move_by : -m_cfg.aspirate_zmotor_max_move_by;
|
|
|
|
|
|
|
|
if (m_state.aspirate_cfg_llf_zm_rpm != 0) { |
|
|
|
if (ul >= 0) { |
|
|
|
zm_move_to(m_state.llf_startz, m_state.aspirate_cfg_llf_zm_rpm); |
|
|
|
} else { |
|
|
|
zm_move_to(m_state.llf_endz, m_state.aspirate_cfg_llf_zm_rpm); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
pump_waitfor_stop(); |
|
|
|
|
|
|
@ -486,8 +506,16 @@ int32_t PipetteModuleV2::pipette_aspirate_and_verify(int32_t ul) { |
|
|
|
m_state.aspirate_cfg_eigen_time, //
|
|
|
|
m_state.aspirate_cfg_tolerance)); |
|
|
|
|
|
|
|
int32_t dpos = ul > 0 ? m_cfg.aspirate_zmotor_max_move_by : -m_cfg.aspirate_zmotor_max_move_by; |
|
|
|
if (m_state.aspirate_cfg_llf_zm_rpm != 0) zm_move_by(dpos, m_state.aspirate_cfg_llf_zm_rpm); |
|
|
|
// int32_t dpos = ul > 0 ? m_cfg.aspirate_zmotor_max_move_by : -m_cfg.aspirate_zmotor_max_move_by;
|
|
|
|
// if (m_state.aspirate_cfg_llf_zm_rpm != 0) zm_move_by(dpos, m_state.aspirate_cfg_llf_zm_rpm);
|
|
|
|
if (m_state.aspirate_cfg_llf_zm_rpm != 0) { |
|
|
|
if (ul >= 0) { |
|
|
|
zm_move_to(m_state.llf_startz, m_state.aspirate_cfg_llf_zm_rpm); |
|
|
|
} else { |
|
|
|
zm_move_to(m_state.llf_endz, m_state.aspirate_cfg_llf_zm_rpm); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// wait...
|
|
|
|
pump_waitfor_stop(); |
|
|
|
// stop
|
|
|
|