diff --git a/.settings/language.settings.xml b/.settings/language.settings.xml
index bd97006..adb54ce 100644
--- a/.settings/language.settings.xml
+++ b/.settings/language.settings.xml
@@ -5,7 +5,7 @@
-
+
@@ -16,7 +16,7 @@
-
+
diff --git a/uappbase/appcfg/appcfg.hpp b/uappbase/appcfg/appcfg.hpp
index 52968b8..3b00a8d 100644
--- a/uappbase/appcfg/appcfg.hpp
+++ b/uappbase/appcfg/appcfg.hpp
@@ -65,4 +65,10 @@
#define ACID_DEFAULT_NAME14 "一氯乙酸"
#define ACID_DEFAULT_NAME15 "氢氟酸"
-#define PUMPDEFVEL "800" // 100r/min
\ No newline at end of file
+#define PUMPDEFVEL "800" // 100r/min
+
+// 通道每次小回流的液体长度
+#define CH0APPENDML 2.5
+#define CH1APPENDML 2.5
+#define CH2APPENDML 1
+#define CH3APPENDML 1
\ No newline at end of file
diff --git a/uappbase/bean/config_index_enum.hpp b/uappbase/bean/config_index_enum.hpp
index 1447fba..37cf1d3 100644
--- a/uappbase/bean/config_index_enum.hpp
+++ b/uappbase/bean/config_index_enum.hpp
@@ -82,7 +82,10 @@ typedef enum {
/***********************************************************************************************************************
* 回流参数配置 *
***********************************************************************************************************************/
- kcfg_pipeLengthML, // 酸液管路长度
+ kcfg_pipeLengthML0, // 酸液管路长度
+ kcfg_pipeLengthML1, // 酸液管路长度
+ kcfg_pipeLengthML2, // 酸液管路长度
+ kcfg_pipeLengthML3, // 酸液管路长度
kcfg_m0irun, // 电机0 irun
kcfg_m1irun, // 电机1 irun
diff --git a/uappbase/service/config_index.cpp b/uappbase/service/config_index.cpp
index b6917fb..c69872f 100644
--- a/uappbase/service/config_index.cpp
+++ b/uappbase/service/config_index.cpp
@@ -78,9 +78,9 @@ static cfg_iterm_info_t cfg_iterm_infos[] = {
/***********************************************************************************************************************
* 其他配置 *
***********************************************************************************************************************/
- CFG_ITERM(kcfg_lockAcidName, kcfgt_bool, "false"), //
- CFG_ITERM(kcfg_echDitrUpLi, kcfgt_int32, "99"), // 每次分配上限设定值 each distri up-limit
- CFG_ITERM(kcfg_distrInterval, kcfgt_float, "1.5"), // 每次分配间隔时间
+ CFG_ITERM(kcfg_lockAcidName, kcfgt_bool, "false"), //
+ CFG_ITERM(kcfg_echDitrUpLi, kcfgt_int32, "99"), // 每次分配上限设定值 each distri up-limit
+ CFG_ITERM(kcfg_distrInterval, kcfgt_float, "1.5"), // 每次分配间隔时间
// CFG_ITERM(kcfg_pumpDefVel, kcfgt_int32, PUMPDEFVEL), //
CFG_ITERM(kcfg_pumpDefVel0, kcfgt_int32, PUMPDEFVEL), //
@@ -98,8 +98,10 @@ static cfg_iterm_info_t cfg_iterm_infos[] = {
/***********************************************************************************************************************
* 回流参数配置 *
***********************************************************************************************************************/
-
- CFG_ITERM(kcfg_pipeLengthML, kcfgt_float, "100"), //
+ CFG_ITERM(kcfg_pipeLengthML0, kcfgt_float, "300"), //
+ CFG_ITERM(kcfg_pipeLengthML1, kcfgt_float, "300"), //
+ CFG_ITERM(kcfg_pipeLengthML2, kcfgt_float, "100"), //
+ CFG_ITERM(kcfg_pipeLengthML3, kcfgt_float, "100"), //
};
const char *cfgName(int32_t index) {
diff --git a/uappbase/service/config_service_utils.cpp b/uappbase/service/config_service_utils.cpp
index a72d031..9358ef5 100644
--- a/uappbase/service/config_service_utils.cpp
+++ b/uappbase/service/config_service_utils.cpp
@@ -1,6 +1,56 @@
#include "config_service_utils.hpp"
namespace iflytop {
+float getPumpAppendMl(int chid) {
+ switch (chid) {
+ case 0:
+ return CH0APPENDML; //
+ case 1:
+ return CH1APPENDML;
+ case 2:
+ return CH2APPENDML;
+ case 3:
+ return CH3APPENDML;
+ default:
+ ZASSERT(0);
+ return 0;
+ }
+}
+
+float getCfgPipeLengthML(int chid) {
+ switch (chid) {
+ case 0:
+ return getCfgFloat(kcfg_pipeLengthML0);
+ case 1:
+ return getCfgFloat(kcfg_pipeLengthML1);
+ case 2:
+ return getCfgFloat(kcfg_pipeLengthML2);
+ case 3:
+ return getCfgFloat(kcfg_pipeLengthML3);
+ default:
+ ZASSERT(0);
+ return 0;
+ }
+}
+void setCfgPipeLengthML(int chid, float ml) {
+ switch (chid) {
+ case 0:
+ CS->setcfgAndFlush(kcfg_pipeLengthML0, ml);
+ break;
+ case 1:
+ CS->setcfgAndFlush(kcfg_pipeLengthML1, ml);
+ break;
+ case 2:
+ CS->setcfgAndFlush(kcfg_pipeLengthML2, ml);
+ break;
+ case 3:
+ CS->setcfgAndFlush(kcfg_pipeLengthML3, ml);
+ break;
+ default:
+ ZASSERT(0);
+ }
+}
+
int getMxRunRPM(int32_t mid) { //
float rpm = 0;
if (mid == 0) {
diff --git a/uappbase/service/config_service_utils.hpp b/uappbase/service/config_service_utils.hpp
index 2af256f..e9f69b4 100644
--- a/uappbase/service/config_service_utils.hpp
+++ b/uappbase/service/config_service_utils.hpp
@@ -13,4 +13,9 @@ int32_t getMxIRun(int motorid);
const char* getPasswd(const char* usrname, CfgItermCache* cache);
const void setPasswd(const char* usrname, const char* passwd);
+float getCfgPipeLengthML(int chid);
+void setCfgPipeLengthML(int chid, float ml);
+
+float getPumpAppendMl(int chid);
+
} // namespace iflytop
diff --git a/usrc/service/pump_ctrl_service.cpp b/usrc/service/pump_ctrl_service.cpp
index 990d948..4e21855 100644
--- a/usrc/service/pump_ctrl_service.cpp
+++ b/usrc/service/pump_ctrl_service.cpp
@@ -10,9 +10,7 @@ static TMC51X0* m_motors[4];
#define PUMP_NUM 4
static CfgItermCache cfgcache;
-#define APPEND_ML 10
-
-
+// #define APPEND_ML 2
void PumpCtrlService::initialize() {
m_motors[0] = AppHardware::ins()->getPump(0);
@@ -85,12 +83,13 @@ void PumpCtrlService::reflux() {
m_thread.start(
[this]() {
ValveStateSyncService::ins()->setValveState(1);
- int32_t pipeLenML = getCfgInt(kcfg_pipeLengthML);
+ // int32_t pipeLenML = getCfgInt(kcfg_pipeLengthML);
for (size_t i = 0; i < PUMP_NUM; i++) {
TMC51X0* cur_motor = m_motors[i];
cur_motor->stop();
cur_motor->setXACTUAL(0);
+ float pipeLenML = getCfgPipeLengthML(i);
ZLOGI(TAG, "pump %d move %f ml", i, -pipeLenML);
cur_motor->moveBy((int32_t)-pipeLenML * 1000, getMxRunRPM(i));
}
@@ -115,12 +114,11 @@ void PumpCtrlService::acidPrefilling() {
[this]() {
ValveStateSyncService::ins()->setValveState(1);
- int32_t pipeLenML = getCfgInt(kcfg_pipeLengthML);
-
for (size_t i = 0; i < PUMP_NUM; i++) {
TMC51X0* cur_motor = m_motors[i];
cur_motor->stop();
cur_motor->setXACTUAL(0);
+ float pipeLenML = getCfgPipeLengthML(i);
ZLOGI(TAG, "pump %d move %f ml", i, pipeLenML);
cur_motor->moveBy((int32_t)pipeLenML * 1000, getMxRunRPM(i));
}
@@ -135,7 +133,7 @@ void PumpCtrlService::acidPrefilling() {
// 短回流
for (size_t i = 0; i < PUMP_NUM; i++) {
TMC51X0* cur_motor = m_motors[i];
- cur_motor->moveBy(-(int32_t)(APPEND_ML) * 1000, getMxRunRPM(i));
+ cur_motor->moveBy(-(int32_t)(getPumpAppendMl(i) * 1000), getMxRunRPM(i));
}
while (!isAllReachTarget()) {
@@ -198,7 +196,7 @@ void PumpCtrlService::doMoveOnce() {
cur_motor->setXACTUAL(0);
if (pumpselect) {
ZLOGI(TAG, "pump %d move %f ml", i, distribut_ml);
- cur_motor->moveBy((int32_t)(distribut_ml + APPEND_ML) * 1000, getMxRunRPM(i));
+ cur_motor->moveBy((int32_t)(distribut_ml + getPumpAppendMl(i)) * 1000, getMxRunRPM(i));
}
}
@@ -216,7 +214,7 @@ void PumpCtrlService::doMoveOnce() {
cur_motor->stop();
cur_motor->setXACTUAL(0);
if (pumpselect) {
- cur_motor->moveBy(-(int32_t)(APPEND_ML) * 1000, getMxRunRPM(i));
+ cur_motor->moveBy(-(int32_t)(getPumpAppendMl(i)* 1000) , getMxRunRPM(i));
}
}
diff --git a/usrc/service/pump_ctrl_service.hpp b/usrc/service/pump_ctrl_service.hpp
index b233141..b72237f 100644
--- a/usrc/service/pump_ctrl_service.hpp
+++ b/usrc/service/pump_ctrl_service.hpp
@@ -35,8 +35,8 @@ class PumpCtrlService {
void stop();
public:
- void rotate(int32_t mid, int32_t direction);
- void stopRotate();
+ void rotate(int32_t mid, int32_t direction);
+ void stopRotate();
double getMotorNowPosR(int32_t mid);
private: