Hello Guest it is March 29, 2024, 05:29:56 AM

Author Topic: No PWM using spindle output for Laser  (Read 2031 times)

0 Members and 1 Guest are viewing this topic.

No PWM using spindle output for Laser
« on: March 26, 2023, 04:21:37 AM »
Hi All,
I have a four axis desktop router I've been running for a number of years Using Windows 7, Mach3, ESS, Generic BOB and H bridge stepper drivers. All been working fine and now I'm adding a Sculpfun S9 Laser module.
Attempting to setup variable laser control using the spindle PWM output from pin 17 port 2 of the ESS.
I'm getting no PWM just full power on or off using M3 Sxx to set power and M5 to turn off.
The output from port 2 pin 17 of the ESS goes to OV or 5V and no PWM measured from pin 17.
Watched a lot of YouTube for help and a number of forums which all basically say it should work.
One difference I have set 35000Hz in the base kernal and not 25000Hz, not sure if this will cause any issues with PWM.
Any ideas welcomed.
Cheers
Nico.

Offline Tweakie.CNC

*
  • *
  •  9,196 9,196
  • Super Kitty
    • View Profile
Re: No PWM using spindle output for Laser
« Reply #1 on: March 26, 2023, 07:20:37 AM »
Have you followed the ESS setup procedure for PWM output ?

https://www.warp9td.com/index.php/gettingstarted/setting-up-the-smoothstepper-and-mach#Spindle

Tweakie.
PEACE
Re: No PWM using spindle output for Laser
« Reply #2 on: March 26, 2023, 07:25:21 PM »
Thanks Tweakie,
Yes I came across the link to that information not long after I put the post up.
I'll be going through the setup info there in a few hours time and yes I can see a number of things need changing from my initial setup attempts and some other stuff to check I didn't know about as well.
Thanks again.
PS
I'll let you know how it goes.
Re: No PWM using spindle output for Laser
« Reply #3 on: March 28, 2023, 08:42:40 AM »
Tweakie thanks for the link and the heads up about my setup.
The laser is now fully operational and being controlled well from Mach3.
I used the Post processor from your link for Vectric as I’m using Aspire.
All good except for the laser not shutting off quickly enough at the end of the job and burning a short line when returning to Home Zero.
I’ll have to look at putting a short delay to homing to allow the laser shutdown time.
I’m also running an older plugin so I’ll update that first.
There was a couple issues getting the laser to reset if I stopped the test run I was doing, returned to home, rewound the Gcode reset everything and started the cycle again from line one, the laser would not come on until after the first laser off and laser on commands in the code, not sure why.
Things to sort out.
Just happy to have it going.😄

Offline Tweakie.CNC

*
  • *
  •  9,196 9,196
  • Super Kitty
    • View Profile
Re: No PWM using spindle output for Laser
« Reply #4 on: March 29, 2023, 04:31:29 AM »
Not sure if this answers your question...

The M11/M10 commands (for laser ON/OFF) need to be followed by an axis movement to be activated.
Make sure you have a G0 or G1 command following the M10 and before M5 at the end of your laser job.

The laser staying on or failing to turn on/off after a Pause or Estop is again related to the lack of a Gcode commanded axis movement following the M11/M10 commands. This explains why it returns to normal operation after encountering these commands when running further in the Gcode file.

Tweakie.
PEACE
Re: No PWM using spindle output for Laser
« Reply #5 on: March 29, 2023, 08:42:31 AM »
Thanks Tweakie,
The code produced by the Post processor in Vectric put a M10P1 at the end of the last line and then again on the next line followed by the go to home zero command line.
So should’ve turned the laser off as I understand it but didn’t as it ran on for about a half second on the way to zero.
I inserted a spindle stop M3 S0 before the homing command line and ran the last section of code again to test it, (just a letter “S” at the end of a name) and that seemed to have solved it.
I’m not sure if I can edit the Post Processor to do this for my machine if it’s going to be a problem with every job in the future as M10 P1 isn’t doing it.
Thanks
Nico

Offline Tweakie.CNC

*
  • *
  •  9,196 9,196
  • Super Kitty
    • View Profile
Re: No PWM using spindle output for Laser
« Reply #6 on: March 29, 2023, 12:11:06 PM »
If its any help - If you detail exactly what you want included I can modify the post processor for you.

Tweakie
PEACE
Re: No PWM using spindle output for Laser
« Reply #7 on: March 29, 2023, 07:01:52 PM »
Ok thanks,
As this is a new setup and the only example of the problem so far what I’ll do first is generate some more short test code of drawings and text to run and see if the problem shows up every time.
This will give me a better understanding of the problem before changing anything.
I’ll have to leave it for a couple of days, some other jobs on my list from the other half 🥰
Thanks again, I’ll get back to you soon.
Nico.
Re: No PWM using spindle output for Laser
« Reply #8 on: March 30, 2023, 07:26:58 AM »
Hi Tweakie,
I ran a couple of simple drawings one with text and all worked fine.
Not sure why they worked and the other didn't.
The one that didn't work correctly was originally drawn up for traditional engraving and then reprocessed for the laser.
I know this shouldn't make any difference but it has the same error with two different lines of text both post processed separately.
Attached are samples of the error and also a simple line drawing with outline text that worked ok.
I'll post the samples separately as the forum isn't letting me add to this post.
Re: No PWM using spindle output for Laser
« Reply #9 on: March 30, 2023, 09:32:14 PM »
Here is some Gcode Sample.
Unfortunately the forum wont let me post images as there is a hidden file in the upload keeps telling me a file of the same name already exists and stops me posting.