Tune some values
authorLukáš Jiřiště <jiriste@icpf.cas.cz>
Tue, 10 Dec 2024 15:50:47 +0000 (16:50 +0100)
committerLukáš Jiřiště <jiriste@icpf.cas.cz>
Tue, 10 Dec 2024 15:50:47 +0000 (16:50 +0100)
Servomatic.ino

index 164e9303b67fbd91e656c4bbd72d221ed502ea73..0d8363a38ed8d73acccb9995200125e42124a471 100644 (file)
@@ -15,20 +15,21 @@ static constexpr int        CELL_VALVE_PIN = 10;
 static constexpr int   PRESSURE_SENSOR_VALVE_PIN = 11;
 static constexpr int   VACUUM_VALVE_PIN = 12;
 
-static constexpr unsigned long CELL_BARELY_OPEN_EQUILIBRATION_MS = 30000;
+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 int  THREEWAY_TURNS_TO_FILL = 1;
 
 static constexpr float MEASUREMENT_UPPER_LIMIT = 8;
-static constexpr float MEASUREMENT_LOWER_LIMIT = 0.5;
+static constexpr float MEASUREMENT_LOWER_LIMIT = 0.1;
 
 void   threeway_fill(Valve &threeway_valve, unsigned int count)
 {
        while (count > 0)
        {
                threeway_valve.open_barely();
+               delay(500);
                threeway_valve.open();
                --count;
        }
@@ -45,7 +46,7 @@ void  main_loop()
        //PressureSensor        sensor_3{PRESSURE_SENSOR3_PIN, 10, 241};
        Measurement             measurement{sensor_1};
        Valve                   vacuum_valve{VACUUM_VALVE_PIN, 2295, 1494, 802};
-       Valve                   cell_valve{CELL_VALVE_PIN, 2000, 1535, 1276};
+       Valve                   cell_valve{CELL_VALVE_PIN, 2000, 1605, 1230};
        Valve                   gas_threeway_valve{GAS_VALVE_PIN, 1301, 2036, 1641};
 
        vacuum_valve.close();
@@ -103,6 +104,7 @@ void        main_loop()
                delay(CELL_BARELY_OPEN_EQUILIBRATION_MS);
                cell_valve.open();
                delay(10000);
+               cell_valve.close();
                vacuum_valve.close();
                signal_going_to_sleep();
                while (digitalRead(SWITCH_PIN) == LOW)