plasma torch switch relay for 5i25 / G540

More
01 Sep 2016 17:19 #79851 by dbotos
Is this the correct way to do this (see relay in top center of attached wiring diagram)? The plasma cutter fires the torch when its CNC cable pins 3 and 4 are shorted together (grounds the "/START" line inside the machine).

Also, assuming this is correct, how do I map the M03 command to make that output high and the M05 command to bring it back low?

Thanks,
David
Attachments:

Please Log in or Create an account to join the conversation.

More
01 Sep 2016 17:34 #79854 by dbotos
Just went back and re-read the "Outputs" section of the G540 manual, which says:

"These outputs may be used to drive relay coils or for any other purpose. The outputs are rated at 1A and 50VDC maximum. Connect one end of the load to the output and connect the other end of the load to a positive DC voltage. This voltage may be the G540 power supply or it may be a separate power supply having a different voltage."

So it sounds like the G540 output terminals are voltage sinks rather than voltage sources. See revised wiring diagram attached.
Attachments:

Please Log in or Create an account to join the conversation.

More
01 Sep 2016 18:21 #79861 by tommylight
Yes and yes. That should do it as in the last picture. G540 has "open collector " outputs if i remember correctly.
Also, do not forget that you might have to add an "S xxx" after the M3 command in gcode, depending on your setup.
Press F9, it should fire the torch, press again it should stop it. You can also hear the relay click without connecting the plasma, for testing.

Please Log in or Create an account to join the conversation.

More
01 Sep 2016 19:29 #79866 by dbotos
Tommy - thanks for the confirmation!

Do you think it would be necessary to drive the relay using a transistor? While looking for 5V coil relays, I came across this thread that mentions doing that (as well as a diode in parallel with the relay coil):

forum.arduino.cc/index.php?topic=110143.0

I was thinking about grabbing the 5V for the relay from the supply that's powering the THCAD-300 since it's already there. Which makes me think the transistor / diode would be a good idea as not to feedback into the THC.

If I remember correctly from when I was running Mach3, just the M03 command with no speed called out worked fine for firing the torch. I'll have to see if that stays true with LinuxCNC.

Thanks,
David

Please Log in or Create an account to join the conversation.

More
01 Sep 2016 20:08 #79869 by tommylight
The transistor is already inside the G540 (well 2 of them for 2 outputs), so no need for that, ans i not sure but i think it has the diodes also.
Adding another diode does no harm at all, but i know for sure i did not add them when i had Gecko's driving 24V relays.
As a general public announcement when working with plasma, especially with High Voltage/High Frequency start, less is always better, so make cabling as short as possible, proper grounding, the electronic and computer as far from the plasma as possible, use shielded cables for motors, switches, floating head, torch start etc, use metal enclosures.
The thing with adding Sxxx, is you may need it, but usually it woks without it. That is dependent on how the spindle is set in Linuxcnc (in your case no spindle but torch).

Please Log in or Create an account to join the conversation.

More
02 Sep 2016 13:46 #79905 by dbotos
Yes, the G540 is probably using a transistor on each output to toggle it between floating (off) and grounded (on). Any diode would have to be added externally to the G540 since the V+ connection to the relay coil is physically outside of the G540.

While looking at 5 VDC relays, modules for Arduino came up that have the relay, transistor, and diode all on a neat little board with hook-up terminals (this one even has optically isolated input - scroll down the listing to see the schematic):

www.ebay.com/itm/1-Channel-Isolated-5V-R...SP-ARM-/222029213746

The listing says it consumes 50-60 mA, so combined with the THCAD-300's 250 mA max current draw, any 500 mA 5V power supply or larger would be more than enough to feed both. Unless anyone can think of any reason why it wouldn't be good to feed one of these and the THCAD-300 from the same power supply, I think I'm going to get one and try it.

Thanks,
David

Please Log in or Create an account to join the conversation.

More
02 Sep 2016 14:30 #79908 by tommylight
I see no problem in that, as i mentioned earlier, i supply all the electronics with a single laptop power brick, relay included.
As a 5V supply, just use a mobile phone charger, they are all rated at 1A or more, and they are cheap ( do not use chinese they tend to vary the voltage way beyond the TTL limits).

