i/o shield for limit switches, user buttons and controls

Talk about all things CNC
fjohn624
Posts: 30
Joined: Thu Jan 30, 2014 12:51 am

i/o shield for limit switches, user buttons and controls

Post by fjohn624 » Sat Mar 22, 2014 9:50 pm

So I made a first attempt at an i/o board for connecting limit switches, cycle start, feed hold and reset buttons as well as spindle control output. All of those functions are built into grbl but I wanted an easy and reliable interface. This started when I was getting false limit switch trips from the router or shop vac turning on and off. Shielded cables and an RC filter fixed most of it but I still got the occasional nuisance trip. A couple of ferrite chokes on the AC lines finally made that a thing of the past. The problem was my RC filter circuit board was pretty ugly.

I quickly made a circuit in eagle which optically isolated the limit switches and set them up to run off the 24v power supply for the stepper motor drivers. This gave me a higher voltage current driven circuit to prevent trips for noise. I then added inputs for the cycle start/resume, feed hold and reset buttons. There are two outputs for the spindle control functions which supply a 5V output that I will use to drive a solid state relay for controlling the router and the shop vac. The board mounts between the arduino and the stepper driver board.
Attachments
board 3.jpg
board 3.jpg (74.09 KiB) Viewed 5314 times
junk fixture.jpg
fixture i made to hold the blanks
junk fixture.jpg (57.04 KiB) Viewed 5314 times
board complete.jpg
completed and ready to drop in
board complete.jpg (66.67 KiB) Viewed 5314 times

fjohn624
Posts: 30
Joined: Thu Jan 30, 2014 12:51 am

Re: i/o shield for limit switches, user buttons and controls

Post by fjohn624 » Sat Mar 22, 2014 9:51 pm

a few more photos
Attachments
buttons.jpg
buttons.jpg (63.74 KiB) Viewed 5316 times
board 2.jpg
board 2.jpg (58.25 KiB) Viewed 5316 times
board 1.jpg
board 1.jpg (89.1 KiB) Viewed 5316 times

fjohn624
Posts: 30
Joined: Thu Jan 30, 2014 12:51 am

Re: i/o shield for limit switches, user buttons and controls

Post by fjohn624 » Sat Mar 22, 2014 9:56 pm

this file has all the eagle files as well as my g-code if anyone is interested in trying to duplicate the results. I will probably make a better version of this board in the future. This was done entirely with pieces I had left over from other projects. I think I might sit down and design a purpose built board using better components in the future. Maybe at that point I could make it a kit and get professionally printed boards as part of a group buy or something.
Attachments
grbl board.zip
(438.97 KiB) Downloaded 248 times

jjubenv
Posts: 46
Joined: Thu Dec 12, 2013 6:42 pm
Location: Ontario, Canada

Re: i/o shield for limit switches, user buttons and controls

Post by jjubenv » Sun Mar 23, 2014 2:45 pm

Since the board mounts between the Arduino and the GBRLshield, does that mean you cannot see your LED's when they light up?

fjohn624
Posts: 30
Joined: Thu Jan 30, 2014 12:51 am

Re: i/o shield for limit switches, user buttons and controls

Post by fjohn624 » Sun Mar 23, 2014 3:39 pm

You can still see them but you have to look through the gap between the boards. They only light when a switch is tripped so its not something you constantly need to look at. But it is useful for diagnosing issues with switches, especially if you were to use a PNP style switch which could give an output when it fails.

Alternatively you could run it on top of the grbl shield but then you would have to consider cooling the drivers better and you wouldn't see all the leds on that board as easily.

fjohn624
Posts: 30
Joined: Thu Jan 30, 2014 12:51 am

Re: i/o shield for limit switches, user buttons and controls

Post by fjohn624 » Wed Sep 17, 2014 2:16 am

So slight update... okay a pretty major update

I have been working on the board and there is a printed prototype. I won't go into too much detail about it. It is basically the same circuit I made earlier only now there is a coolant enable output as well.
An M3 turns the spindle output on, a 5V signal goes out to a solid state relay where it switches 120VAC on to an outlet which turns the spindle on.... for now. At some point I am going to do a better spindle and at that point the M4 output could also be used to tell a spindle controller to turn on but in reverse. Right now that output is on the board but isn't hooked up to anything. An M5 of course turns it off.

The coolant output switches another SSR which I use to power the vacuum. This isn't really necessary but it is nice to have a delay between turning the vacuum on and the router on.
ie:
"M3; (spindle on)
G4P2; (2 second delay)
M8; (vacuum/coolant on)"

While this whole thing is really simple, it can be adapted to run a DC solid state relay in the case of a quiet cut spindle. Additionally the inputs for feed hold and cycle start/resume are still connected to this new board. The limit switch inputs work so well I was actually using them without shielded cable for a little while without issue.
Attachments
IMG_3334.JPG
IMG_3334.JPG (133.04 KiB) Viewed 4756 times
IMG_4158.JPG
IMG_4158.JPG (107.18 KiB) Viewed 4756 times
IMG_4159.JPG
IMG_4159.JPG (130.01 KiB) Viewed 4756 times

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

Re: i/o shield for limit switches, user buttons and controls

Post by cvoinescu » Wed Sep 17, 2014 8:50 am

Does this use the new GRBL 0.9 pin assignment that permits spindle PWM (spindle enable on D11, direction on D13; limit switch inputs on D9 for X, D10 for Y, D12 for Z), or the old pinout? Have you considered adding a jumper block to permit both? A 4-pin (2 x 2) header would do the trick.
Proud owner of ShapeOko #709, eShapeOko #0, and of store.amberspyglass.co.uk

fjohn624
Posts: 30
Joined: Thu Jan 30, 2014 12:51 am

Re: i/o shield for limit switches, user buttons and controls

Post by fjohn624 » Wed Sep 17, 2014 10:58 am

It's using the old configuration still. I made it before the new layout was released. If I make more in the future I plan to enable the probe input and yes I can do some jumpers for pin swapping as well.

scott216
Posts: 228
Joined: Thu Oct 10, 2013 12:35 pm
Location: New Jersey

Re: i/o shield for limit switches, user buttons and controls

Post by scott216 » Wed Sep 17, 2014 11:48 am

It looks like your new board was manufactured by a PCB house verses home made. Where did you have it made? Can you share the updated eagle files?
Shapeoko v2 with DW660
GRBL v0.9i
Location: New Jersey

McOtis
Posts: 80
Joined: Sun Feb 09, 2014 12:21 am
Location: Maryland

Re: i/o shield for limit switches, user buttons and controls

Post by McOtis » Wed Sep 17, 2014 1:27 pm

This looks great.
One of the reason's I was looking at upgrading to the tinyG board was for the convenience of the extra IO you get.
And I was having the same electrical noise problems with my limit switches etc...
This may be a good stopgap for a while; plus I can make (or order) the board easily.
Again, please share the updated eagle files.

Regarding the PCB itself, below is a guess:
The board looks like an OSHPark board; purple is their signature look.
https://www.oshpark.com/ - $5 a square inch - you get three boards made.
That board probably costs about $35, but you get 3 - so about $11 each.

Post Reply