Author Topic: I think my K1 relay is dead (laser diode control question)  (Read 14920 times)

daregone

  • Posts: 14
    • View Profile
I think my K1 relay is dead (laser diode control question)
« on: March 16, 2015, 03:51:23 PM »
I have recently posted about adding a laser diode to my machine. 

I want to control the diode via pwm in mach3 and have pmdx-126 K1 relay turn the power off/on.  However, I cannot get it toggle on and off via mach3.

I have set output 3 in my ports and pins/outputs to pp1 pin1. 

Am I missing something?

Any suggestions would be appreciated.

Thanks!
« Last Edit: March 17, 2015, 10:18:25 PM by Steve Stallings »

Steve Stallings

  • Administrator
  • Posts: 527
  • www.PMDX.com/Images/Avatar120.jpg
    • View Profile
Re: I think my K1 relay is dead.
« Reply #1 on: March 16, 2015, 04:37:21 PM »
What do you have setting Output 3? A script, or are you using
M3 to turn on the laser diode?

If you could post your XML file we can take a look to see if it
should be working, assuming the output control is not part
of a script.
Steve Stallings
www.PMDX.com

daregone

  • Posts: 14
    • View Profile
Re: I think my K1 relay is dead.
« Reply #2 on: March 16, 2015, 08:34:19 PM »
I am not running a script (at least, not that I know of...)  Currently, I do not have anything connected to the K1 relay.  I do have my router connected through K2 (and it is working).

I tried to upload the xml, was given an error.  So I have changed the extension to txt.

Steve Stallings

  • Administrator
  • Posts: 527
  • www.PMDX.com/Images/Avatar120.jpg
    • View Profile
Re: I think my K1 relay is dead.
« Reply #3 on: March 16, 2015, 09:25:38 PM »
Sorry about the forum not allowing you to post your XML file. My mistake in
not adding XML to the file types allowed. This has been fixed.

In your current configuration M3, M4, and M8 all use Output 1 to turn on
the Port 1 Pin 14 signal, thus controlling the K2 relay. M5 will turn off
Output 1 and thus K2.

M7 as currently configured will turn on Output 2 to turn on Port 1 pin 16.
I suspect you do not have anything connected to this pin.

You have Output 3 configured for Port 1 pin 1 which would turn on relay
K1, but there are no M codes or other functions assigned to use Output 3
so this will never happen.

Please review the Config > Ports and Pins > Spindle page to see how
your M codes for Spindle Relays and for Flood/Mist Relays are configured.

On the Config > Ports and Pins > Motor Outputs page you have the
Spindle enabled (green check mark) and the Step signal configured for
Port 1 Pin 1. This will not work because you cannot send step pulses to
a relay. This setting must be disabled so that it does not conflict with your
relay controls.

If you just want to turn the laser diode on and off, you can do that by
pretending that it is Flood coolant. Configure M8 to control Output 3
which is still set up for Port 1 Pin 1 and then you can turn on the laser
with M8 and turn off the laser with M9.
« Last Edit: March 16, 2015, 09:27:24 PM by Steve Stallings »
Steve Stallings
www.PMDX.com

daregone

  • Posts: 14
    • View Profile
Re: I think my K1 relay is dead.
« Reply #4 on: March 16, 2015, 09:49:11 PM »
Ok,


It looks like the problem is as your pointed out - If the spindle is turned on in Motor Outputs and set to pin 1, then if output 2 is set to 1, the relay will not trip.

However,  I am using a superpid as my speed control for the router.  If I uncheck  the spindle in Motor outputs, I can no longer control the speed through mach.

daregone

  • Posts: 14
    • View Profile
Re: I think my K1 relay is dead.
« Reply #5 on: March 16, 2015, 10:30:11 PM »
maybe it would help if I describe what my set up is and what I am trying to do.

I have a router controlled by pwm, using a superpid.  The superpid will turn on the router when the activation signal is grounded.  The problem is that there can be a time when the pmdx-126 is on, but mach has not come on line.  During this time, the control is grounded and the router will turn on -Not under control.  To prevent this, I ran the control line through the K2 relay - cutting off the path to ground and keeping the router from spinning up.



