|
|
@ -26,6 +26,9 @@ void PipetteModule::initialize(int32_t id, hardward_config_t *hardwaredcfg) { / |
|
|
|
m_piette_gun_io1.initAsInput(hardwaredcfg->IO1, ZGPIO::kMode_pullup, ZGPIO::kIRQ_noIrq, hardwaredcfg->IO1Mirror); |
|
|
|
|
|
|
|
// 设置泵机压力数据流走232
|
|
|
|
// m_smtp2.pump_reset();
|
|
|
|
osDelay(1000); |
|
|
|
// m_smtp2.sendcmd_direct("/1f0R\r");
|
|
|
|
m_smtp2.pump_set_pressure_data_stream_port(1); |
|
|
|
// 测试泵机连接性
|
|
|
|
test_connectivity(); |
|
|
@ -38,18 +41,12 @@ void PipetteModule::initialize(int32_t id, hardward_config_t *hardwaredcfg) { / |
|
|
|
ZLOGI(TAG, "pipette gun version:%s", m_smtp2.pump_read_version()); |
|
|
|
|
|
|
|
// 上报压力流 ! 不能一直打开压力流,一直打开压力流,会导致SMTP2无法响应其他命令
|
|
|
|
// m_smtp2.pump_init();
|
|
|
|
// while (true) {
|
|
|
|
// int32_t isbusy = 1;
|
|
|
|
// m_smtp2.pump_get_state(&isbusy);
|
|
|
|
// if (isbusy == 0) break;
|
|
|
|
// osDelay(10);
|
|
|
|
// }
|
|
|
|
// m_smtp2.sendcmd_direct("/1f1+300A1250R\r");
|
|
|
|
|
|
|
|
// m_smtp2.sendcmd_direct("/1f1f0R\r");
|
|
|
|
ZASSERT(hardwaredcfg->uart232); |
|
|
|
EXHAL_UART_BindUart("pipette-uart232", hardwaredcfg->uart232); |
|
|
|
EXHAL_UART_RegListener(hardwaredcfg->uart232, [this](UART_HandleTypeDef *huart, uint8_t *data, size_t len) { smtpPressureStreamProcesser.process_rx(data[0]); }); |
|
|
|
EXHAL_UART_RegListener(hardwaredcfg->uart232, [this](UART_HandleTypeDef *huart, uint8_t *data, size_t len) { //
|
|
|
|
smtpPressureStreamProcesser.process_rx(data[0]); |
|
|
|
}); |
|
|
|
EXHAL_UART_ITStartAutoReadOneByte(hardwaredcfg->uart232); |
|
|
|
} |
|
|
|
|
|
|
@ -415,7 +412,7 @@ int32_t PipetteModule::pipette_pump_aspirate() { |
|
|
|
} else { |
|
|
|
m_state.water_level = acfg->container_pos + container_cfg->fix_water_level_depth; // 没有使用lld,使用固定深度
|
|
|
|
} |
|
|
|
|
|
|
|
action_delay(); |
|
|
|
if (acfg->volumeX100nl != 0) { |
|
|
|
//! WARNING: 这里强制设置tip类型为200ul
|
|
|
|
DO_IN_THREAD(m_smtp2.pump_set_tip_type(smtp2::TS200UL)); |
|
|
@ -446,10 +443,12 @@ void PipetteModule::_do_lld(int32_t container_pos, platinfo_t *platform_info, co |
|
|
|
ZLOGI(TAG, "-->empty tip before lld"); |
|
|
|
pump_move_to_x100nl_block(0, liquidinfo->empty_tip_pm_vcpyid); |
|
|
|
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); |
|
|
@ -595,6 +594,7 @@ void PipetteModule::_do_sapirate(platinfo_t *platform_info, container_info_t *co |
|
|
|
// 清空tip
|
|
|
|
ZLOGI(TAG, "clean tip."); |
|
|
|
pump_move_to_x100nl_block(0, liquidinfo->empty_tip_pm_vcpyid); |
|
|
|
action_delay(); |
|
|
|
|
|
|
|
// 吸入过量的空气
|
|
|
|
if (liquidinfo->blowout_air_volume > 0) { |
|
|
@ -610,6 +610,7 @@ void PipetteModule::_do_sapirate(platinfo_t *platform_info, container_info_t *co |
|
|
|
|
|
|
|
ZLOGI(TAG, "--> aspirate blowout_air_volume volume=%d, pm_vcpyid=%d", blowout_air_volume); |
|
|
|
pump_move_to_x100nl_block(blowout_air_volume, liquidinfo->blowout_air_pm_vcpyid); |
|
|
|
action_delay(); |
|
|
|
} else { |
|
|
|
ZLOGI(TAG, "--> aspirate blowout_air_volume volume=0,skip"); |
|
|
|
} |
|
|
@ -622,7 +623,9 @@ void PipetteModule::_do_sapirate(platinfo_t *platform_info, container_info_t *co |
|
|
|
if (liquidinfo->over_aspirated_volume > 0) { |
|
|
|
ZLOGI(TAG, "--> aspirate over_aspirated_volume volume=%d, pm_vcpyid=%d", liquidinfo->over_aspirated_volume, liquidinfo->over_aspirated_pm_vcpyid); |
|
|
|
pump_move_by_x100nl_block(liquidinfo->over_aspirated_volume, liquidinfo->over_aspirated_pm_vcpyid); |
|
|
|
action_delay(); |
|
|
|
pump_move_by_x100nl_block(-liquidinfo->over_aspirated_volume, liquidinfo->over_aspirated_pm_vcpyid); |
|
|
|
action_delay(); |
|
|
|
} |
|
|
|
|
|
|
|
// 吸入前混匀
|
|
|
@ -644,6 +647,7 @@ void PipetteModule::_do_sapirate(platinfo_t *platform_info, container_info_t *co |
|
|
|
pump_move_by_x100nl_block(-acfg->mix_volume, liquidinfo->mix_pm_vcpyid); |
|
|
|
if (acfg->mix_llf_enable > 0) zm_stop(); |
|
|
|
} |
|
|
|
action_delay(); |
|
|
|
} else { |
|
|
|
ZLOGI(TAG, "--> aspirate mix_volume volume=0,skip"); |
|
|
|
} |
|
|
@ -672,12 +676,14 @@ void PipetteModule::_do_sapirate(platinfo_t *platform_info, container_info_t *co |
|
|
|
// 离开液面
|
|
|
|
ZLOGI(TAG, "--> leave liquid surface"); |
|
|
|
zm_move_to_leaving_height_pos_block(-1, m_state.water_level, container_cfg, kzm_v_swap_out, 0); // 移动到液面之上
|
|
|
|
action_delay(); |
|
|
|
|
|
|
|
// 吸入过量的空气
|
|
|
|
if (liquidinfo->transport_volume > 0) { |
|
|
|
ZLOGI(TAG, "--> aspirate transport_volume volume=%d, pm_vcpyid=%d", liquidinfo->transport_volume, liquidinfo->transport_volume_pm_vcpyid); |
|
|
|
pump_move_by_x100nl_block(liquidinfo->transport_volume, liquidinfo->transport_volume_pm_vcpyid); |
|
|
|
} |
|
|
|
action_delay(); |
|
|
|
} |
|
|
|
int32_t PipetteModule::pipette_pump_distribu_all_set_param(distribu_all_paramid_t param, int32_t val) { |
|
|
|
if (param < 0 || param >= kdistribu_all_paramid_max) { |
|
|
@ -770,21 +776,25 @@ int32_t PipetteModule::pipette_pump_distribu_all() { |
|
|
|
} else { |
|
|
|
ZLOGI(TAG, "-->clean transport volume,skip"); |
|
|
|
} |
|
|
|
action_delay(); |
|
|
|
|
|
|
|
// 缓慢移动到液面之下
|
|
|
|
ZLOGI(TAG, "-->move to below the liquid surface"); |
|
|
|
zm_move_to_immersion_pos_block(container_pos, -1, container_cfg, kzm_v_swap_in, 0); // 缓慢移动到液面之下
|
|
|
|
action_delay(); |
|
|
|
|
|
|
|
// 分液
|
|
|
|
ZLOGI(TAG, "-->distribu liquid"); |
|
|
|
int32_t distribu_volume = calibrate_liquid_volume(liquidInGuninfo, m_pump_gun_state.liquid_volume); |
|
|
|
pump_move_by_x100nl_block(-distribu_volume, liquidInGuninfo->distribu_pm_vpyid); // 分液
|
|
|
|
action_delay(); |
|
|
|
|
|
|
|
// 移动到swap位置,快速清空tip,使用(emptyTip速度)
|
|
|
|
ZLOGI(TAG, "-->move to swap position and clean tip"); |
|
|
|
zm_move_to_leaving_height_pos_block(container_pos, -1, container_cfg, kzm_v_swap_out, 0); // 移动到swap位置
|
|
|
|
|
|
|
|
pump_move_to_x100nl_block(0, liquidInGuninfo->empty_tip_pm_vcpyid); // 快速清空tip,使用(emptyTip速度)
|
|
|
|
action_delay(); |
|
|
|
} |
|
|
|
|
|
|
|
//
|
|
|
@ -801,12 +811,14 @@ int32_t PipetteModule::pipette_pump_distribu_all() { |
|
|
|
} |
|
|
|
|
|
|
|
zm_move_to_leaving_height_pos_block(container_pos, -1, container_cfg, kzm_v_swap_out, 0); // 离开液面
|
|
|
|
action_delay(); |
|
|
|
} else { |
|
|
|
ZLOGI(TAG, "-->skip mixing"); |
|
|
|
} |
|
|
|
|
|
|
|
// 吸入10ul过量的空气,防挂液
|
|
|
|
pump_move_by_x100nl_block(100, liquidInGuninfo->transport_volume_pm_vcpyid); |
|
|
|
action_delay(); |
|
|
|
//
|
|
|
|
// 如果需要归零,则移动到transform_pos
|
|
|
|
//
|
|
|
|