|
|
@ -127,7 +127,7 @@ int32_t PipetteModule::pipette_zmotor_enable(int32_t enable) { |
|
|
|
int32_t PipetteModule::pipette_zmotor_move_zero() { //
|
|
|
|
thread_start_work(__FUNCTION__, [this]() { |
|
|
|
do_zm_move_0p(); // 移动到零点
|
|
|
|
zm_set_now_pos(0 + zmbcfg.dzero - zmbcfg.io_trigger_append_distance); |
|
|
|
zm_set_now_pos(get_zmotor_standby_pos()); |
|
|
|
m_state.zm_has_move_zero = 1; |
|
|
|
}); |
|
|
|
return 0; |
|
|
@ -144,10 +144,10 @@ int32_t PipetteModule::pipette_zmotor_measure_distance() { |
|
|
|
do_zm_move_0p(); // 移动到零点
|
|
|
|
int32_t dpos = zm_get_now_pos() - startpos; |
|
|
|
|
|
|
|
zm_set_now_pos(0 + zmbcfg.dzero - zmbcfg.io_trigger_append_distance); |
|
|
|
zm_set_now_pos(get_zmotor_standby_pos()); |
|
|
|
m_state.zm_has_move_zero = 1; |
|
|
|
|
|
|
|
m_state.asynchronous_result0 = 0 + zmbcfg.dzero - zmbcfg.io_trigger_append_distance - dpos; |
|
|
|
m_state.asynchronous_result0 = get_zmotor_standby_pos() - dpos; |
|
|
|
}); |
|
|
|
return 0; |
|
|
|
} |
|
|
@ -438,7 +438,7 @@ void PipetteModule::_do_lld(int32_t container_pos, platinfo_t *platform_info, co |
|
|
|
|
|
|
|
// 移动到转移位置
|
|
|
|
ZLOGI(TAG, "-->zm move to transform pos"); |
|
|
|
zm_move_to_block(0, kzm_v_default, 0); |
|
|
|
zm_move_to_block(get_zmotor_standby_pos(), kzm_v_default, 0); |
|
|
|
// 清空tip
|
|
|
|
ZLOGI(TAG, "-->empty tip before lld"); |
|
|
|
pump_move_to_x100nl_block(0, liquidinfo->empty_tip_pm_vcpyid); |
|
|
@ -487,7 +487,6 @@ void PipetteModule::_do_lld(int32_t container_pos, platinfo_t *platform_info, co |
|
|
|
int32_t water_level = 0; |
|
|
|
bool detect_liquid = false; |
|
|
|
while (true) { |
|
|
|
#if 1
|
|
|
|
if (m_zm->isStoped()) { |
|
|
|
detect_liquid = false; |
|
|
|
ZLOGI(TAG, "-->zm is stoped"); |
|
|
@ -511,39 +510,7 @@ void PipetteModule::_do_lld(int32_t container_pos, platinfo_t *platform_info, co |
|
|
|
ZLOGI(TAG, "...wait for lld trigger, now zm pos %d, pressure %d dpressure %d", nopos, pressure, pressure - start_pressure); |
|
|
|
push_pressure_sample_data(nopos, pressure); |
|
|
|
} |
|
|
|
#else
|
|
|
|
if (m_zm->isStoped()) { |
|
|
|
detect_liquid = false; |
|
|
|
ZLOGI(TAG, "-->zm is stoped"); |
|
|
|
break; |
|
|
|
} |
|
|
|
|
|
|
|
int32_t pressure = 0; |
|
|
|
int32_t dpressure0, dpressure1 = 0; |
|
|
|
|
|
|
|
m_smtp2.pump_get_pressure(&pressure); |
|
|
|
dpressure0 = pressure - start_pressure; |
|
|
|
|
|
|
|
// lld触发
|
|
|
|
if (abs(dpressure0) > liquidinfo->plld_threshold) { |
|
|
|
water_level = zm_get_now_pos() - liquidinfo->plld_invasion_depth; |
|
|
|
detect_liquid = true; |
|
|
|
|
|
|
|
m_smtp2.pump_get_pressure(&pressure); |
|
|
|
dpressure1 = pressure - start_pressure; |
|
|
|
if (abs(dpressure1) < abs(dpressure0) + 5) { |
|
|
|
detect_liquid = false; |
|
|
|
ZLOGW(TAG, "!!!!!!!!!!!!!!!!!!!!!!!!!!!! %d", dpressure1); |
|
|
|
continue; |
|
|
|
} |
|
|
|
|
|
|
|
m_zm->stop(); |
|
|
|
ZLOGI(TAG, "-->detect liquid, water_level %d,dpressure0 %d,dpressure1 %d", water_level, dpressure0, dpressure1); |
|
|
|
break; |
|
|
|
} |
|
|
|
|
|
|
|
ZLOGI(TAG, "...wait for lld trigger, now zm pos %d, pressure %d dpressure %d", zm_get_now_pos(), pressure, dpressure0); |
|
|
|
#endif
|
|
|
|
thread_delay(1); |
|
|
|
} |
|
|
|
ecode = m_smtp2.pump_get_state(nullptr); // 获取泵状态,在此之前不能执行任何泵机指令,否则会丢失错误状态
|
|
|
@ -557,10 +524,10 @@ void PipetteModule::_do_lld(int32_t container_pos, platinfo_t *platform_info, co |
|
|
|
// LLD错误。在cLLD、pLLD、hLLD模式下均未检测到液体。在超过指定的压力阈值之前,泵已达到行程终点。
|
|
|
|
m_state.pump_lld_reach_limit = 1; |
|
|
|
m_state.aspiration_ok = 0; |
|
|
|
zm_move_to_block(0, kzm_v_default, 0); |
|
|
|
zm_move_to_block(get_zmotor_standby_pos(), kzm_v_default, 0); |
|
|
|
throw zapp_exception(err::kpipette_lld_error_no_liquid_detected); |
|
|
|
} else { |
|
|
|
zm_move_to_block(0, kzm_v_default, 0); |
|
|
|
zm_move_to_block(get_zmotor_standby_pos(), kzm_v_default, 0); |
|
|
|
throw zapp_exception(ecode); |
|
|
|
} |
|
|
|
} |
|
|
@ -572,7 +539,7 @@ void PipetteModule::_do_lld(int32_t container_pos, platinfo_t *platform_info, co |
|
|
|
|
|
|
|
if (!detect_liquid) { |
|
|
|
ZLOGE(TAG, "detect liquid fail"); |
|
|
|
zm_move_to_block(0, kzm_v_default, 0); |
|
|
|
zm_move_to_block(get_zmotor_standby_pos(), kzm_v_default, 0); |
|
|
|
throw zapp_exception(err::kpipette_lld_error_no_liquid_detected); |
|
|
|
} |
|
|
|
m_state.detected_liquid = 1; |
|
|
|