Bote Electric Appliance (Vevor, etc.) EC Inline Duct Fan PWM Control with FluidNC

So I finally got around to building an exhaust system for my laser cutter that’s better than a pedestal fan in front of a window with a cardboard box on the back attached to some flex duct lying on the end of the laser cutter table; sometimes assisted with a central vac hose.

One of the things I didn’t like about this setup (aside from it only really working for small area jobs where the duct inlet was nearby enough) was the noise.

Somewhere here I think I read that someone, perhaps @bitingmidge, was happy with their Vevor inline duct fan, so I bought their 8-Inch electronically commutated version:

The EC version, unlike the AC version, comes with a controller to control various fan triggers like temperature (measured by a probe that connects to the controller) and speed settings. The fan connects to the controller with a male plug into a funky three pin female jack (KPJX-PM-3S-S or KPJX-PM-3S) on the controller.

Scoping the output of the controller (conveniently using the second fan port so that the controller can be powered by the fan using the first fan port) – black ground, red signal:

…the controller outputs a ~20 kHz 5 VDC PWM signal to control the fan (50% fan speed shown, 1V/div, 50μs/div):

Excellent. Not only is the fan already pretty decently quiet (especially with the exhaust ducted to outside), we can control it with G code to start and stop with the job, which I wouldn’t do manually if I had to walk 40 feet back and then forth around the laser cutter table.

Wiring the KPJX-PM-3S-S or (KPJX-PM-3S) female socket’s ground and signal pins to GPIO.14’s ground and signal pins on a 6x CNC Controller for FluidNC (my laser cutter uses external drivers, so not a Jackpot board on this machine) and adding the following to the config.yaml:

user_outputs:
analog0_pin: gpio.14
analog0_hz: 20000

…allows control over the fan by issuing M67 E0 Qnn.ncommands (where nn.n is the PWM output %), simply by connecting the fan control cable to the KPJX-PM-3S socket… no modification to the fan or wiring is needed.

I note that sometimes the fan shuts off if you command it to 100% (if increasing from a lower non-zero speed), but seems to work fine whenever commanded to 99.9%.

Since we’re not barbarians, and to emulate the fan’s controller behaviour to prevent damage, we can ramp the speed up and down when starting/stopping it by adding two files to the FluidNC controller:

MacroFanOn.gcode:

M67 E0 Q0
G4 P2
M67 E0 Q10
G4 P2
M67 E0 Q20
G4 P2
M67 E0 Q30
G4 P2
M67 E0 Q40
G4 P2
M67 E0 Q50
G4 P2
M67 E0 Q60
G4 P2
M67 E0 Q70
G4 P2
M67 E0 Q80
G4 P2
M67 E0 Q90
G4 P2
M67 E0 Q99.9

and MacroFanOff.gcode:

M67 E0 Q90
G4 P2
M67 E0 Q80
G4 P2
M67 E0 Q70
G4 P2
M67 E0 Q60
G4 P2
M67 E0 Q50
G4 P2
M67 E0 Q40
G4 P2
M67 E0 Q30
G4 P2
M67 E0 Q20
G4 P2
M67 E0 Q10
G4 P2
M67 E0 Q0

…and adding these as macros to the FluidNC config.yaml:

macros:
macro0: $LocalFS/Run=MacroFanOff.gcode
macro1: $LocalFS/Run=MacroFanOn.gcode

…which allows turning the fan on with $RM=1 and off with $RM=0, which can be added to the device’s Custom GCode in LightBurn under the User Start Script and User End Script (or perhaps instead of the User End Script if running many short jobs sequentially, added to a Macro on the Console tab).

6 Likes