Please Log in or Create an account to join the conversation.

More
03 Sep 2016 02:59 #79949 by dbotos
Yup - I read this blog post where a guy took apart a bunch of USB chargers and showed just how bad some of the cheap ones are:

www.righto.com/2012/10/a-dozen-usb-charg...in-lab-apple-is.html

So back to the spindle mapping in the HAL file - does this look right for what needs to go in the spindle section?

setp hm2_[HOSTMOT2](BOARD).0.gpio.???.is_output 1
setp hm2_[HOSTMOT2](BOARD).0.gpio.???.is_opendrain 0

net spindle-enable motion.spindle-on => hm2_[HOSTMOT2](BOARD).0.gpio.???.out

where ??? is the IONum that maps to the correct pin on the DB25 connector

Please Log in or Create an account to join the conversation.

More
03 Sep 2016 18:22 #79983 by dbotos
Did the dmesg thing as shown here to get the pinout of my 5i25:

linuxcnc.org/docs/2.4/html/drivers_hostmot2.html#r1_7

Output 1 on the G540 is DB25 pin 17. The DB25 connector on the 5i25 is P3. Which corresponds to this line in the hm2.txt file:

hm2/hm2_5i25.0: IO Pin 007 (P3-17): IOPort

This also agrees with what the 5i25 manual says (P3 pin 17 = IO7). So that would make my tentative HAL lines:

setp hm2_[HOSTMOT2](BOARD).0.gpio.007.is_output 1
setp hm2_[HOSTMOT2](BOARD).0.gpio.007.is_opendrain 0

net spindle-enable motion.spindle-on => hm2_[HOSTMOT2](BOARD).0.gpio.007.out

Look right?

Thanks,
David

Please Log in or Create an account to join the conversation.

More
15 Sep 2016 16:58 #80474 by dbotos
Got the relay module mounted and powered with an old Blackberry charger (5 VDC 0.75 A) that I removed the mini USB connector from and added color-coded leads to (see attachment 1). DB25 pin 17 (G540 output 1) is connected to the IN1 terminal of the relay module (see "low" setting schematic of attachment 2). Spindle section of HAL file is as shown in previous post (also included ini and hal files here - see attachments 3 and 4). I fired up LinuxCNC with this configuration, homed the axes, and got the following results:


spindle off:

VCC relative to GND (both on relay module) = 5.06 V (good; what the USB charger is supplying to the relay module)
DB25 pin 17 (output 1) relative to DB25 pin 18 (GND) = 19 mV (essentially zero; was thinking it would be 3.3 or 5 VDC in inactive state)
IN1 (same as DB25 pin 17) relative to GND (both on relay module) = 10.54 V (bad; IN1 should be within 0-5 VDC range)
NO contacts of relay open; NC contacts of relay closed


spindle on (did M03 command via MDI):

VCC relative to GND (both on relay module) = 5.06 V (still good; what the USB charger is supplying to the relay module)
DB25 pin 17 (output 1) relative to DB25 pin (GND) = 2.68 V (was expecting 0 V in active state)
IN1 (same as DB25 pin 17) relative to GND (both on relay module) = 10.54 V (bad; IN1 should be within 0-5 VDC range)
no change in relay contacts


So what's good? Externally supplied voltage level to the relay module seems good and DB25 pin 17 is at least doing something when the spindle changes state in LinuxCNC.

And the bad? I expected DB25 pin 17 to behave as an active low output, but it seems to be behaving as an active high. Should adding this line to the HAL file fix it?:

setp hm2_[HOSTMOT2](BOARD).0.gpio.007.invert_output 1

IN1 voltage relative to the relay module ground is way out of whack. Hopefully not permanently damaging anything on the left side of the opto-isolator by reverse-biasing that circuit path. Do I need to tie the ground of the relay module to one of the DB25 grounds? When I run my 445 nm 1400 mW laser module on the gantry, it has the power supply, laser, and DB25 grounds all tied together.

Thanks,
David
Attachments:

Please Log in or Create an account to join the conversation.

Moderators: PCWjmelson
Time to create page: 0.101 seconds
Powered by Kunena Forum