corrected Tank-Lvel-Calculation

This commit is contained in:
Marcel Peterkau 2022-08-24 23:08:29 +02:00
parent 730f020f41
commit 4f5fdb7af4
4 changed files with 17 additions and 7 deletions

View File

@ -35,6 +35,20 @@
#define OTA_DELAY 50 // ticks -> 10ms / tick
#endif
#define LUBE_PULSE_LENGHT_MS 160
#define LUBE_PULSE_PAUSE_MS 340
// -> 2Hz PumpPulse
// -> 49,7cc / h @ 2Hz
// -> 49,7 ml / h @ 2Hz
// -> 828,4µl / min @ 2Hz
// -> 828,3µl / 60s
// -> 13,81µl / 1s
// -> 6,90µl / Pulse
#define DEFAULT_PUMP_DOSE 7
#define STARTUP_DELAY 5000
#define SHUTDOWN_DELAY_MS 5000
#define ATOMIC_FS_UPDATE

View File

@ -76,7 +76,7 @@ typedef struct
uint32_t DistancePerLube_Default = 8000;
uint32_t DistancePerLube_Rain = 4000;
uint32_t tankCapacity_ml = 320;
uint32_t amountPerDose_µl = 72;
uint32_t amountPerDose_µl = DEFAULT_PUMP_DOSE;
uint8_t TankRemindAtPercentage = 30;
uint8_t PulsePerRevolution = 1;
uint32_t TireWidth_mm = 150;
@ -95,7 +95,7 @@ typedef struct
} LubeConfig_t;
const LubeConfig_t LubeConfig_defaults{
0, 8000, 4000, 320, 72, 30, 1, 150, 70, 18, 2000, 25, SOURCE_IMPULSE,
0, 8000, 4000, 320, DEFAULT_PUMP_DOSE, 30, 1, 150, 70, 18, 2000, 25, SOURCE_IMPULSE,
#ifdef FEATURE_ENABLE_GPS
BAUD_115200,
#endif

View File

@ -5,7 +5,7 @@ uint32_t lubePulseTimestamp = 0;
void RunLubeApp(uint32_t add_milimeters)
{
globals.TankPercentage = PersistenceData.tankRemain_µl / (LubeConfig.tankCapacity_ml * 1000);
globals.TankPercentage = PersistenceData.tankRemain_µl / (LubeConfig.tankCapacity_ml * 10);
MaintainDTC(DTC_TANK_EMPTY, DTC_CRITICAL, (PersistenceData.tankRemain_µl < LubeConfig.amountPerDose_µl));
MaintainDTC(DTC_TANK_LOW, DTC_WARN, (globals.TankPercentage < LubeConfig.TankRemindAtPercentage));

View File

@ -8,10 +8,6 @@
#include "globals.h"
#include "dtc.h"
#define LUBE_PULSE_LENGHT_MS 160
#define LUBE_PULSE_PAUSE_MS 100
#define STARTUP_DELAY 5000
void RunLubeApp(uint32_t add_milimeters);
void LubePulse();