From 01ea5629bcfe4cdc2bc40394ecfbb5939b34aa71 Mon Sep 17 00:00:00 2001 From: zhaohe Date: Tue, 17 Dec 2024 16:35:26 +0800 Subject: [PATCH] update --- .settings/language.settings.xml | 4 +- log/死机日志.log | 164 +++++++++++++++++++++ .../pipette_module/pipette_ctrl_module_v2.cpp | 35 ++--- sdk/components/sensors/smtp2_v2/smtp2_v2.cpp | 23 ++- sdk/components/sensors/smtp2_v2/smtp2_v2.hpp | 2 + serial.bat | 0 新建 文本文档.txt | 0 7 files changed, 207 insertions(+), 21 deletions(-) create mode 100644 log/死机日志.log create mode 100644 serial.bat create mode 100644 新建 文本文档.txt diff --git a/.settings/language.settings.xml b/.settings/language.settings.xml index e1e42a8..adcba3c 100644 --- a/.settings/language.settings.xml +++ b/.settings/language.settings.xml @@ -5,7 +5,7 @@ - + @@ -16,7 +16,7 @@ - + diff --git a/log/死机日志.log b/log/死机日志.log new file mode 100644 index 0000000..b6cdf24 --- /dev/null +++ b/log/死机日志.log @@ -0,0 +1,164 @@ +00188266 INFO [SMTP2 ] tx:/1N2v0R +00188293 INFO [SMTP2 ] rx:(6) (2F3040030D0A) /0@ + +00188294 INFO [SMTP2 ] tx:/1N2c287100R +00188349 INFO [SMTP2 ] rx:(6) (2F3040030D0A) /0@ + +00188350 INFO [SMTP2 ] pump_enable_temp_compensation 0 +00188351 INFO [SMTP2 ] tx:/1u24,0R +00188403 INFO [SMTP2 ] rx:(6) (2F3040030D0A) /0@ + +00188404 INFO [SMTP2 ] tx:/1K0R +00188449 INFO [SMTP2 ] rx:(6) (2F3040030D0A) /0@ + +00188450 INFO [PipetteModuleV2] <- call success +00188467 INFO [PipetteModuleV2] m82 bfcall kpipette_aspirate(75000) -> +00188478 INFO [PipetteModuleV2] <- call success +00188479 INFO [PipetteModuleV2] start work -> pipette_aspirate +00188480 INFO [SMTP2 ] pump_aspirate 75000 +00188481 INFO [SMTP2 ] tx:/1?3 +00188503 INFO [SMTP2 ] rx:(12) (2F3060313439393839030D0A) /0`149989 + +00188504 INFO [SMTP2 ] pump_move_to_nl 224989 +00188505 INFO [SMTP2 ] tx:/1T +00188518 INFO [SMTP2 ] rx:(6) (2F3060030D0A) /0` + +00188519 INFO [SMTP2 ] tx:/1CR +00188527 INFO [SMTP2 ] rx:(6) (2F3060030D0A) /0` + +00188528 INFO [SMTP2 ] tx:/1V31900A224989R +00188552 INFO [SMTP2 ] rx:(6) (2F3040030D0A) /0@ + +00188553 INFO [PipetteModuleV2] zm_move_to 300 10 +00190998 INFO [SMTP2 ] tx:/1TR +00191013 INFO [SMTP2 ] rx:(6) (2F3060030D0A) /0` + +00191014 INFO [SMTP2 ] tx:/1TR +00191029 INFO [SMTP2 ] rx:(6) (2F3060030D0A) /0` + +00191030 INFO [PipetteModuleV2] <- end work +00191069 INFO [PipetteModuleV2] m82 bfcall kpipette_zmotor_move_to(0) -> +00191089 INFO [PipetteModuleV2] <- call success +00191090 INFO [PipetteModuleV2] start work -> pipette_zmotor_move_to +00191091 INFO [PipetteModuleV2] zm_move_to 0 1500 +00191466 INFO [SMTP2 ] tx:/1TR +00191481 INFO [SMTP2 ] rx:(6) (2F3060030D0A) /0` + +00191482 INFO [PipetteModuleV2] <- end work +00191646 INFO [PipetteModuleV2] m82 bfcall kmodule_get_reg(4102) -> +00191647 INFO [PipetteModuleV2] <- call success +00191664 INFO [PipetteModuleV2] m82 bfcall kpipette_zmotor_read_zero_point_state -> +00191665 INFO [PipetteModuleV2] <- call success +00191682 INFO [PipetteModuleV2] m82 bfcall kpipette_zmotor_read_zero_point_state -> +00191683 INFO [PipetteModuleV2] <- call success +00192687 INFO [PipetteModuleV2] m82 bfcall kpipette_zmotor_enable(1) -> +00192689 INFO [PipetteModuleV2] <- call success +00192725 INFO [PipetteModuleV2] m82 bfcall kpipette_zmotor_move_to(50) -> +00192727 INFO [PipetteModuleV2] <- call success +00192728 INFO [PipetteModuleV2] start work -> pipette_zmotor_move_to +00192729 INFO [PipetteModuleV2] zm_move_to 50 1500 +00192891 INFO [SMTP2 ] tx:/1TR +00192906 INFO [SMTP2 ] rx:(6) (2F3060030D0A) /0` + +00192907 INFO [PipetteModuleV2] <- end work +00192990 INFO [PipetteModuleV2] m82 bfcall kliquid_operation_clear_params -> +00192991 INFO [PipetteModuleV2] <- call success +00193010 INFO [PipetteModuleV2] m82 bfcall kliquid_operation_set_gun_runparams(14,14,0,1000,8000) -> +00193011 INFO [PipetteModuleV2] <- call success +00193027 INFO [PipetteModuleV2] m82 bfcall kliquid_operation_fresh_params -> +00193028 INFO [PipetteModuleV2] liquid_operation_runparam: +00193029 INFO [PipetteModuleV2] pump_acc :14 +00193030 INFO [PipetteModuleV2] pump_dec :14 +00193031 INFO [PipetteModuleV2] pump_vstart :0 +00193032 INFO [PipetteModuleV2] pump_vstop :1000 +00193033 INFO [PipetteModuleV2] pump_vmax :8000 +00193034 INFO [PipetteModuleV2] zmotor_posmin :0 +00193035 INFO [PipetteModuleV2] zmotor_posmax :0 +00193036 INFO [PipetteModuleV2] zmotor_vmax :0 +00193037 INFO [PipetteModuleV2] lld_enable_record_data :0 +00193038 INFO [SMTP2 ] tx:/1L14,14R +00193058 INFO [SMTP2 ] rx:(6) (2F3040030D0A) /0@ + +00193059 INFO [SMTP2 ] tx:/1N2v0R +00193086 INFO [SMTP2 ] rx:(6) (2F3040030D0A) /0@ + +00193087 INFO [SMTP2 ] tx:/1N2c319000R +00193191 INFO [SMTP2 ] rx:(0) () +00193212 INFO [SMTP2 ] tx:/1N2c319000R +00193316 INFO [SMTP2 ] rx:(0) () +00193337 INFO [SMTP2 ] tx:/1N2c319000R +00193441 INFO [SMTP2 ] rx:(0) () +00193462 ERRO [PipetteModuleV2] [366] do m_smtp2.pump_set_vstop(liquid_operation_runparam.pump_vstop) fail, error kdevice_is_offline(1105) +00193463 INFO [PipetteModuleV2] <- call fail,kdevice_is_offline(1105) +00240684 INFO [PipetteModuleV2] m82 bfcall kmodule_get_reg(4002) -> +00240685 INFO [SMTP2 ] tx:/1?31 +00240710 INFO [SMTP2 ] rx:(6) (2F3040030D0A) /0@ + +00240711 INFO [PipetteModuleV2] <- call success +00240779 INFO [PipetteModuleV2] m82 bfcall kmodule_get_reg(4102) -> +00240780 INFO [PipetteModuleV2] <- call success +00240797 INFO [PipetteModuleV2] m82 bfcall kpipette_zmotor_read_zero_point_state -> +00240798 INFO [PipetteModuleV2] <- call success +00240813 INFO [PipetteModuleV2] m82 bfcall kpipette_zmotor_move_to_zero_point_quick -> +00240830 INFO [PipetteModuleV2] <- call success +00240831 INFO [PipetteModuleV2] start work -> pipette_zmotor_move_to_zero_point_quick +00240832 INFO [PipetteModuleV2] zm_move_to 0 1500 +00241002 INFO [PipetteModuleV2] leave from zero +00241003 INFO [TMC5130 ] moveToEnd 1 100 +00241019 INFO [PipetteModuleV2] move to again +00241020 INFO [TMC5130 ] moveToEnd -1 200 +00241047 INFO [SMTP2 ] tx:/1TR +00241062 INFO [SMTP2 ] rx:(6) (2F3060030D0A) /0` + +00241063 INFO [PipetteModuleV2] <- end work +00241096 INFO [PipetteModuleV2] m82 bfcall kpipette_zmotor_read_zero_point_state -> +00241097 INFO [PipetteModuleV2] <- call success +00242225 INFO [PipetteModuleV2] m82 bfcall kpipette_zmotor_enable(1) -> +00242231 INFO [PipetteModuleV2] <- call success +00242247 INFO [PipetteModuleV2] m82 bfcall kpipette_zmotor_move_to_zero_point_quick -> +00242250 INFO [PipetteModuleV2] <- call success +00242251 INFO [PipetteModuleV2] start work -> pipette_zmotor_move_to_zero_point_quick +00242252 INFO [PipetteModuleV2] zm_move_to 0 1500 +00242278 INFO [PipetteModuleV2] move to zero +00242279 INFO [TMC5130 ] moveToEnd -1 200 +00242305 INFO [PipetteModuleV2] leave from zero +00242306 INFO [TMC5130 ] moveToEnd 1 100 +00242322 INFO [PipetteModuleV2] move to again +00242323 INFO [TMC5130 ] moveToEnd -1 200 +00242350 INFO [SMTP2 ] tx:/1TR +00242365 INFO [SMTP2 ] rx:(6) (2F3060030D0A) /0` + +00242366 INFO [PipetteModuleV2] <- end work +00242400 INFO [PipetteModuleV2] m82 bfcall kpipette_zmotor_move_to(545) -> +00242415 INFO [PipetteModuleV2] <- call success +00242416 INFO [PipetteModuleV2] start work -> pipette_zmotor_move_to +00242417 INFO [PipetteModuleV2] zm_move_to 545 1500 +00243001 INFO [SMTP2 ] tx:/1TR +00243016 INFO [SMTP2 ] rx:(6) (2F3060030D0A) /0` + +00243017 INFO [PipetteModuleV2] <- end work +00243146 INFO [PipetteModuleV2] m82 bfcall kpipette_zmotor_enable(1) -> +00243156 INFO [PipetteModuleV2] <- call success +00243190 INFO [PipetteModuleV2] m82 bfcall kpipette_init_device -> +00243194 INFO [PipetteModuleV2] <- call success +00243195 INFO [PipetteModuleV2] start work -> pipette_init_device +00243196 INFO [SMTP2 ] pump_set_io1_mode 0 +00243197 INFO [SMTP2 ] tx:/1u9,0R +00243215 INFO [SMTP2 ] rx:(6) (2F3040030D0A) /0@ + +00243216 INFO [SMTP2 ] pump_set_io2_mode 0 +00243217 INFO [SMTP2 ] tx:/1u10,0R +00243247 INFO [SMTP2 ] rx:(6) (2F3040030D0A) /0@ + +00243248 INFO [SMTP2 ] pump_set_tip_size 1 +00243249 INFO [SMTP2 ] tx:/1u18,1R +00243279 INFO [SMTP2 ] rx:(6) (2F3040030D0A) /0@ + +00243280 INFO [SMTP2 ] tx:/1T +00243308 INFO [SMTP2 ] rx:(6) (2F3060030D0A) /0` + +00243309 INFO [SMTP2 ] tx:/1CR +00243317 INFO [SMTP2 ] rx:(6) (2F3060030D0A) /0` + +00243318 INFO [SMTP2 ] tx:/1N2V2552000ZR +00243341 INFO [SMTP2 ] rx:(6) (2F3040030D0A) /0@ diff --git a/sdk/components/pipette_module/pipette_ctrl_module_v2.cpp b/sdk/components/pipette_module/pipette_ctrl_module_v2.cpp index 0c97de0..ca4d489 100644 --- a/sdk/components/pipette_module/pipette_ctrl_module_v2.cpp +++ b/sdk/components/pipette_module/pipette_ctrl_module_v2.cpp @@ -221,7 +221,7 @@ int32_t PipetteModuleV2::pipette_zmotor_enable(int32_t enable) { * @return int32_t */ int32_t PipetteModuleV2::pipette_zmotor_move_zero() { // - THREAD_START_WORK([this]() { + thread_start_work(__FUNCTION__, [this]() { do_zm_move_0p(); // 移动到零点 zm_set_now_pos(0 + m_cfg.zm_dzero - m_cfg.zm_io_trigger_append_distance); m_state.has_move_to_zero = 1; @@ -235,7 +235,7 @@ int32_t PipetteModuleV2::pipette_zmotor_move_zero() { // * @return int32_t */ int32_t PipetteModuleV2::pipette_zmotor_measure_distance() { - THREAD_START_WORK([this]() { + thread_start_work(__FUNCTION__, [this]() { int32_t startpos = zm_get_now_pos(); do_zm_move_0p(); // 移动到零点 int32_t dpos = zm_get_now_pos() - startpos; @@ -265,7 +265,7 @@ int32_t PipetteModuleV2::pipette_zmotor_read_measure_distance_result(int32_t *re * @return int32_t */ int32_t PipetteModuleV2::pipette_zmotor_move_by(int32_t distance) { - THREAD_START_WORK([this, distance]() { + thread_start_work(__FUNCTION__, [this, distance]() { module_active_cfg(); zm_move_by(distance, m_cfg.zm_default_velocity); zm_waitfor_stop(); @@ -282,7 +282,7 @@ int32_t PipetteModuleV2::pipette_zmotor_move_to(int32_t tox) { if (m_cfg.zm_min_d != 0 && tox < m_cfg.zm_min_d) tox = m_cfg.zm_min_d; if (m_cfg.zm_max_d != 0 && tox > m_cfg.zm_max_d) tox = m_cfg.zm_max_d; - THREAD_START_WORK([this, tox]() { + thread_start_work(__FUNCTION__, [this, tox]() { zm_move_to(tox, m_cfg.zm_default_velocity); zm_waitfor_stop(); }); @@ -295,7 +295,7 @@ int32_t PipetteModuleV2::pipette_zmotor_move_to(int32_t tox) { * @return int32_t */ int32_t PipetteModuleV2::pipette_zmotor_move_to_zero_point_quick() { - THREAD_START_WORK([this]() { do_pipette_zmotor_move_to_zero_point_quick(); }); + thread_start_work(__FUNCTION__, [this]() { do_pipette_zmotor_move_to_zero_point_quick(); }); return 0; } @@ -364,25 +364,26 @@ int32_t PipetteModuleV2::liquid_operation_fresh_params() { DO(m_smtp2.pump_set_acc_and_dec(liquid_operation_runparam.pump_acc, liquid_operation_runparam.pump_dec)); DO(m_smtp2.pump_set_vstart(liquid_operation_runparam.pump_vstart)); DO(m_smtp2.pump_set_vstop(liquid_operation_runparam.pump_vstop)); - DO(m_smtp2.pump_set_io1_mode(0)); // lld输入高 - DO(m_smtp2.pump_set_io2_mode(0)); // 通用输入 - DO(m_smtp2.pump_set_tip_size(1)); // 250ul + DO(m_smtp2.pump_enable_temp_compensation(0)); // 关闭温度补偿 - DO(m_smtp2.write_cmd("/1K0R\r")); // 设置背隙为0 + DO(m_smtp2.pump_set_back_clearance(0)); // 设置背隙为0 return 0; } int32_t PipetteModuleV2::pipette_init_device() { - THREAD_START_WORK([this]() { + thread_start_work(__FUNCTION__, [this]() { DO_IN_THREAD(m_smtp2.pump_init(liquid_operation_runparam.pump_vmax)); pump_waitfor_stop(); + DO_IN_THREAD(m_smtp2.pump_set_io1_mode(0)); // lld输入高 + DO_IN_THREAD(m_smtp2.pump_set_io2_mode(0)); // 通用输入 + DO_IN_THREAD(m_smtp2.pump_set_tip_size(1)); // 250ul }); return 0; } int32_t PipetteModuleV2::pipette_put_tip() { - THREAD_START_WORK([this]() { + thread_start_work(__FUNCTION__, [this]() { DO_IN_THREAD(m_smtp2.pump_put_tip()); pump_waitfor_stop(); }); @@ -390,7 +391,7 @@ int32_t PipetteModuleV2::pipette_put_tip() { } int32_t PipetteModuleV2::pipette_pump_move_to(int32_t nl) { - THREAD_START_WORK([this, nl]() { + thread_start_work(__FUNCTION__, [this, nl]() { int32_t pumpv = liquid_operation_runparam.pump_vmax; DO_IN_THREAD(m_smtp2.pump_move_to_nl(pumpv, nl)); pump_waitfor_stop(); @@ -494,7 +495,7 @@ int32_t PipetteModuleV2::pipette_aspirate(int32_t nl) { return err::kparam_out_of_range; } - THREAD_START_WORK([this, nl]() { + thread_start_work(__FUNCTION__, [this, nl]() { int32_t llfrpm = liquid_operation_runparam.zmotor_vmax; int32_t llftpos = liquid_operation_runparam.zmotor_posmax; int32_t pumpv = liquid_operation_runparam.pump_vmax; @@ -517,7 +518,7 @@ int32_t PipetteModuleV2::pipette_distribu(int32_t nl) { return err::kparam_out_of_range; } - THREAD_START_WORK([this, nl]() { + thread_start_work(__FUNCTION__, [this, nl]() { int32_t llfrpm = liquid_operation_runparam.zmotor_vmax; int32_t pumpv = liquid_operation_runparam.pump_vmax; @@ -578,9 +579,9 @@ int32_t PipetteModuleV2::pipette_shake_up(int32_t nl, int32_t times) { int32_t PipetteModuleV2::pipette_clear_hanging_liquid(int32_t repeat_times) { // llf_startz // llf_endz - thread_start_work(__FUNCTION__, [this, repeat_times]() { - - }); + // thread_start_work(__FUNCTION__,[this, repeat_times]() { + // + // }); return 0; } diff --git a/sdk/components/sensors/smtp2_v2/smtp2_v2.cpp b/sdk/components/sensors/smtp2_v2/smtp2_v2.cpp index 8b00705..a2c02ae 100644 --- a/sdk/components/sensors/smtp2_v2/smtp2_v2.cpp +++ b/sdk/components/sensors/smtp2_v2/smtp2_v2.cpp @@ -91,6 +91,7 @@ int32_t SMTP2V2::pump_put_tip() { return runaction(true, "/1E0R\r"); } int32_t SMTP2V2::pump_init(int32_t v) { return runaction(true, "/1N2V%dZR\r", v * 319); } int32_t SMTP2V2::pump_reset() { _sendcmd(true, "/1!0R\r"); // 复位指令没有回执,所以这里只能使用方法_sendcmd + _sendcmd(true, "/1!0R\r"); // 复位指令没有回执,所以这里只能使用方法_sendcmd return 0; } #if 0 @@ -288,6 +289,18 @@ int32_t SMTP2V2::pump_distribut_mlld_get_state(int32_t* detected) { return ret; } +int32_t SMTP2V2::pump_set_back_clearance(int32_t val) { + int32_t ret = 0; + for (size_t i = 0; i < 3; i++) { + ret = setstate(true, "/1K%dR\r", val); + if (ret == 0) { + return ret; + } + osDelay(1); + } + return ret; +} + /*********************************************************************************************************************** * 调试使用 * ***********************************************************************************************************************/ @@ -373,7 +386,7 @@ int32_t SMTP2V2::_runaction(bool dump, const char* cmd) { for (size_t i = 0; i < 3; i++) { if (i != 0) { ZLOGE(TAG, "resend cmd ......................................................."); - osDelay(10); + osDelay(200); } if (!_sendcmd(dump, "/1T\r")) continue; @@ -394,7 +407,7 @@ int32_t SMTP2V2::readstate(bool dump, const char* format, ...) { if (_sendcmd(dump, cmdbuf)) { return getAckEcode(); } - osDelay(20); + osDelay(200); } return getAckEcode(); } @@ -517,5 +530,11 @@ bool SMTP2V2::_sendcmd_dma(const char* cmd) { if (m_rxbuf[m_rxNum - 1] != '\n' || m_rxbuf[m_rxNum - 2] != '\r' || m_rxbuf[m_rxNum - 3] != 3) { return false; } + + if (getAckEcode() == err::kpipette_error_InvalidCmd) { + return false; + } + + osDelay(10); return true; } diff --git a/sdk/components/sensors/smtp2_v2/smtp2_v2.hpp b/sdk/components/sensors/smtp2_v2/smtp2_v2.hpp index e90441a..664158a 100644 --- a/sdk/components/sensors/smtp2_v2/smtp2_v2.hpp +++ b/sdk/components/sensors/smtp2_v2/smtp2_v2.hpp @@ -170,6 +170,7 @@ class SMTP2V2 { int32_t pump_set_io2_mode(int32_t mode); // 0通用输入 1紧急制动 2Tip脱落输出高 3Tip脱落输出低 int32_t pump_set_tip_size(int32_t size); // Tip大小 0:1ml 1:200ul(max:250ul) 2:50ul(max:62ul) 3=20ul(max:40ul) int32_t pump_enable_temp_compensation(int32_t enable); // 0:关闭 1:开启 + int32_t pump_set_back_clearance(int32_t val); /*********************************************************************************************************************** * STATE * @@ -217,6 +218,7 @@ class SMTP2V2 { int32_t pump_aspirate_infer_eigen_time(int32_t v, int32_t ul); int32_t pump_get_infer_eigen_time(int32_t* eigen_time); + public: // diff --git a/serial.bat b/serial.bat new file mode 100644 index 0000000..e69de29 diff --git a/新建 文本文档.txt b/新建 文本文档.txt new file mode 100644 index 0000000..e69de29