Hello Guest it is June 18, 2019, 11:51:42 PM

Author Topic: Laser Diode Issue. I can control it but gcode can't  (Read 1570 times)

0 Members and 1 Guest are viewing this topic.

Laser Diode Issue. I can control it but gcode can't
« on: August 05, 2017, 10:09:46 AM »
Hello,
I have a laser diode on a driver with PWM and that is hooked up to a MX4660. I use a parallel port.

I have my pin set for PWM #14 and I can control the on off of the laser with M3/M5. I can also control the power with the S commands inside MACH.

The laser will not turn off during cuts and only turns off when it is finished with the job(M5), so you see the movement lines.

I have tried Tweakies post processor to enable the M10 and M11 commands but I am not sure I have the correct pin out for output 1, I also do not have a screen in mach to enable those commands. I have checked under general config and mine looks different than the one of the Jtech site and CNCRP.

My CNC motor driver has PWM out built into it and uses pin 14. However I keep seeing someone saying something about an output so I am not really understanding how that flows.

If there is any more information that I can provide to help remedy this situation I would be grateful for any feedback.


Offline Tweakie.CNC

*
  • *
  •  7,812 7,812
  • Super Kitty
    • View Profile
    • Tweakie.CNC
Re: Laser Diode Issue. I can control it but gcode can't
« Reply #1 on: August 06, 2017, 02:26:53 AM »
Hi Brandstu,

Welcome.

Quote
The laser will not turn off during cuts and only turns off when it is finished with the job(M5), so you see the movement lines.

Assuming your set-up allows you to turn the laser ON with M03 and OFF with M05 this problem would generally be overcome within the post-processor you are using.
Feed-rate moves (G01,G02,G03) are cut/engrave so the laser is turned ON. Rapid moves (G00) are positioning so the laser is turned OFF.
So modify your post-processor to add an M03 before each feed-rate move and an M05 before every rapid move.

This system would work and at least it would get you started.

As you will soon discover, the M3/M5 commands are slow to operate so you really need to be using the M11/M10 command set to switch the laser beam ON/OFF. You may also find that switching the PWM ON/OFF is also too slow so you will almost cirtainly need additional circuitry to switch the ModIN on the BB8M between the PWM signal and GND.

Tweakie.
Success consists of going from failure to failure without loss of enthusiasm.  Winston Churchill.
Re: Laser Diode Issue. I can control it but gcode can't
« Reply #2 on: August 06, 2017, 12:58:02 PM »
Thank you very much for your reply Tweakie,
I have read through your site multiple times and many of your forums posts on this issue.

I understand that the speed using M3/M5 won't be acceptable for laser usage and the reason I am looking into the m10/m11.

So the MX4660 has a crazy amount of inputs and outputs. I am sure I can figure out a way to do whatever I need to in relation to switching the laser on and off rapidly with something already on board.

However I have an external power supply specifically for the laser which I think presents some of the problem.

What I am having trouble wrapping my head around is that I am using pin 14 for the pwm signal to the driver. The other wires do not have pins because one is gnd and the other is voltage reference.

I think since that is providing the signal for the variation in power and I can't reuse a pin in MACH, how do I tell pin 14 to switch on and off with output 1 (or output 2) without reusing the pin and creating a conflict.

So I am thinking I would need a relay to switch the power off and on, but having external power go through a controller that is already powered might not be the best idea. I do have an extra driver for my rotational axis I could unplug and it provides 12 VDC @ the correct amperage for the laser to the stepper motor so I wonder if I could somehow wire the laser directly to the stepper motor output to provide power and on and off while still using the pwm on the main controller to control the power level when it is on.

I also see what you are saying about the post processor. I actually have tried a few and am learning to modify them. I used yours as from your site. When editing a post processor on some instructions I see people saying that m10p1 is m10 pin1 and other saying port 1 and other saying output1. I am thinking its the output# but then you would need to assign a pin to that output I think, but I am not sure how to accomplish that in MACH3.
Re: Laser Diode Issue. I can control it but gcode can't
« Reply #3 on: August 06, 2017, 05:03:06 PM »
Hi Brandstu,

Welcome.

Quote
The laser will not turn off during cuts and only turns off when it is finished with the job(M5), so you see the movement lines.

Assuming your set-up allows you to turn the laser ON with M03 and OFF with M05 this problem would generally be overcome within the post-processor you are using.
Feed-rate moves (G01,G02,G03) are cut/engrave so the laser is turned ON. Rapid moves (G00) are positioning so the laser is turned OFF.
So modify your post-processor to add an M03 before each feed-rate move and an M05 before every rapid move.

This system would work and at least it would get you started.

As you will soon discover, the M3/M5 commands are slow to operate so you really need to be using the M11/M10 command set to switch the laser beam ON/OFF. You may also find that switching the PWM ON/OFF is also too slow so you will almost cirtainly need additional circuitry to switch the ModIN on the BB8M between the PWM signal and GND.

Tweakie.


Also on your site I saw a circuit that I thought might be helpful. So turns out it works now. Well at least the M10P1 and M11P1, The power does not change now but it does turn on and off between moves. Figured out the output problem and it wasn't so much of a problem as it was an oversight on my part. I really need to be able to vary the power on the laser though so I need to find a way to hook output1 up to the pwm circuit to have it turn off and on.

Offline Tweakie.CNC

*
  • *
  •  7,812 7,812
  • Super Kitty
    • View Profile
    • Tweakie.CNC
