3
\$\begingroup\$

I'm adding a laser cutter to my 3D printer. I want to repurpose the cooling fan output to control the laser. My laser has a power supply which accepts a 5V TTL signal to turn the beam on/off.

The fan output is as follows: Fan OFF - both red and black wires are held at 12VDC. Fan ON - Red wire 12VDC, Black wire pulled to GND. (also supports PWM output at various levels, black wire is used for PWM signal while red wire is held at 12VDC.)

I had wrongly assumed the black wire would be held at GND while the 12VDC wire would be used to control the fan. So I assumed I had a GND reference available, so I built this level shifting circuit (which, of course, doesn't work due to black wire being pulled to 12VDC when off). Its purpose was to simply ground the TTL+ pin to the TTL- pin when 12VDC was present on the input, effectively inputting a logic 0 to the laser controller, or allow TTL+ pin to float high when 0VDC was present from the fan controller, inputting a logic 1 to the laser. I realize this inverts the fan output (fan off = laser on) but that's not a problem. And it did work when testing with a 12VDC power supply.

schematic

simulate this circuit – Schematic created using CircuitLab

However, since the outputs of the fan controller both go to 12VDC when the fan is off, this doesn't work. How can this circuit be re-designed in the simplest way possible (hopefully without requiring outside power) to shift this strange 12VDC signal to 0/5VDC TTL signal, or effectively short/open the connection between TTL+ and TTL- pins? I guess a relay would work for simple ON/OFF controls, but that would preclude using PWM to control the laser...

Thanks for any insight.

\$\endgroup\$
6
  • \$\begingroup\$ Spitballing, all you need to do is connect the fan black wire to the NPN base resistor, and use a common ground for the emitter. It will be inverted from the fan logic, but that's it. \$\endgroup\$ – Passerby Aug 3 '17 at 6:18
  • \$\begingroup\$ That base resistor is way too high though. 12v - 0.7v ) / 100 ohms = .11 A or 110 mA. You risk burning out the transistor. A 1k or 470 ohm resistor is more appropriate. \$\endgroup\$ – Passerby Aug 3 '17 at 6:20
  • \$\begingroup\$ I'll answer this tomorrow if no one else has. Don't have access to the schematic tool right now. \$\endgroup\$ – Passerby Aug 3 '17 at 6:20
  • \$\begingroup\$ What was the purpose of the cooling fan? Why don't you need one anymore? \$\endgroup\$ – Solar Mike Aug 3 '17 at 6:33
  • \$\begingroup\$ The fan in a 3D printer cools the newly extruded filament so that it solidifies quickly before it deforms under gravity. The OP is unlikely to try to use the machine as a 3D printer and a laser cutter at the same time. \$\endgroup\$ – Dampmaskin Aug 3 '17 at 7:36
2
\$\begingroup\$

Why don't just solder two wires straight to the Gate and Source pins of the fan MOSFET on RAMPS board? So you will get 5V PWM signal straight from ATMega controller.

That is what I did - soldered two-wire JST-connector to the pins to make it unplugable. Works like a charm.

\$\endgroup\$
1
\$\begingroup\$

I solved this with a very simple circuit, which avoided the need to run extra ground or +5/12V lines. I used a simple optocoupler and resistor.

Again this is an inverted control: when the fan is ON, the laser will be OFF. Anything less than 100% output on the fan will result in the laser pulsing at the fan PWM frequency.

I have a Monoprice Maker Select 3D printer which uses RepRap compatible g-code. To turn the laser ON, issue M106 S0, and to turn the laser OFF, issue M106 S255 gcode commands.

I am using the J Tech Photonics Inkscape plugin to generate laser g-code, and it doesn't support this type of inverted output. So it's necessary to do a search/replace in the gcode file to swap the M106 S255 and M106 S0 commands.

YMMV - hopefully helpful to someone!

schematic

simulate this circuit – Schematic created using CircuitLab

\$\endgroup\$
0
\$\begingroup\$

If you are certain that the black wire gets pulled to 12VDC and the red wire sticks to 12VDC the entire time, you can just use a inverter to drive the whole thing - an inverting buffer like something in the 74xx series parts could work fine as a level translator.

\$\endgroup\$
1
  • \$\begingroup\$ I wanted to avoid needing to run extra 5V/GND wires to the printhead. \$\endgroup\$ – Ryan Griggs Aug 3 '17 at 17:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.