|
|
@ -323,7 +323,10 @@ int32_t PipetteModuleV2::pipette_init_device() { |
|
|
|
} |
|
|
|
|
|
|
|
int32_t PipetteModuleV2::pipette_put_tip() { |
|
|
|
THREAD_START_WORK([this]() { DO_IN_THREAD(m_smtp2.pump_put_tip()); }); |
|
|
|
THREAD_START_WORK([this]() { |
|
|
|
DO_IN_THREAD(m_smtp2.pump_put_tip()); |
|
|
|
pump_waitfor_stop(); |
|
|
|
}); |
|
|
|
return 0; |
|
|
|
} |
|
|
|
|
|
|
@ -345,12 +348,12 @@ int32_t PipetteModuleV2::pipette_lld_prepare() { |
|
|
|
return 0; |
|
|
|
} |
|
|
|
|
|
|
|
int32_t PipetteModuleV2::pipette_lld_test(int32_t startpos, int32_t zdpos) { //
|
|
|
|
return do_pipette_lld(true, kplld, startpos, zdpos, 100, 1000); |
|
|
|
int32_t PipetteModuleV2::pipette_lld_test() { //
|
|
|
|
return do_pipette_lld(true, kplld, m_state.pipette_startz, m_state.pipette_endz, 100, 1000); |
|
|
|
} |
|
|
|
|
|
|
|
int32_t PipetteModuleV2::pipette_lld(int32_t lldtype, int32_t startpos, int32_t zdpos, int32_t c_threshold, int32_t p_threshold) { //
|
|
|
|
return do_pipette_lld(false, lldtype, startpos, zdpos, c_threshold, p_threshold); |
|
|
|
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); |
|
|
|
} |
|
|
|
|
|
|
|
int32_t PipetteModuleV2::pipette_lld_is_detect_liquid(int32_t *detect) { |
|
|
@ -361,9 +364,6 @@ int32_t PipetteModuleV2::pipette_lld_is_detect_liquid(int32_t *detect) { |
|
|
|
int32_t PipetteModuleV2::pipette_aspirate_prepare() { |
|
|
|
THREAD_START_WORK([this]() { //
|
|
|
|
ZLOGI(TAG, "pipette_aspirate_prepare"); |
|
|
|
m_state.aspirate_cfg_eigen_time = 0; |
|
|
|
m_state.aspirate_cfg_p_thre = 0; |
|
|
|
m_state.aspirate_cfg_llf_zm_rpm = 0; |
|
|
|
m_state.load_val_ul = 0; |
|
|
|
int32_t nowpos = zm_get_now_pos(); |
|
|
|
int32_t bak = nowpos - 100; |
|
|
@ -385,25 +385,52 @@ int32_t PipetteModuleV2::pipette_aspirate_prepare() { |
|
|
|
return 0; |
|
|
|
} |
|
|
|
|
|
|
|
int32_t PipetteModuleV2::pipette_aspirate_set_llf_velocity(int32_t llf_zm_rpm) { |
|
|
|
int32_t PipetteModuleV2::pipette_set_startz(int32_t startz) { |
|
|
|
ZLOGI(TAG, "pipette_set_startz %d", startz); |
|
|
|
m_state.pipette_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; |
|
|
|
return 0; |
|
|
|
} |
|
|
|
|
|
|
|
int32_t PipetteModuleV2::pipette_set_lld_type(int32_t lld_type) { |
|
|
|
ZLOGI(TAG, "pipette_set_lld_type %d", lld_type); |
|
|
|
m_state.lld_type = lld_type; |
|
|
|
return 0; |
|
|
|
} |
|
|
|
int32_t PipetteModuleV2::pipette_set_lld_c_threshold(int32_t c_threshold) { |
|
|
|
ZLOGI(TAG, "pipette_set_lld_c_threshold %d", c_threshold); |
|
|
|
m_state.lld_c_threshold = c_threshold; |
|
|
|
return 0; |
|
|
|
} |
|
|
|
int32_t PipetteModuleV2::pipette_set_lld_p_threshold(int32_t p_threshold) { |
|
|
|
ZLOGI(TAG, "pipette_set_lld_p_threshold %d", p_threshold); |
|
|
|
m_state.lld_p_threshold = p_threshold; |
|
|
|
return 0; |
|
|
|
} |
|
|
|
|
|
|
|
int32_t PipetteModuleV2::pipette_set_llf_velocity(int32_t llf_zm_rpm) { |
|
|
|
m_state.aspirate_cfg_llf_zm_rpm = llf_zm_rpm; |
|
|
|
ZLOGI(TAG, "pipette_aspirate_set_llf_velocity %d", llf_zm_rpm); |
|
|
|
ZLOGI(TAG, "pipette_set_llf_velocity %d", llf_zm_rpm); |
|
|
|
return 0; |
|
|
|
} |
|
|
|
int32_t PipetteModuleV2::pipette_aspirate_set_operation_verifi_p_thre(int32_t p_thre) { |
|
|
|
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_aspirate_set_operation_verifi_p_thre %d", p_thre); |
|
|
|
ZLOGI(TAG, "pipette_set_aspirate_operation_verifi_p_thre %d", p_thre); |
|
|
|
return 0; |
|
|
|
} |
|
|
|
int32_t PipetteModuleV2::pipette_aspirate_set_operation_verifi_eigen_time(int32_t characteristic_time) { |
|
|
|
int32_t PipetteModuleV2::pipette_set_aspirate_operation_verifi_eigen_time(int32_t characteristic_time) { |
|
|
|
m_state.aspirate_cfg_eigen_time = characteristic_time; |
|
|
|
ZLOGI(TAG, "pipette_aspirate_set_operation_verifi_eigen_time %d", characteristic_time); |
|
|
|
ZLOGI(TAG, "pipette_set_aspirate_operation_verifi_eigen_time %d", characteristic_time); |
|
|
|
return 0; |
|
|
|
} |
|
|
|
|
|
|
|
int32_t PipetteModuleV2::pipette_aspirate_set_operation_verifi_tolerance(int32_t tolerance) { |
|
|
|
int32_t PipetteModuleV2::pipette_set_aspirate_operation_verifi_tolerance(int32_t tolerance) { |
|
|
|
m_state.aspirate_cfg_tolerance = tolerance; |
|
|
|
ZLOGI(TAG, "pipette_aspirate_set_operation_verifi_tolerance %d", tolerance); |
|
|
|
ZLOGI(TAG, "pipette_set_aspirate_operation_verifi_tolerance %d", tolerance); |
|
|
|
return 0; |
|
|
|
} |
|
|
|
|
|
|
@ -614,6 +641,10 @@ void PipetteModuleV2::do_pipette_zmotor_move_to_zero_point_quick() { |
|
|
|
|
|
|
|
// 校验偏差
|
|
|
|
int32_t dpos = zm_get_now_pos() - startpos; |
|
|
|
// 设置零点
|
|
|
|
zm_set_now_pos(0 + m_cfg.zm_dzero - m_cfg.zm_io_trigger_append_distance); |
|
|
|
m_state.has_move_to_zero = 1; |
|
|
|
|
|
|
|
if (m_cfg.zm_pos_devi_tolerance != 0 && (abs(expectation_dpos - dpos) > m_cfg.zm_pos_devi_tolerance)) { |
|
|
|
throw zapp_exception(err::kstep_motor_lost_step); |
|
|
|
} |
|
|
@ -769,7 +800,14 @@ void PipetteModuleV2::zm_update_dzero(int32_t dzero) { |
|
|
|
bool PipetteModuleV2::zm0p_is_trigger() { return m_zm0p->getState(); } |
|
|
|
|
|
|
|
void PipetteModuleV2::zm_waitfor_zm0p_trigger_and_stop_motor() { |
|
|
|
while (!zm0p_is_trigger() && !m_zm->isStoped()) thread_delay(2); |
|
|
|
while (!zm0p_is_trigger()) { |
|
|
|
if (m_zm->isStoped()) { |
|
|
|
ZLOGI(TAG, "motor stop first....."); |
|
|
|
break; |
|
|
|
} |
|
|
|
thread_delay(2); |
|
|
|
} |
|
|
|
|
|
|
|
// 停止电机
|
|
|
|
m_zm->stop(); |
|
|
|
// 等待电机停止
|
|
|
@ -777,6 +815,23 @@ void PipetteModuleV2::zm_waitfor_zm0p_trigger_and_stop_motor() { |
|
|
|
thread_delay(10); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
void PipetteModuleV2::zm_waitfor_zm0p_not_trigger_and_stop_motor() { |
|
|
|
// 等待触发
|
|
|
|
while (zm0p_is_trigger()) { |
|
|
|
if (m_zm->isStoped()) { |
|
|
|
ZLOGI(TAG, "motor stop first....."); |
|
|
|
break; |
|
|
|
} |
|
|
|
thread_delay(2); |
|
|
|
} |
|
|
|
|
|
|
|
// 停止电机
|
|
|
|
m_zm->stop(); |
|
|
|
// 等待电机停止
|
|
|
|
while (!m_zm->isStoped()) thread_delay(10); |
|
|
|
} |
|
|
|
|
|
|
|
void PipetteModuleV2::pump_waitfor_stop() { |
|
|
|
while (true) { |
|
|
|
int32_t isbusy = 0; |
|
|
@ -801,15 +856,6 @@ int32_t PipetteModuleV2::pump_read_tip_state(int32_t *val) { |
|
|
|
return 0; |
|
|
|
} |
|
|
|
|
|
|
|
void PipetteModuleV2::zm_waitfor_zm0p_not_trigger_and_stop_motor() { |
|
|
|
// 等待触发
|
|
|
|
while (zm0p_is_trigger()) thread_delay(2); |
|
|
|
// 停止电机
|
|
|
|
m_zm->stop(); |
|
|
|
// 等待电机停止
|
|
|
|
while (!m_zm->isStoped()) thread_delay(10); |
|
|
|
} |
|
|
|
|
|
|
|
void PipetteModuleV2::zm_waitfor_stop() { |
|
|
|
while (!m_zm->isStoped()) thread_delay(10); |
|
|
|
} |
|
|
@ -873,11 +919,11 @@ int32_t PipetteModuleV2::bfcall(int32_t cmdid, uint8_t *param, int32_t len) { |
|
|
|
if (cmdid == kpipette_zmotor_move_by) goto check_motor_is_enable; |
|
|
|
|
|
|
|
if (cmdid == kpipette_zmotor_move_to_zero_point_quick) goto check_motor_has_moveto_zero; |
|
|
|
if (cmdid == kpipette_zmotor_measure_distance) goto check_motor_has_moveto_zero; |
|
|
|
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_init_device) goto check_motor_has_moveto_zero; |
|
|
|
if (cmdid == kpipette_put_tip) goto check_motor_has_moveto_zero; |
|
|
|
if (cmdid == kpipette_init_device) goto suc; |
|
|
|
if (cmdid == kpipette_put_tip) goto suc; |
|
|
|
if (cmdid == kpipette_lld_prepare) goto check_motor_has_moveto_zero; |
|
|
|
if (cmdid == kpipette_lld) goto check_motor_has_moveto_zero; |
|
|
|
if (cmdid == kpipette_lld_test) goto check_motor_has_moveto_zero; |
|
|
@ -912,6 +958,7 @@ check: |
|
|
|
*/ |
|
|
|
return 0; |
|
|
|
} |
|
|
|
suc: |
|
|
|
return 0; |
|
|
|
} |
|
|
|
void PipetteModuleV2::aftercall(int32_t cmdid, uint8_t *param, int32_t len, uint8_t *ack, int32_t acklen, int32_t ret) { |
|
|
|