Laser function in a LongMill

@Kyfe and @gwilki, you can check the output by measuring its voltage with a multimeter. You will get different results if you measure DC vs AC, but you can still tell.

The output is a PWM signal (Pulse Width Modulation). The signal ranges from about 0V to 5V. Off would be 0V and full on would be a steady voltage close to 5V. For intensities in between the signal will be a series of pulses. At low intensities the pulses will be more off than on (lower duty cycle) and at higher intensities the pulses will be more on than off (higher duty cycles). Off = 0V and on = ~5V.

Here’s an example of PWM.

I made the following measurements (note $31 in the table should be $30):

Essentially you are just looking for change on the outputs with a a change in power %. The GRBL “s” commands control the intensity as shown in the chart. In my case I have max spindle speed set to 1000 ($30=1000).

2 Likes

@paullarson This is excellent, Paul! Thank you much.

Just to be clear, If I have nothing connected to the pwm cable from the LM controller and I have $30=1 to turn on laser mode, then $31=1000 to set max speed, then send an s1000 command, I should read 5v +/- across the + and - wires in the pwm cable.

Then, if I send s500 in UGS, I should see .28V +/- across the wires. Etc. yes?

1 Like

No. Set $31 to 0. This is minimum spindle speed. Set $30 to 1000. This is maximum spindle speed. You can actually set $30 to whatever you want. Scienci recommended 100. I chose 1000 because I thought it gave me greater resolution. Once set you leave these alone.

From the UGS console use the following GRBL commands:
M4 - turn on the laser
Sx - set spindle speed.
M5 - Disable/turn off the laser. (Your gcode will only use M5 at the end and will use s0 to turn the laser off while engraving/cutting).

Don’t forget we are using the spindle speed controls to control the laser.

So, m4 s0 would turn on the laser at 0% intensity - essentially off but enabled.
S100 would turn the laser on at 10%
S1000 would turn the laser on at 100%

If these don’t work try issuing g1f300s0. This also sets the speed of movement. This may not be necessary, but I got an error message once that I had to set the speed.

1 Like

Tks again, Paul. I was confusing $30 with $32, the latter turns on laser mode. I assume that we don’t need laser mode on to test these outputs since, as you say, we are using spindle speed to control the laser power output.

Probably not, Grant.

1 Like

@paullarson Well, Paul, I did the tests.

First, your $30 and $31 instructions are backwards. No offence intended. $30 is max and $31 is minimum.

So, I set $30=1000 and $31=0.

Then, I did as you instructed. I used M4 to turn on the laser (unconnected). Then I entered the 4 S commands one at a time, taking the readings from my multimeter. My readings were a bit different than yours, but the key is that they changed with each S code.

In case other are interested, here are my readings:

Laser power in % DC measurement AC measurement If $30=1000
5% .286 .50 S50
10% .53 .927 S100
50% 2.45 2.52 S500
100% 4.82 0 S1000
1 Like

@gwilki, you are absolutely correct. I had $30 and $31 swapped in my entries above. I corrected them. Thanks for catching that. You values look great. So your spindle speed output from the
control box is working correctly.

One thing to keep in mind, whatever value you end up using in $30 you need set the same value in LightBurn, or whatever program you are creating your projects in.

1 Like

@paullarson Thanks for confirming that, in this instance only, I’m not cracking up, Paul.

I still don’t have a functioning laser, but at least thanks to you, I now know that my LM controller is doing its thing.

3 Likes

@paullarson thank you for the info and direction. I think I might have a non functioning SpinPWM as no commands are changing the voltage. It stays around 4.44 DC regardless.

Not sure what else it could be. I have attached my EEPROM settings to ensure that i do not have something wrong here.