Re: Laser Diode Issue. I can control it but gcode can't
« Reply #4 on: August 07, 2017, 01:47:50 AM »
I am not saying do it but just consider the following circuit…

The variable, inverted, PWM from Mach3 (controlled by the M3 S####) is fed into Opto1 and the output PWM is taken to ModIN on the BB8M.

This PWM signal will be…
ON when Output# is TTL Low
OFF when Output# is TTL High
(Opto2 will short the isolated ‘PWM out’ to GND).

So, in your Gcode PWM is turned on and the power level set with M3 S###
Output# (and thus the laser beam) is turned ON/OFF using the M11/M10 commands.

Just a thought.

Tweakie.
« Last Edit: August 08, 2017, 02:23:35 AM by Tweakie.CNC »
Success consists of going from failure to failure without loss of enthusiasm.  Winston Churchill.
Re: Laser Diode Issue. I can control it but gcode can't
« Reply #5 on: August 08, 2017, 11:34:12 AM »
I am not saying do it but just consider the following circuit…

The variable, inverted, PWM from Mach3 (controlled by the M3 S####) is fed into Opto1 and the output PWM is taken to ModIN on the BB8M.

This PWM signal will be…
ON when Output# is TTL Low
OFF when Output# is TTL High
(Opto2 will short the isolated ‘PWM out’ to GND).

So, in your Gcode PWM is turned on and the power level set with M3 S###
Output# (and thus the laser beam) is turned ON/OFF using the M11/M10 commands.

Just a thought.

Tweakie.


Just to make sure I understand you correctly. I drew a diagram with the MX4660. It does have opto couplers available and the way it looks, I might just be able to use 1 and have it switch the output#1 off and on while still sending the PWM signal since the optocoupler has inputs available. [img][img]
Re: Laser Diode Issue. I can control it but gcode can't
« Reply #6 on: August 08, 2017, 01:15:33 PM »
Also, ignore the ground wire. It shares a common ground across the device. It works! I just fed the PWM signal to the opto coupler and bam.
I can M3 the spindle on with what S requirement I need and it still responds to M10/M11 commands. I am getting some dots where vectors start however. I assume either my accel is low, or it is the ay I am creating the files in v-carve. It seems like it almost stops at certain places along some vectors.

I am starting to look at the PIC engrave software now. Thanks so much for the help Tweakie!
Re: Laser Diode Issue. I can control it but gcode can't
« Reply #7 on: August 08, 2017, 09:24:44 PM »
I am not saying do it but just consider the following circuit…

The variable, inverted, PWM from Mach3 (controlled by the M3 S####) is fed into Opto1 and the output PWM is taken to ModIN on the BB8M.

This PWM signal will be…
ON when Output# is TTL Low
OFF when Output# is TTL High
(Opto2 will short the isolated ‘PWM out’ to GND).

So, in your Gcode PWM is turned on and the power level set with M3 S###
Output# (and thus the laser beam) is turned ON/OFF using the M11/M10 commands.

Just a thought.

Tweakie.


Just a quick update. This does not work as intended. I am not able to control the power. I think I was able to use M3/M5 anyways so that was what made me think that I fixed it. I didn't have time to test it earlier, it looks liked different laser powers but I am fairly certain it is not. Maybe I am not understanding your diagram fully. Any clarification would be greatly appreciated.

Offline Tweakie.CNC

*
  • *
  •  7,812 7,812
  • Super Kitty
    • View Profile
    • Tweakie.CNC
Re: Laser Diode Issue. I can control it but gcode can't
« Reply #8 on: August 09, 2017, 01:57:16 AM »
It’s difficult to explain any other way but this may help…

It is my understanding that the BB8M is controlled by the ModIN input and that 5 Volt TTL is required for this control.

If this input is TTL Low then there is no laser output. The laser is off.
If this input is TTL High then the laser is on continuously.
If PWM is applied to this input then the average laser output power is proportional to the PWM.

Mach3 can produce PWM on a specified output pin which is turned ON with the M3 S### commands and OFF with the M5 command. In operation the PWM signal is turned ON at the start of the work and only turned OFF at the end of the work.

My previous circuit allows the Mach3 PWM signal to be passed to the BB8M ModIN terminal and by using another output pin (Output#) this PWM signal can be shunted to GND thereby turning the laser OFF and ON as required.

Looking at my circuit…
The inverted PWM is fed into one opto isolator with it’s output going to the BB8M
The control signal (M11/M10) is fed into another opto isolator the output of which turns the PWM signal ON or OFF. Turning the PWM ON/OFF turns the laser ON/OFF.

Tweakie.
Success consists of going from failure to failure without loss of enthusiasm.  Winston Churchill.
Re: Laser Diode Issue.
« Reply #9 on: February 22, 2018, 06:39:46 PM »
This is an old post but brings up current issues. Wondering what the final solution was. In my case, I purchased an endurancelasers.com 8 watt diode laser. It has a single 12vdc 6A input to power fans and laser along with a single TTL+ wire to control laser on/off. Like the OP, I have an MX4660/ESS with Ports 1 & 2. Unlike the OP, I have a spindle which uses Output 1 on Pin 17. I have been trying to use Output 3 (Port 2) Pin 17 to trigger a relay but am currently lost. I could use Output 2 (Port 1) Pin 1 but the manual says to connect the grounds together. Sort of hesitant to connect a 5VDC ground to the ground that comes from the VDF (Output 1- connects to the VFD). There has to be a simple solution to turn on/off the laser. I would like to use M7/M9. Can modify the PP to accomplish this. Any suggestions would be appreciated. Thanks.