|
@ -69,7 +69,7 @@ void PipetteModuleV2::initialize(int32_t id, config_t *config, hardward_config_t |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void PipetteModuleV2::create_default_cfg(config_t *defaultcfg) { |
|
|
void PipetteModuleV2::create_default_cfg(config_t *defaultcfg) { |
|
|
defaultcfg->limit_ul = 250; |
|
|
|
|
|
|
|
|
// defaultcfg->limit_ul = 250;
|
|
|
defaultcfg->pump_acc = 18; |
|
|
defaultcfg->pump_acc = 18; |
|
|
defaultcfg->pump_dec = 18; |
|
|
defaultcfg->pump_dec = 18; |
|
|
defaultcfg->pump_vstart = 200; |
|
|
defaultcfg->pump_vstart = 200; |
|
@ -155,7 +155,7 @@ int32_t PipetteModuleV2::module_xxx_reg_impl(int32_t param_id, bool read, int32_ |
|
|
/***********************************************************************************************************************
|
|
|
/***********************************************************************************************************************
|
|
|
* CFG * |
|
|
* CFG * |
|
|
***********************************************************************************************************************/ |
|
|
***********************************************************************************************************************/ |
|
|
XXX_CFG_REG(limit_ul); |
|
|
|
|
|
|
|
|
// XXX_CFG_REG(limit_ul);
|
|
|
XXX_CFG_REG(pump_acc); |
|
|
XXX_CFG_REG(pump_acc); |
|
|
XXX_CFG_REG(pump_dec); |
|
|
XXX_CFG_REG(pump_dec); |
|
|
XXX_CFG_REG(pump_vstart); |
|
|
XXX_CFG_REG(pump_vstart); |
|
@ -677,7 +677,7 @@ int32_t PipetteModuleV2::pipette_get_aspirate_infer_eigen_time_result(int32_t *r |
|
|
|
|
|
|
|
|
int32_t PipetteModuleV2::pipette_pump_move_to(int32_t pumpv, int32_t ul) { |
|
|
int32_t PipetteModuleV2::pipette_pump_move_to(int32_t pumpv, int32_t ul) { |
|
|
THREAD_START_WORK([this, pumpv, ul]() { |
|
|
THREAD_START_WORK([this, pumpv, ul]() { |
|
|
DO_IN_THREAD(m_smtp2.pump_aspirate(pumpv, ul)); |
|
|
|
|
|
|
|
|
DO_IN_THREAD(m_smtp2.pump_move_to_ul(pumpv, ul)); |
|
|
pump_waitfor_stop(); |
|
|
pump_waitfor_stop(); |
|
|
m_smtp2.pump_stop(); |
|
|
m_smtp2.pump_stop(); |
|
|
}); |
|
|
}); |
|
@ -708,18 +708,13 @@ int32_t PipetteModuleV2::pipette_lld(int32_t lldtype, int32_t maxzpos, int32_t c |
|
|
|
|
|
|
|
|
// 1. 泵机移动到0位
|
|
|
// 1. 泵机移动到0位
|
|
|
DO_IN_THREAD(m_smtp2.pump_distribut_all(m_cfg.pump_vmax)); |
|
|
DO_IN_THREAD(m_smtp2.pump_distribut_all(m_cfg.pump_vmax)); |
|
|
|
|
|
pump_waitfor_stop(); |
|
|
|
|
|
|
|
|
// 2. 读取初值
|
|
|
// 2. 读取初值
|
|
|
DO_IN_THREAD(m_smtp2.pump_get_capacitance(&start_capacitance)); |
|
|
DO_IN_THREAD(m_smtp2.pump_get_capacitance(&start_capacitance)); |
|
|
DO_IN_THREAD(m_smtp2.pump_get_pressure(&start_pressure)); |
|
|
DO_IN_THREAD(m_smtp2.pump_get_pressure(&start_pressure)); |
|
|
start_motor_pos = m_zm->getXACTUAL(); |
|
|
start_motor_pos = m_zm->getXACTUAL(); |
|
|
|
|
|
|
|
|
// 先分配一点体积,消除一些误差。
|
|
|
|
|
|
// ZLOGI(TAG, "start lld before distribut %d ul", m_cfg.lld_prepare_pre_distribut_ul);
|
|
|
|
|
|
// DO_IN_THREAD(m_smtp2.pump_aspirate(m_cfg.pump_vmax, -m_cfg.lld_prepare_pre_distribut_ul));
|
|
|
|
|
|
// pump_waitfor_stop();
|
|
|
|
|
|
// ZLOGI(TAG, "lld before distribut ok");
|
|
|
|
|
|
|
|
|
|
|
|
ZLOGI(TAG, "start lld"); |
|
|
ZLOGI(TAG, "start lld"); |
|
|
if (lldtype == kclld) { |
|
|
if (lldtype == kclld) { |
|
|
DO_IN_THREAD(m_smtp2.pump_clld(c_threshold)); |
|
|
DO_IN_THREAD(m_smtp2.pump_clld(c_threshold)); |
|
@ -777,6 +772,11 @@ int32_t PipetteModuleV2::pipette_lld(int32_t lldtype, int32_t maxzpos, int32_t c |
|
|
return 0; |
|
|
return 0; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
int32_t PipetteModuleV2::pipette_lld_is_detect_liquid(int32_t *detect) { |
|
|
|
|
|
*detect = m_state.detected_liquid; |
|
|
|
|
|
return 0; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
int32_t PipetteModuleV2::pipette_aspirate(int32_t llfrpm, int32_t llftpos, int32_t pumpv, int32_t ul) { |
|
|
int32_t PipetteModuleV2::pipette_aspirate(int32_t llfrpm, int32_t llftpos, int32_t pumpv, int32_t ul) { |
|
|
// pipette_aspirate
|
|
|
// pipette_aspirate
|
|
|
if (ul < 0) { |
|
|
if (ul < 0) { |
|
@ -784,11 +784,6 @@ int32_t PipetteModuleV2::pipette_aspirate(int32_t llfrpm, int32_t llftpos, int32 |
|
|
return err::kparam_out_of_range; |
|
|
return err::kparam_out_of_range; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (ul > m_cfg.limit_ul) { |
|
|
|
|
|
ZLOGE(TAG, "pipette_aspirate %d fail , final ul (%d)> limit ul %d", ul, ul, m_cfg.limit_ul); |
|
|
|
|
|
return err::kparam_out_of_range; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
THREAD_START_WORK([this, llfrpm, llftpos, pumpv, ul]() { |
|
|
THREAD_START_WORK([this, llfrpm, llftpos, pumpv, ul]() { |
|
|
DO_IN_THREAD(m_smtp2.pump_aspirate(pumpv, ul)); |
|
|
DO_IN_THREAD(m_smtp2.pump_aspirate(pumpv, ul)); |
|
|
|
|
|
|
|
@ -869,6 +864,23 @@ int32_t PipetteModuleV2::pipette_shake_up(int32_t llfrpm, int32_t maxzpos, int32 |
|
|
return 0; |
|
|
return 0; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
int32_t PipetteModuleV2::pipette_clear_hanging_liquid(int32_t repeat_times) { |
|
|
|
|
|
// llf_startz
|
|
|
|
|
|
// llf_endz
|
|
|
|
|
|
THREAD_START_WORK([this, repeat_times]() { |
|
|
|
|
|
for (int i = 0; i < repeat_times; i++) { |
|
|
|
|
|
m_smtp2.pump_move_to_ul(m_cfg.pump_vmax, 0); |
|
|
|
|
|
pump_waitfor_stop(); |
|
|
|
|
|
|
|
|
|
|
|
m_smtp2.pump_move_to_ul(m_cfg.pump_vmax, 50); |
|
|
|
|
|
pump_waitfor_stop(); |
|
|
|
|
|
} |
|
|
|
|
|
m_smtp2.pump_move_to_ul(m_cfg.pump_vmax, 0); |
|
|
|
|
|
pump_waitfor_stop(); |
|
|
|
|
|
}); |
|
|
|
|
|
return 0; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/***********************************************************************************************************************
|
|
|
/***********************************************************************************************************************
|
|
|
* EXT_API_UTILS * |
|
|
* EXT_API_UTILS * |
|
|
***********************************************************************************************************************/ |
|
|
***********************************************************************************************************************/ |
|
@ -1203,8 +1215,6 @@ int32_t PipetteModuleV2::bfcall(int32_t cmdid, uint8_t *param, int32_t len) { |
|
|
if (cmdid == kpipette_zmotor_measure_distance) goto check_motor_is_enable; |
|
|
if (cmdid == kpipette_zmotor_measure_distance) goto check_motor_is_enable; |
|
|
if (cmdid == kpipette_zmotor_move_to) goto check_motor_has_moveto_zero; |
|
|
if (cmdid == kpipette_zmotor_move_to) goto check_motor_has_moveto_zero; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (cmdid == kpipette_init_device) goto suc; |
|
|
if (cmdid == kpipette_init_device) goto suc; |
|
|
if (cmdid == kpipette_put_tip) goto suc; |
|
|
if (cmdid == kpipette_put_tip) goto suc; |
|
|
if (cmdid == kpipette_pump_move_to) goto suc; |
|
|
if (cmdid == kpipette_pump_move_to) goto suc; |
|
|