Ideally,  I would like to have a relay control my dust collection.

I would also like to have the diode on the same machine.  It seems to have a similar problem as the router in that the laser is activated when the ttl input is grounded.  So it seems I should have it disconnected by a relay as well.  I don't want it to fire while the system boots up.   The TTL signal that controls the laser would be an output (possibly pin 16?) .

I plan on using m11 and m10 commands to trigger the laser.

Even better, would be if I could control the ttl input on the laser with a second PWM signal.   The idea being to have a laser with the intensity level controlled by pwm and the router speed controlled by pwm able to work on the same job with no manual conversion/switch over.  I am not sure if that is possible with Mach3. 

Steve Stallings

  • Administrator
  • Posts: 527
  • www.PMDX.com/Images/Avatar120.jpg
    • View Profile
Re: I think my K1 relay is dead.
« Reply #6 on: March 16, 2015, 10:32:48 PM »
OK, so I now understand that you are using the Pin 1 output on J6
of the PMDX-126 to control the speed via the SuperPID. Details like
this are important to getting the correct feedback from us.

Port 1 Pin 1 is the only signal that has direct access to control the
K1 relay, so you will need to use that signal for your Output 3.

Can you move your Spindle Step signal to pin 16 on J6 of the PMDX-126?

I see that you had M7 configured for Output 2 using pin 16 but don't
know if that is actually used. If not, disable Output 2 so that it does
not conflict with Output 3 driving pin 16.

If you did already have a use for pin 16, then maybe you are running
a 3 axis machine and pins 8 and 9 are unused and one of them could
be re-purposed to provide the PWM to the SuperPID.

If all the signals on port 1 are in use, you will need to make use of
one of the port 2 signals on J5 of the PMDX-126.


Steve Stallings
www.PMDX.com

daregone

  • Posts: 14
    • View Profile
Re: I think my K1 relay is dead.
« Reply #7 on: March 16, 2015, 10:36:48 PM »
My apologies about not being more clear in my setup.

Attached is a diagram showing how I have the superpid connected.


Steve Stallings

  • Administrator
  • Posts: 527
  • www.PMDX.com/Images/Avatar120.jpg
    • View Profile
Re: I think my K1 relay is dead.
« Reply #8 on: March 16, 2015, 10:37:51 PM »
Sorry I missed your latest post while I was composing my reply.

Yes, knowing ALL of what you are trying to accomplish is important
to getting a useful reply from us.

You will likely be forced to use the second port.

Using one PWM to control both devices may be possible.

The SuperPID documentation is available on line. Can you provide
a link to the documentation that describes how to control power
level of your laser?

Given this information, and a bit of time to think it over, I will
try to offer a solution. Using port 2 may be required.
Steve Stallings
www.PMDX.com

daregone

  • Posts: 14
    • View Profile
Re: I think my K1 relay is dead.
« Reply #9 on: March 16, 2015, 10:47:41 PM »
First,  Let me say thank you! Your help is very much appreciated!

Unfortunately,  there is not any real documentation for the laser diode.  It is essentially a custom piece. However, it is a 12v 2 amp laser diode with a TTL control wire. 

This is the closest thing I can find:
http://jtechphotonics.com/?page_id=1436

I am also using a Ethernet smooth stepper
« Last Edit: March 17, 2015, 01:37:17 AM by daregone »

Steve Stallings

  • Administrator
  • Posts: 527
  • www.PMDX.com/Images/Avatar120.jpg
    • View Profile
Re: I think my K1 relay is dead (laser diode control question)
« Reply #10 on: March 17, 2015, 10:57:34 PM »
Thank you for the great JPG image of your wiring. If this reply gets things working
for you, could I convince you to do another of the resulting wiring and post it here?

I think I have figured out a way to do what you want using only one port. It does
involve a couple of compromises.

Your dust collector will turn on and off with your router. If you want to run the router
without the dust collector, you will need to use the manual switch on the dust collector
to turn it off.

