MQL System with Diesel Heater Pump
-
So I bought a Diesel heater pump on a whim that I'm planning to use for an MQL lubrication system on my CNC.
These pumps are activated by a pulse (in this case 24v) and flow rate can be controlled very accurately by varying the pulse frequency, so for example at 1Hz the pump would dispense ~57ml of fluid an hour.
I'd like to control this via RRF, but my understanding is it's not currently possible to dynamically vary the frequency of a GPIO pin using
M42
, only the pulse width.These pumps require a fixed pulse width of ~40ms but the frequency needs to be varied to control the flow rate. Can this be achieved with RRF?
Pic of pump below.
-
@NineMile You should be able to vary the PWM frequency using the Q parameter to M950. I assume you will not be changing it that often? One thing I'm not sure about is how low a frequency you can actually generate. I don't think you will be able to set Q any lower than 1 and it is an integer I think. You may also need to adjust the M42 value when you change the frequency. I'm also not sure how glitch free changing the frequency will be, in the STM32 version we free and reallocate the timer when you change the frequency as we do not expect that to happen very often and doing that maximises that chance of being able to use a hardware timer.
-
@gloomyandy At lower than 1Hz I could maybe drive the pin by toggling it from 1.0 to 0.0 via
M42
indaemon.g
, but that quickly becomes an issue if wanting to go much above say... 4Hz -
@NineMile What's the lowest (and highest) frequency you are likely to need? Maybe just try hooking it up and see how well it works?
-
@gloomyandy Reasonably... probably 0.5Hz minimum and maybe 5Hz max.
I just tried it out in a macro:
while { iterations < 25 } M42 P1 S1 G4 P80 M42 P1 S0 G4 P120
Ran that a couple of times to prime the pump and then started getting oil out of it, so it does work at ~5Hz, but whether or not that can be done reliably in
daemon.g
I don't know. -
@NineMile Have you tried doing 1-5Hz just using M950?
-
@gloomyandy said in MQL System with Diesel Heater Pump:
@NineMile Have you tried doing 1-5Hz just using M950?
I have a basic implementation of this now that uses M950 for anything equal to or over 1Hz, and then for anything lower I use
daemon.g
to run the on/off cycle, which seems to work nicely. -
@NineMile one option would be to program an Arduino Micro or similar to count pulses received from the Duet and output a 40ms pulse on every e.g. 10th pulse received.