Pins / Gcode on ramps 1.4 to control relay for plasma

I’m looking at the simplest way I can get my plasma cutter up and running on my lowrider 2.
I just need a form of controlling the plasma arc before / after each cut.

I have seen people talking about M3 / M106 codes for lasers and spindles, but unsure if that would translate to just flicking the arc start button on a plasma. I’ve seen bryan implement linux cnc / gbrl with his, but I don’t want to go down that rabbit hole just yet.

my plasma cutter does have a start arc plug on the back, which I’ve tested with a simple foot pedal, so i think it should work fine with a relay.
Just trying to figure out how I would go about:

  1. Hooking it up to my ramps 1.4 board.
    (I have dual relay boards at my disposal, so if i could control both that would be awesome (1 for plasma, 1 for spindle or vac).
  2. Finding out the correct codes to use in gcode to activate the relay (5v).

Thanks for your help in advance!

Whilst I was researching the Lowrider 2 I found some videos on YouTube. This one shows how the builder wired up two solid state relays to his Ramps board to control power to his router and laser module so might help getting you started.

You have some choices to make. The three common ways to trigger external devices are 1) using 12V fan pins (M106/M107), 2) using spindle laser on/off (M3/M4/M5), and 3) inline commands that use a ‘S’ parameter on G0, G1, and G2 to set the PWM.

Using the fan pins is the easiest solution. With a 12V relay, they don’t require any firmware changes, and changing the assignments to 5V pins should be easy.
If I were in your shoes, I would do the following:

  • Using a multimeter, I would execute M106/M107 commands until I verified that I had control of Fan 0.
  • Reassign Fan 0 and Fan 1 to 5V pins for my relays.

Note that based on a bit of research, the default version of this firmware only has one fan pin enabled.

If you are using the V1 maintained Ramps firmware for the LowRider, the board is identified as MOTHERBOARD BOARD_RAMPS_14_EFB. I believe (untested), you want to change the board type to
MOTHERBOARD BOARD_RAMPS_14_EFF in configuration.h. This will give you two fan pins. Then you can change the in pins_RAMPS.h these two assignments

#ifndef RAMPS_D8_PIN
  #define RAMPS_D8_PIN                         8
#endif
#ifndef RAMPS_D9_PIN
  #define RAMPS_D9_PIN                         9
#endif

Or you can change it below directly where the Fan and Fan1 pin are defined, though the logic is a bit convoluted.

As for 5V pins to use, I’d start with the ones on the Servos block (D4, D5, D6, D11).

A couple of other things:

  • There have been some quality complaints/issues with using a laser using both fan pins and M3/M4/M5 commands. I don’t think this issues will translate into issues for a plasma cutter since you only have on/off, not varying amounts of output based on PWM. These issues were “solved” by going to inline commands.
  • Enabling M3/M4/M5 and/or inline commands is significantly more work in Marlin than dealing with fan pins.
  • There has been some concerns about handling inductive loads like spindles and vacuums using the inexpensive 5V relays. People who know more than I do about electronics suggest using a heavier relay like this one. Personally to handle my spindle and vacuum, I use an IOT relay like this one. This relay will handle a variety of input voltages including 5V and 12V.

@jeffeb3 - In answering this question, I noticed that the board for DualLR and Dual version of the firmware is defined as BOARD_RAMPS_14_EFB, but the board for the Series version, the board is defined as BOARD_GT2560_V3. This seemed a bit strange. Is there a reason?