$$
$0 = 10 (Step pulse time, microseconds)
$1 = 100 (Step idle delay, milliseconds)
$2 = 1 (Step pulse invert, mask)
$3 = 5 (Step direction invert, mask)
$4 = 1 (Invert step enable pin, boolean)
$5 = 0 (Invert limit pins, boolean)
$6 = 0 (Invert probe pin, boolean)
$10 = 1 (Status report options, mask)
$11 = 0.010 (Junction deviation, millimeters)
$12 = 0.002 (Arc tolerance, millimeters)
$13 = 0 (Report in inches, boolean)
$20 = 0 (Soft limits enable, boolean)
$21 = 0 (Hard limits enable, boolean)
$22 = 0 (Homing cycle enable, boolean)
$23 = 0 (Homing direction invert, mask)
$24 = 25.000 (Homing locate feed rate, mm/min)
$25 = 500.000 (Homing search seek rate, mm/min)
$26 = 250 (Homing switch debounce delay, milliseconds)
$27 = 1.000 (Homing switch pull-off distance, millimeters)
$30 = 1000 (Maximum spindle speed, RPM)
$31 = 0 (Minimum spindle speed, RPM)
$32 = 0 (Laser-mode enable, boolean)
$100 = 200.000 (X-axis travel resolution, step/mm)
$101 = 200.000 (Y-axis travel resolution, step/mm)
$102 = 200.000 (Z-axis travel resolution, step/mm)
$110 = 4000.000 (X-axis maximum rate, mm/min)
$111 = 4000.000 (Y-axis maximum rate, mm/min)
$112 = 3000.000 (Z-axis maximum rate, mm/min)
$120 = 750.000 (X-axis acceleration, mm/sec^2)
$121 = 750.000 (Y-axis acceleration, mm/sec^2)
$122 = 500.000 (Z-axis acceleration, mm/sec^2)
$130 = 812.000 (X-axis maximum travel, millimeters)
$131 = 812.000 (Y-axis maximum travel, millimeters)
$132 = 105.000 (Z-axis maximum travel, millimeters)
ok
S500
ok
M4
ok
s500
ok
m5
ok
m4
ok
s1000
ok
s1
ok
g1f300s0
ok

Edit: I tried this as well with laser mode enabled using M3 command to turn on the tool with same results.

@Kyfe, from what you’ve listed above I would have expected you to see a change in the voltage. The settings that I’m familiar with look correct. I would just like to confirm what output you are measuring on the LM control box. It should be Spindle PWM control port. If it is, then you may have a bad control box.

@paullarson I believe I am testing the correct one. on my board it is listed as SpinPWM (in the photo currently i don’t have the green plug in it)
Google Photos

@Kyfe I’ll reply 'cause I’m here. That is the right output. How are you measuring the voltage coming out of it? Do you have green plug with a 2-conductor cable attached, and you are measuring the voltage across the 2 connectors?

When I measured Spin PWM on my controller I moved the empty Spin Direction plug over to Spin PWM so I could insert the probes in easily with no wires in the plug. It worked well. It’s probably a good idea to measure the output without the laser attached just in case it is some how influencing your results.

1 Like

I measured by removing the green plug, and attached the multimeter directly to the pins. I can try to measure again through the green plug to check if the problem remains. I will update when i do that.

Same results when i check with the green plug. stays around 4.44 DC.

@Kyfe It sounds like bad controller. Write to the guys. They may have other things to do/check. I’m sure that they will make things right.

1 Like

Thanks @gwilki and @paullarson for the assistance. Will be following up with technical support.

My problem was resolved with help from Andy. The Arduino board on the controller was not working, not adjusting the PWM pins. Replaced the arduino and now have fully functional laser setup. Thank you all for your help.

2 Likes

I finally got around to checking my Banggood laser last night and the module itself is working correctly, including the button for low power.

Once I get it mounted to the LM, I will check the PWM and see if that is working.

I feel like I can cut the wires now and extend the fan and power through the drag chain.

1 Like

@stevendq Good stuff, S. I’ve done a few projects with mine now, both in LightBurn and in VCarvePro, Being paranoid, I still have not extended the wires on this one. I’ll get there though.

1 Like