Your SuperPID and your laser driver will share the PWM signal. Mach3 cannot generate
more than one PWM signal anyway, and I cannot imagine a usage case where you need
the router and the laser on at the same time.

Here is a run down on the wiring:

PC+5 from J6 needs to connect to the +5 of the SuperPID, and to the Positive (+) input
of a solid state relay to control your dust collector.

PCgnd from J6 needs to connect to the GND of the SuperPID and to the GND of your
laser driver, or to the Negative (-) side of the optocoupler input if your driver has an
opto-isolated PWM input. PCgnd also needs to connect to the COM terminal for K2 on
J10 of the PMDX-126.

The N/O terminal for K2 on J10 should connect to the RUN input of the SuperPID.
This is an active low input on the SuperPID (as you have said). The N/O terminal
for K2 should also connect to the Negative terminal of the solid state relay that
will control your dust collector.

Pin 17 will continue to be your "Charge Pump" and will kill everything if it goes away.

Pin 16 will be your PWM and should connect to the PWM input of the SuperPID and
also to the PWM input of your laser driver or the Positive (+) side of the optocoupler
if you driver has an opto-isolated input.

Pin 14 will control K2 and K2 will be used to interrupt the ground to the RUN input
of your SuperPID and also ground to the Negative (-) input of the solid state relay
for your dust collector. Since both the RUN input of the SuperPID and the Negative
side of your solid state relay should float to about 5 volts when the relay opens, both
the SuperPID and the solid state relay should turn off. The solid state relay turns off
because both of its inputs are at 5 volts and it will see a net zero volts between its
inputs.

Pin 1 will control relay K1 and you should use its contacts on J9 to switch the 12 volt
power into your laser driver. Keep in mind that K1 is relatively slow (appx. 50 milliSeconds).
You cannot use it to turn the laser on and off rapidly.

Remember that you need an independent 12 volt power supply for the laser driver.

We also recommend an independent 5 volt power supply when using a SmoothStepper.
The PMDX-126 can power the SmoothStepper if there are no other devices drawing
power from the PMDX-126, but in your case the SuperPID is being powered by the
PMDX-126 so you cannot also power the SmoothStepper from the PMDX-126.
« Last Edit: March 17, 2015, 11:00:52 PM by Steve Stallings »
Steve Stallings
www.PMDX.com

daregone

  • Posts: 14
    • View Profile
Re: I think my K1 relay is dead (laser diode control question)
« Reply #11 on: March 17, 2015, 11:35:16 PM »
Wow!  Thanks!

Let me process all of this and I will happily make and post a diagram.  I am glad you changed the name of this thread - it has certainly gone beyond my initial question.

Stuff to get - 5v power supply for the Smooth Stepper.  12v Supply for laser (I have one, just need to get it installed nicely).  Separate Solid State relay to control the Dust collector.


daregone

  • Posts: 14
    • View Profile
Re: I think my K1 relay is dead (laser diode control question)
« Reply #12 on: March 19, 2015, 04:19:03 PM »
Hi Steve,

Here is my diagram based on your suggested wiring.

Does this look correct?

Thanks again!

Jason

Steve Stallings

  • Administrator
  • Posts: 527
  • www.PMDX.com/Images/Avatar120.jpg
    • View Profile
Re: I think my K1 relay is dead (laser diode control question)
« Reply #13 on: March 19, 2015, 06:24:52 PM »
Hi Jason,

I didn't realize you were going to be using a SmoothStepper. It will allow you
to utilize the four outputs on J5 of the PMDX-126 and will result in a simpler
and cleaner wiring configuration without being forced to combine functions like
your dust collector control with the spindle run command.

Would you like to take advantage of this?

Steve Stallings
www.PMDX.com

daregone

  • Posts: 14
    • View Profile
Re: I think my K1 relay is dead (laser diode control question)
« Reply #14 on: March 19, 2015, 06:34:09 PM »
Yeah- it wouxld be nice to control them independently.