Page 1 of 1

Laser PWM control for Neje 40w laser.

PostPosted: Tue Oct 05, 2021 3:40 pm
by Jduke
I am posting this because I had some trouble figuring out exactly how to wire up this thing, and now that I have it working, I wanted to pass along what I did for critique and improvement.

The Neje 40 watt (input power, I know its not 40w output) laser comes with 2 boards to control it, and I was able to short between the 12v and TTL terminals on one board to turn the board on. this would have been fine for simple on and off but I wanted PWM since its capable of variable output.

they have a second board that has LED's for power output so that the one I hooked up.

I connected the 12v 4amp power supply to the board and the 2 wire TTL/Grnd were connected to port 1 output 17 on my AXBBE and to 5v ground on respectively.
to be clear the TTL goes to output 17 and gnd goes to the 0v terminal of 5v power supply.

then In spindle setup I turned on the PWM and assigned Port 1 pin 17 to that, initially I left the max at 255hz will get back to that below, but was only getting 5% output from laser at 255hz

for G code I was experiencing a little trouble going from fusion360 (I am sure there are better options for this, but I am getting familiar with it since it can output g code for extremely varied machines)
to the UCCNC for laser. I used one I found online at optlasers that was designed for Mach3.
Unfortunately this post processor left a few details out for my configuration.

It put out M11 P1 S255 to start the laser and M10 to turn it off, if your familiar with the M10 and M11 codes, you will immediately see the problem. Unfortunately for me, it took a little while.
the M11 should be the stop and M10 is start, so it should be M10 P1 S255 to turn on the laser and M11 for off.

when I switched these commands out, I still wasn't getting anything, just on a whim, I put and M3 at start of program and M5 at end (something I had seen online and filed away for experimentation)
Once I put the M3 in, the M10 command worked, but it only powered the laser at 5%.

I went back into the configuration for the spindle and upped the frequency limit to 5000hz and then changed out the M10 P1 S255 for M10 P1 S5000 and was able to get 100% power on the laser.
I also went back and experimented with the S portion of that command, and as expected the frequency was proportional to output.
so:
S255 output 5%
S2500 output 50%
S4000 output 80%

I am not sure how the Neje laser board is tuned for PWM but it appears that this works, we will see how it runs for a little while.

I am going to continue to use Fusion360 as I mentioned above since I have a 4x4 router table with the AXBBE running it, and now its laser
I also have an AXBBE running a plasma table
I also have an older benchtop mill running Mach3 still.
Just outfitted a vertical machining center with Centroid Acorn and DMM servos.

I bought a copy of sheetcam for use on the plasma table, since it seems quite a bit more intuitive for plasma.

but I am open to suggestions if there are better programs for generating G-code for the laser for UCCNC.

I am also interested if there are any good tutorials for dummies on how to edit post processors for fusion360

Hope this helps someone
Thanks

Duke

Re: Laser PWM control for Neje 40w laser.

PostPosted: Tue Oct 05, 2021 5:23 pm
by santiniuk
Duke,

Many thanks for sharing this information. I am currently investigating how to setup a similar Neje 30W laser.
More a winter project focussed around adding to an existing home built CNC.

Current setup is Mach3 with a low cost USB interface.
I have ordered an AXBB-E due for delivery tomorrow and an UCCNC licence. First job will be to convert the setup over to UCNCC and then look further into the laser addition. I have received the laser module (N40630).

The laser came with a small interface PCB that I presumed would connect direct to the AXBB-E. I have seen similar small PCB's with a digital display that I was under the impression was a test PCB. I'm wondering if I now need this extra pcb for the UCCNC setup?

Lots to learn but plenty of time. Hopefully I will have the AXBB-E installed this weekend and start the learning of UCCNC.

Thanks,
Shaun

Re: Laser PWM control for Neje 40w laser.

PostPosted: Wed Oct 06, 2021 1:28 pm
by Tweakie.CNC
Hi Shaun,

It's about time you joined us here. ;)

You will not be disapointed with UCCNC as it is more like Mach3 than Mach3 itself and the laser control / performance is second to none.

Tweakie.

Re: Laser PWM control for Neje 40w laser.

PostPosted: Thu Oct 07, 2021 11:11 am
by Battwell
you dont use spindle pwm for laser!
use the laser pwm pin.
command it with m3. then m10 Q 0 to 255

i can give you a post processor for vectric. or edit your fusion post to give Q not S

Re: Laser PWM control for Neje 40w laser.

PostPosted: Thu Oct 07, 2021 5:40 pm
by Jduke
Battwell wrote:you dont use spindle pwm for laser!
use the laser pwm pin.
command it with m3. then m10 Q 0 to 255

i can give you a post processor for vectric. or edit your fusion post to give Q not S



I stand corrected, this is part of why I posted here, I figured there may be a more efficient way of doing things.

Battwell is correct, there is a laser pin assignment under I/O setup 1 tab in version 1.2112 and when I switched to that for my laser input, it works based on the 255hz scale.

thank you, I appreciate the offer on vectric post, but i am going to stay with fusion360 and look at learning how to edit the post processor, since thats a skill that would be handy across a variety of machines.

Duke

Re: Laser PWM control for Neje 40w laser.

PostPosted: Thu Oct 07, 2021 7:33 pm
by Jduke
The uccnc post processor for fusion 360 puts mount the correct m10 Q255 for laser power, and also places the M3 and 5 codes where they are needed.

so it looks like I get to put off learning to edit post processors a little longer.

Duke

Re: Laser PWM control for Neje 40w laser.

PostPosted: Sat Oct 09, 2021 9:42 pm
by santiniuk
Tweakie.CNC wrote:Hi Shaun,

It's about time you joined us here. ;)

You will not be disapointed with UCCNC as it is more like Mach3 than Mach3 itself and the laser control / performance is second to none.

Tweakie.



Thank you Tweakie. I have a lot to catch up on here with UCCNC. Roots are very much on the Mach side.

This thread really helped, I have the machine converted and laser now running but lots to learn...

I'm still trying however to understand the difference with the two Neja pcb's I've seen. The one I'm using that was supplied with the laser seems to work ok but its just a simple interface PCB. Although it's running and engraving I'm wondering what the PCB with the display LED digits is used for. I don't have this so was hoping to not purchase unless needed.

Cheers
Shaun

Re: Laser PWM control for Neje 40w laser.

PostPosted: Sun Oct 10, 2021 5:52 am
by Tweakie.CNC
Hi Shaun,

My opinion…
The PCB with the display is to enable the laser to be operated at variable power settings from a simple TTL switched controller by providing an adjustable PWM output.
As UCCNC provides it’s own adjustable PWM signal (and thus can control the laser output power level) the display PCB is not needed.

Tweakie.

Re: Laser PWM control for Neje 40w laser.

PostPosted: Sun Oct 10, 2021 2:04 pm
by Jduke
Tweakie.CNC wrote:Hi Shaun,

My opinion…
The PCB with the display is to enable the laser to be operated at variable power settings from a simple TTL switched controller by providing an adjustable PWM output.
As UCCNC provides it’s own adjustable PWM signal (and thus can control the laser output power level) the display PCB is not needed.

Tweakie.



That’s correct, the axbbe is able to run the neje via the inputs on the board without the LED via PWM

Duke