Operate a Pneumatic air cylinder for Z-Axis movement

philmurp
Posts: 42
Joined: Sat Oct 12, 2013 5:26 pm

Re: Operate a Pneumatic air cylinder for Z-Axis movement

Post by philmurp » Wed Nov 06, 2013 11:35 pm

I am also trying to implement limit switches on both of my axis that are also wired in with an emergency stop button. I have found some sources on how to do this with a regular arduino board. However with my grbl shield I am wondering anything is different? Does anyone have a wiring diagram that they can provide as well? I have found some sources that say a resistor is need while others do not include them so I want to make sure I am safe and not going to destroy my board. (I want limit switches on both sides of my x,Y axis all wired in parallel to the emergency stop switch.) Finally, is there anything that needs to be setup with the switches or is it just I wire them and they perform there function? Thank you.

cvoinescu
Posts: 4442
Joined: Thu Jul 19, 2012 6:50 pm
Location: Camberley, UK
Contact:

Re: Operate a Pneumatic air cylinder for Z-Axis movement

Post by cvoinescu » Sat Nov 09, 2013 1:19 pm

GRBL 0.8c has direct support for limit switches on all three axes, and a separate emergency stop input. You don't need to wire them together, and they're more useful wired separately (because the limit switches can then be used for homing too).

GRBL expects the pin to be pulled low when the limit is reached or the e-stop is pressed, and supplies weak pull-up resistors for that. For the limit switches, there are two strategies:
1. Normally open (NO) switches: wire the two limit switches on each axis in parallel, between GND and the respective input pin (D9 for X, D10 for Y, D11 for Z). Add an optional pull-up resistor (around 1 Kohm) to VCC for each pin.
2. Normally closed (NC) switches: wire the two limit switches on each axis in series, between VCC and the respective input pin. Add a pull-down resistor (required, around 1 Kohm) to GND for each pin. This method has better noise immunity and practically eliminates false limit switch triggering. If you're a purist, you'll want to recompile GRBL with the internal weak pull-ups disabled, but it works just fine even with them enabled too.

Usually, emergency stop buttons have two sections, one NO and one NC. Wire the V+ motor supply through the NC section (so that pressing the switch cuts power to the motors), and wire the NO section between the e-stop input pin (A2, if I recall correctly -- do check the GRBL wiring diagram) and GND. To avoid false triggering in a noisy environment, a pull-up to VCC is a good idea (1 Kohm or so).
Proud owner of ShapeOko #709, eShapeOko #0, and of store.amberspyglass.co.uk

philmurp
Posts: 42
Joined: Sat Oct 12, 2013 5:26 pm

Re: Operate a Pneumatic air cylinder for Z-Axis movement

Post by philmurp » Sun Nov 10, 2013 8:30 pm

Can you explain how to wire a pull up resistor to the VCC, I am not familiar with that term. Thanks, phil

cvoinescu
Posts: 4442
Joined: Thu Jul 19, 2012 6:50 pm
Location: Camberley, UK
Contact:

Re: Operate a Pneumatic air cylinder for Z-Axis movement

Post by cvoinescu » Mon Nov 11, 2013 12:48 am

Connect the resistor between the input pin and VCC.

It's called a pull-up because its role is to ensure that an otherwise unconnected pin (e.g., open-circuit switch) has a high logic level (that is, it reads as a logic one). The resistors "pulls" the level of the pin up. Connecting the pin to GND (e.g., by closing the switch) easily overcomes the "pull" of the resistor, and changes the input to a low logic level (zero).
Proud owner of ShapeOko #709, eShapeOko #0, and of store.amberspyglass.co.uk

philmurp
Posts: 42
Joined: Sat Oct 12, 2013 5:26 pm

Re: Operate a Pneumatic air cylinder for Z-Axis movement

Post by philmurp » Thu Nov 14, 2013 12:03 am

cvoinescu wrote:GRBL 0.8c has direct support for limit switches on all three axes, and a separate emergency stop input. You don't need to wire them together, and they're more useful wired separately (because the limit switches can then be used for homing too).

GRBL expects the pin to be pulled low when the limit is reached or the e-stop is pressed, and supplies weak pull-up resistors for that. For the limit switches, there are two strategies:
1. Normally open (NO) switches: wire the two limit switches on each axis in parallel, between GND and the respective input pin (D9 for X, D10 for Y, D11 for Z). Add an optional pull-up resistor (around 1 Kohm) to VCC for each pin.
2. Normally closed (NC) switches: wire the two limit switches on each axis in series, between VCC and the respective input pin. Add a pull-down resistor (required, around 1 Kohm) to GND for each pin. This method has better noise immunity and practically eliminates false limit switch triggering. If you're a purist, you'll want to recompile GRBL with the internal weak pull-ups disabled, but it works just fine even with them enabled too.

