|
|
@ -408,7 +408,13 @@ int32_t PipetteModule::pipette_pump_aspirate() { |
|
|
|
adjust_container_pos(&acfg->container_pos, m_common_cfg.platform_info_cpyid); |
|
|
|
|
|
|
|
if (acfg->lld_enable) { |
|
|
|
_do_lld(acfg->container_pos, platform_info, container_cfg, liquidinfo); // 液面探测
|
|
|
|
bool lld_enable_protect = false; |
|
|
|
if (acfg->lld_enable_protect < 0) { |
|
|
|
lld_enable_protect = acfg->lld_enable_protect; |
|
|
|
} else { |
|
|
|
lld_enable_protect = m_common_cfg.lld_enable_protect; // 使用全局配置
|
|
|
|
} |
|
|
|
_do_lld(acfg->container_pos, platform_info, container_cfg, liquidinfo, m_common_cfg.lld_enable_protect); // 液面探测
|
|
|
|
} else { |
|
|
|
m_state.water_level = acfg->container_pos + container_cfg->fix_water_level_depth; // 没有使用lld,使用固定深度
|
|
|
|
} |
|
|
@ -432,10 +438,19 @@ int32_t PipetteModule::pipette_pump_aspirate() { |
|
|
|
return 0; |
|
|
|
} |
|
|
|
|
|
|
|
void PipetteModule::_do_lld(int32_t container_pos, platinfo_t *platform_info, container_info_t *container_cfg, liquid_info_t *liquidinfo) { |
|
|
|
void PipetteModule::_do_lld(int32_t container_pos, platinfo_t *platform_info, container_info_t *container_cfg, liquid_info_t *liquidinfo, int32_t enable_lld_project) { |
|
|
|
int32_t ecode = 0; |
|
|
|
int32_t start_pressure = 0; |
|
|
|
|
|
|
|
int32_t lld_end_pos = container_pos + container_cfg->container_depth - container_cfg->lld_end_pos_margin; |
|
|
|
if (enable_lld_project) { |
|
|
|
int32_t lld_limit_end_pos = container_pos + platform_info->tip_length - container_cfg->immersion_depth; |
|
|
|
if (lld_end_pos > lld_limit_end_pos) { |
|
|
|
lld_end_pos = lld_limit_end_pos; // 限制lld_end_pos不能超过瓶口
|
|
|
|
ZLOGW(TAG, "lld_end_pos %d is larger than lld_limit_end_pos %d, set lld_end_pos to lld_limit_end_pos", lld_end_pos, lld_limit_end_pos); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 移动到转移位置
|
|
|
|
ZLOGI(TAG, "-->zm move to transform pos"); |
|
|
|
zm_move_to_block(get_zmotor_standby_pos(), kzm_v_default, 0); |
|
|
@ -445,11 +460,6 @@ void PipetteModule::_do_lld(int32_t container_pos, platinfo_t *platform_info, co |
|
|
|
pump_move_to_x100nl_block(300 /*30ul*/, kpm_v_max); // 为lld清空tip,提供一定空气柱
|
|
|
|
action_delay(); |
|
|
|
|
|
|
|
// 移动到瓶口
|
|
|
|
ZLOGI(TAG, "-->zm move to container neck pos"); |
|
|
|
zm_move_to_block(container_pos - 50 /*5mm*/, kzm_v_default, 0); |
|
|
|
action_delay(); |
|
|
|
|
|
|
|
// 启动lld
|
|
|
|
ZLOGI(TAG, "-->start lld, lld_pm_vindex %d plld_threshold %d", liquidinfo->plld_pm_vcpyid, liquidinfo->plld_threshold); |
|
|
|
DO_IN_THREAD(m_smtp2.pump_set_io1_mode(1)); // lld输入高
|
|
|
@ -459,13 +469,6 @@ void PipetteModule::_do_lld(int32_t container_pos, platinfo_t *platform_info, co |
|
|
|
m_smtp2.pump_get_pressure(&start_pressure); |
|
|
|
ZLOGI(TAG, "-->start lld , start_pressure is %d", start_pressure); |
|
|
|
|
|
|
|
if (m_common_cfg.pressure_record_enable) { |
|
|
|
int32_t nopos = zm_get_now_pos(); |
|
|
|
int32_t pressure = 0; |
|
|
|
m_smtp2.pump_get_pressure(&pressure); |
|
|
|
push_pressure_sample_data(nopos, pressure); |
|
|
|
} |
|
|
|
|
|
|
|
#if 1
|
|
|
|
pump_do_lld(liquidinfo->plld_threshold, 200, liquidinfo->plld_pm_vcpyid); // lld延时200ms,速度为plld_zm_vel
|
|
|
|
osDelay(110); // 等待lld启动
|
|
|
@ -473,12 +476,18 @@ void PipetteModule::_do_lld(int32_t container_pos, platinfo_t *platform_info, co |
|
|
|
pump_start_lld(2400, liquidinfo->plld_pm_vcpyid); |
|
|
|
#endif
|
|
|
|
|
|
|
|
if (m_common_cfg.pressure_record_enable) { |
|
|
|
int32_t nopos = zm_get_now_pos(); |
|
|
|
int32_t pressure = 0; |
|
|
|
m_smtp2.pump_get_pressure(&pressure); |
|
|
|
push_pressure_sample_data(nopos, pressure); |
|
|
|
} |
|
|
|
|
|
|
|
// 快速移动到瓶口
|
|
|
|
ZLOGI(TAG, "-->zm move quick to lld search start pos"); |
|
|
|
zm_move_to_lld_start_search_pos_block(container_pos, container_cfg, kzm_v_default, 0); |
|
|
|
// lld,zm移动到瓶底
|
|
|
|
ZLOGI(TAG, "-->zm move slow to container bottom pos"); |
|
|
|
int32_t lld_end_pos = container_pos + container_cfg->container_depth - container_cfg->lld_end_pos_margin; |
|
|
|
ZLOGI(TAG, "-->zm move slow to lld end pos"); |
|
|
|
zm_move_to(lld_end_pos, kzm_v_lld, liquidinfo->plld_zm_vel); |
|
|
|
|
|
|
|
/**
|
|
|
@ -498,7 +507,7 @@ void PipetteModule::_do_lld(int32_t container_pos, platinfo_t *platform_info, co |
|
|
|
water_level = zm_get_now_pos() - liquidinfo->plld_invasion_depth; |
|
|
|
detect_liquid = true; |
|
|
|
m_zm->stop(); |
|
|
|
ZLOGI(TAG, "-->detect liquid, water_level %d", water_level); |
|
|
|
ZLOGI(TAG, "-->detect liquid, plld_invasion_depth:%d water_level %d", liquidinfo->plld_invasion_depth, water_level); |
|
|
|
break; |
|
|
|
} |
|
|
|
if (!m_common_cfg.pressure_record_enable) { |
|
|
|