Add a delay between gas filling and cell opening trunk
authorLukáš Jiřiště <jiriste@icpf.cas.cz>
Tue, 10 Dec 2024 16:13:35 +0000 (17:13 +0100)
committerLukáš Jiřiště <jiriste@icpf.cas.cz>
Tue, 10 Dec 2024 16:13:35 +0000 (17:13 +0100)
Servomatic.ino

index 0d8363a38ed8d73acccb9995200125e42124a471..35d3ac46892a6baf7923479b11f2341f62a2bc16 100644 (file)
@@ -19,6 +19,9 @@ static constexpr unsigned long        CELL_BARELY_OPEN_EQUILIBRATION_MS = 60000;
 static constexpr unsigned long EVACUATION_LONG_MS = 600000;
 static constexpr unsigned long EVACUATION_MS = 60000;
 
 static constexpr unsigned long EVACUATION_LONG_MS = 600000;
 static constexpr unsigned long EVACUATION_MS = 60000;
 
+// to get a reliable value for the pressure before connecting the cell
+static constexpr unsigned long FILL_PRESSURE_DELAY_MS = 30000;
+
 static constexpr unsigned int  THREEWAY_TURNS_TO_FILL = 1;
 
 static constexpr float MEASUREMENT_UPPER_LIMIT = 8;
 static constexpr unsigned int  THREEWAY_TURNS_TO_FILL = 1;
 
 static constexpr float MEASUREMENT_UPPER_LIMIT = 8;
@@ -74,6 +77,7 @@ void  main_loop()
                                {
                                        // absorption cycle
                                        threeway_fill(gas_threeway_valve, THREEWAY_TURNS_TO_FILL);
                                {
                                        // absorption cycle
                                        threeway_fill(gas_threeway_valve, THREEWAY_TURNS_TO_FILL);
+                                       delay(FILL_PRESSURE_DELAY_MS);
                                        cell_valve.open_barely();
                                        delay(CELL_BARELY_OPEN_EQUILIBRATION_MS);
                                        cell_valve.open();
                                        cell_valve.open_barely();
                                        delay(CELL_BARELY_OPEN_EQUILIBRATION_MS);
                                        cell_valve.open();