Browse Source

🐛 Fix flowmeter calculation (#21959)

vanilla_fb_2.0.x
gjdodd 3 years ago
committed by Scott Lahteine
parent
commit
cf447a5442
  1. 6
      Marlin/src/feature/cooler.h

6
Marlin/src/feature/cooler.h

@ -78,10 +78,8 @@ public:
// Get the total flow (in liters per minute) since the last reading
static void calc_flowrate() {
//flowmeter_interrupt_disable();
// const uint16_t pulses = flowpulses;
//flowmeter_interrupt_enable();
flowrate = flowpulses * 60.0f * (1000.0f / (FLOWMETER_INTERVAL)) * (1000.0f / (FLOWMETER_PPL));
// flowrate = (litres) * (seconds) = litres per minute
flowrate = (flowpulses / (float)FLOWMETER_PPL) * ((1000.0f / (float)FLOWMETER_INTERVAL) * 60.0f);
flowpulses = 0;
}

Loading…
Cancel
Save