5 volt TTL control for laser module upgrade

Hi,
I’ve got the original x-carve power supply.

I’ve upgraded to the dewalt router. Then I converted the unused 24 volt spindle power to 12 volt for running a laser via 24->12 VDC converter. The laser is up and running when the spindle control switch on the power supply is set to manual. The problem is that I’d like to control the laser using the x-carve PWM speed control (yellow wire) but doesn’t seem to be working. The laser driver board require 5 volt TTL and the yellow wire only seems to put .85 volt.
https://www.amazon.com/gp/product/B01M27GWAV/ref=oh_aui_detailpage_o00_s00?ie=UTF8&psc=1
Any ideas how to get around this? Thanks in advance!
EDIT: Here’s my current GRBL settings. I’ve noticed some forum posts mentioning a custom version of GRBL for laser mode but I’m not sure if it’s actually needed.
Grbl 0.9j [‘$’ for help]
$$

$$
$0=10 (step pulse, usec)
$1=255 (step idle delay, msec)
$2=0 (step port invert mask:00000000)
$3=3 (dir port invert mask:00000011)
$4=0 (step enable invert, bool)
$5=0 (limit pins invert, bool)
$6=0 (probe pin invert, bool)
$10=3 (status report mask:00000011)
$11=0.020 (junction deviation, mm)
$12=0.002 (arc tolerance, mm)
$13=0 (report inches, bool)
$20=0 (soft limits, bool)
$21=0 (hard limits, bool)
$22=0 (homing cycle, bool)
$23=3 (homing dir invert mask:00000011)
$24=25.000 (homing feed, mm/min)
$25=750.000 (homing seek, mm/min)
$26=250 (homing debounce, msec)
$27=1.000 (homing pull-off, mm)
$100=40.070 (x, step/mm)
$101=40.257 (y, step/mm)
$102=188.604 (z, step/mm)
$110=8000.000 (x max rate, mm/min)
$111=8000.000 (y max rate, mm/min)
$112=500.000 (z max rate, mm/min)
$120=500.000 (x accel, mm/sec^2)
$121=500.000 (y accel, mm/sec^2)
$122=50.000 (z accel, mm/sec^2)
$130=790.000 (x max travel, mm)
$131=790.000 (y max travel, mm)
$132=100.000 (z max travel, mm)

Your multi-meter is averaging the voltage on the yellow wire. Since it is Pulse Width Modulated (PWM) the voltage varies between approximately 0 volts and approximately 5 volts. Because the voltage is not present during the full cycle your meter averages the voltage.

The PWM duty cycle varies from 0 to 100 percent based on the spindle speed selected by the S word in the G-code.

Since you are running version 0.9j, the max spindle speed is set in the firmware to about 12000 RPM. So to get approximately 5 volts on the yellow wire you would have to have the spindle on and set for 12000 or greater RPM (M3 S12000).

You would get better results if you upgrade grbl to my 1.0c or the official 1.1f

I would recommend my version over 1.1f for laser work unless you need the feed rate and spindle speed over ride features for spindle work.

2 Likes

Thanks Larry! I will do so now and cross my fingers :smiley:

Hi Larry,
I upgraded to Grbl 1.0c but still having issues. The yellow wire voltage now seems to be hovering at 1.24 volts regardless of the M03 S command I use. I tried M03 S255, M03 S0 & M03 S10000. I half expected M03 S0 to register 0 voltage. Any ideas about what could be the issue? Thanks again!

