So I know this topic has been beaten to death in a few forum posts, but rather than append existing posts with new/off topic questions, I decided to start my own.
I picked up the Neje 30w (7.5*w) module and have it hooked to my MKS Base board running Marlin.
I have done quite a bit of perusing on the forums, and found Ryan’s fix to the marlin.cpp file to get rid of the pesky 10hz delay on updating the fan speed parameter, for faster response when using M106/M107 to control the laser power.
The laser module is a 12v, with a TTL/PWM signal that can handle up to 12v, so driving it directly from D9/ fan output won’t fry it out, but due to the way ramps (or at least the MKS Base variant) works, the FETs on the fans and extruder outputs do not switch Vcc - They switch ground. So by wiring +/- for the laser to +/- on the power connector, and wiring TTL/PWM to Fan +, the laser is always on full power. If I were to wire TTL/PWM to Fan -, then the logic would be inverse - M107 would turn the laser to full, M106 S255 would turn the laser off, etc.
Is there a way in Marlin to invert the fan pwm logic, or would I be better off remapping the fan to an alternate pin?
Alternately, and I did test this, wiring laser + to power +, and wiring laser TTL and laser - to Fan +/- respectively does work, but that means I’m applying the PWM duty cycle to the main power as well as the TTL logic, if that makes sense. Not sure if that’s good for the laser module with long term use.
Would appreciate any advice. Personally I would like to stick with the fan terminals, if for no reason other than the screw terminals are more compatible with my wiring.