Usually, emergency stop buttons have two sections, one NO and one NC. Wire the V+ motor supply through the NC section (so that pressing the switch cuts power to the motors), and wire the NO section between the e-stop input pin (A2, if I recall correctly -- do check the GRBL wiring diagram) and GND. To avoid false triggering in a noisy environment, a pull-up to VCC is a good idea (1 Kohm or so).
When connecting the NO section between the e stop input pin (which I found to be A0) to I connect the pin to the NO stop button input and then the stop button NO output to the ground on the motor shield? (Not the ground of the power supply correct? Thanks.
Phil

Update: When I connected the NC part of the emergency stop to the power supply V+ , and I haven't connected the NO part to the A0 pin or ground, it worked fine to cut power to my system. Is there a benefit software wise with having the Emergency stop button trigger the abort pin as well?
Last edited by philmurp on Thu Nov 14, 2013 1:06 am, edited 1 time in total.

cvoinescu
Posts: 4442
Joined: Thu Jul 19, 2012 6:50 pm
Location: Camberley, UK
Contact:

Re: Operate a Pneumatic air cylinder for Z-Axis movement

Post by cvoinescu » Thu Nov 14, 2013 12:46 am

Yes, we're talking signal ground here, so the GND pins of the Arduino are the best choice. It's best to keep the power and signal separate -- the shield connects the power and signal ground together, but let that be the only connection.
Proud owner of ShapeOko #709, eShapeOko #0, and of store.amberspyglass.co.uk

philmurp
Posts: 42
Joined: Sat Oct 12, 2013 5:26 pm

Re: Operate a Pneumatic air cylinder for Z-Axis movement

Post by philmurp » Thu Nov 14, 2013 1:09 am

cvoinescu wrote:Yes, we're talking signal ground here, so the GND pins of the Arduino are the best choice. It's best to keep the power and signal separate -- the shield connects the power and signal ground together, but let that be the only connection.

I am not sure if you saw my update, I was writing it as you responded :). I will definitely wire the other end of the emergency stop (NO) right now.

However for my curiosity: Update: When I connected the NC part of the emergency stop to the power supply V+ , and I haven't connected the NO part to the A0 pin or ground, it worked fine to cut power to my system. Is there a benefit software wise with having the Emergency stop button trigger the abort pin as well?

Thanks!

cvoinescu
Posts: 4442
Joined: Thu Jul 19, 2012 6:50 pm
Location: Camberley, UK
Contact:

Re: Operate a Pneumatic air cylinder for Z-Axis movement

Post by cvoinescu » Thu Nov 14, 2013 11:18 am

Two benefits. It's a belt-and-braces approach: what if the contacts in the NC section weld together, or the section breaks and falls off the body of the switch, so that pressing the e-stop does not break circuit? The other benefit is that the host software will know about you pressing the e-stop (at least in theory) -- if you just cut the motor power supply, the controller and the host software have no idea and keep going.
Proud owner of ShapeOko #709, eShapeOko #0, and of store.amberspyglass.co.uk

philmurp
Posts: 42
Joined: Sat Oct 12, 2013 5:26 pm

Re: Operate a Pneumatic air cylinder for Z-Axis movement

Post by philmurp » Thu Nov 14, 2013 4:46 pm

cvoinescu wrote:Two benefits. It's a belt-and-braces approach: what if the contacts in the NC section weld together, or the section breaks and falls off the body of the switch, so that pressing the e-stop does not break circuit? The other benefit is that the host software will know about you pressing the e-stop (at least in theory) -- if you just cut the motor power supply, the controller and the host software have no idea and keep going.
I am wiring my limit switches NO between D9 and Gnd. However I am not getting a response. Do I need to also hook it to the power supply or something like that? I would like to get these limit switches working because I plan on using them for a homing sequence as well.

Thanks!

cvoinescu
Posts: 4442
Joined: Thu Jul 19, 2012 6:50 pm
Location: Camberley, UK
Contact:

Re: Operate a Pneumatic air cylinder for Z-Axis movement

Post by cvoinescu » Thu Nov 14, 2013 4:50 pm

That's correct, and should work. D9 is the X limit switch. Have you enabled the limits in GRBL? I believe it's $16.
Proud owner of ShapeOko #709, eShapeOko #0, and of store.amberspyglass.co.uk

Post Reply