$$
$0=10 (step pulse, usec)
$1=255 (step idle delay, msec)
$2=0 (step port invert mask:00000000)
$3=3 (dir port invert mask:00000011)
$4=0 (step enable invert, bool)
$5=0 (limit pins invert, bool)
$6=0 (probe pin invert, bool)
$10=3 (status report mask:00000011)
$11=0.020 (junction deviation, mm)
$12=0.002 (arc tolerance, mm)
$13=0 (report inches, bool)
$20=0 (soft limits, bool)
$21=0 (hard limits, bool)
$22=0 (homing cycle, bool)
$23=3 (homing dir invert mask:00000011)
$24=25.000 (homing feed, mm/min)
$25=750.000 (homing seek, mm/min)
$26=250 (homing debounce, msec)
$27=1.000 (homing pull-off, mm)
$30=255. (rpm max)
$31=0. (rpm min)
$32=1 (laser mode, bool)
$100=40.070 (x, step/mm)
$101=40.257 (y, step/mm)
$102=188.604 (z, step/mm)
$110=8000.000 (x max rate, mm/min)
$111=8000.000 (y max rate, mm/min)
$112=500.000 (z max rate, mm/min)
$120=500.000 (x accel, mm/sec^2)
$121=500.000 (y accel, mm/sec^2)
$122=50.000 (z accel, mm/sec^2)
$130=790.000 (x max travel, mm)
$131=790.000 (y max travel, mm)
$132=100.000 (z max travel, mm)

with $30=255
and $31 = 0

M03 S0 should be about 0 volts.
M03 S255 should be about 4.9 volts.

It’s picture time. Can you post pictures of your wiring here? The connector where the homing switches and PWM wires are connected, and the connection to the power supply interface board.

and change $10=115

As you can probably tell, my photography skills are about on par with my wiring skills. That said, I’m pretty sure that I’m hooked into D11 on the Grbl Shield which is what I’ve read should be correct. I’ve seen some indications that a 10k resistor should be in the loop, see here:


That said, I can’t imagine putting a resistor in the loop will help since I’m nowhere near approaching 5 volts. I’m starting to think that perhaps I should be running the PWM line to the laser driver directly from D11, instead of splicing in at the tri-pole switch. Thanks for the extra set of eyes.

A little further along. I re-seated all of the wires at the tri-pole switch and this seems to have helped a bit. I can see the laser is definitely now in low power mode, barely visible without goggles. However, when I try to run a file or M03 S255, it still doesn’t come up to full power mode. Further, the voltometer at D11 is 1.24 volts so I guess skipping the tri-pole won’t help.

Take the yellow PWM wire out of the power supply interface board terminal. Using that end (you should now have a yellow wire coming directly from D11 on the Arduino/gShield) re-measure your voltage with S value changes. (if you have your laser powered be sure to have your safety glasses on at all times - just in case the laser comes on at full power when you are not expecting it).

If you can get 0 volts with M3 S0 and about 4.9 volts with M3 S255 then you should use that end of the wire to go to the laser driver.

You don’t need an add on resistor with the Arduino as it has active pull-ups enabled on chip.

You can add an external switch to switch the PWM signal between the laser driver and your spindle solution.

Here is how you can set up a switch to safely switch between spindle and laser.

PWM_switch_example

2 Likes

Well no such luck. I removed the yellow wire from the power supply interface board terminal and using that end directly from D11, the voltage measured 1.35 volts. Regardless of the M03 command I specified. It never seemed to change. I guess I’ll pull the Grbl shield off and test the Arduino D11 pin directly.

Good plan.

I took off the Grbl Shield and tested UNO board D11 pin. It also registered 1.3 volts with M03 S255. I could the the TX and RX LED’s blinking rather uniformly. M05 had no effect on the voltage reading either. Wherever the 5 volts was supposed to be coming from, it’s definitely not D11 on the UNO I’m using. I can just buy a new UNO if there’s no doubt in your mind the UNO should be generating 5 volt on D11. It’s strange to me, both boards seem perfectly healthy to the naked eye. I see no burnt resistors or blown capacitors and the upload to the latest version of Grbl had no issues.

It’s possible to blow a port and have the rest of the Atmega328P work fine.

Try another test.

Find pin A3 on the UNO (should be coolant enable)

Issue a M8 command - voltage should be near 5 volts.
Issue a M9 command - voltage should be near 0 volts.

Hi Larry,
You were right! I replaced the UNO board and was able to get 4.94 volt from M03 S255! For those who may run into this issue in the future. Don’t wire into the Power supply controller board at all. Just wire directly to the D11 and you are done! Thanks again! $15.00 to replace the UNO and upgrade the firmware was all I needed!

1 Like