PDA

View Full Version : Limit switches PCB schematic verification.



cncnoob
27-01-2013, 12:50 AM
Hi guys.

Would it be possible for some one to have a look at this schematic for limit/home input PCB that I was looking to build?
[Please see attached..]
8036

I'm sure I've either missed some stuff or maybe just done something plain and simply wrong.

Just wanted confirmation that this should work before I plug it all in..

I have a my control unit plugged in to the original port on my PC, so thought I would buy a PCI card and wire this to the second.

The 5v supply will be provided by a wall adapter.

All switches will be NC. Thinking of making a probe, and a few other input devices, probably wont use all connections to start, but want the option to do more later on one board.

Thanks in advance for any feedback, I will appreciate it!

Jonathan
27-01-2013, 11:22 AM
You've essentially connected the limit switches directly to the port with 10k pull-up resistors. In an ideal world this would be fine, however in reality there are a couple of problems. The main one is thatxthis set-up is very susceptible to electromagnetic interference, since the voltage/current through the switches is so low. The other potential problem is there is no isolation between the parallel port and the computer, so if something went wrong with the +5V PSU, then the parallel port would be damaged. Ideally you should run the switches on a 24V circuit and to do this you need to buffer the inputs anyway, so that's how you get isolation. If you search on google for parallel port breakout board schematics you'll find plenty of ways to do it.

cncnoob
27-01-2013, 03:37 PM
You've essentially connected the limit switches directly to the port with 10k pull-up resistors. In an ideal world this would be fine, however in reality there are a couple of problems. The main one is thatxthis set-up is very susceptible to electromagnetic interference, since the voltage/current through the switches is so low. The other potential problem is there is no isolation between the parallel port and the computer, so if something went wrong with the +5V PSU, then the parallel port would be damaged. Ideally you should run the switches on a 24V circuit and to do this you need to buffer the inputs anyway, so that's how you get isolation. If you search on google for parallel port breakout board schematics you'll find plenty of ways to do it.



Awesome, thanks for getting back to me quickly!

I'll have a look and redesign this and put the new one up, if you could have another look that would be great!

cropwell
27-01-2013, 04:59 PM
Opto Breakout (http://www.embeddedtronics.com/opto.html)

Here's a design for an opto-isloated BOB. Any comments from the team ?

Rob

cncnoob
27-01-2013, 05:05 PM
That looks good!

I am little confused however as Jonathan has put that I require 24v..

So would I run the 24v through the micros and then step down to 5v through the Optos?

Also I'm looking to build a board that will max out the inputs to the PP..
I have found a lot of them have drivers also/bi dir, but I am looking to DIY an input system that will handle as many inputs as physically possible.

I have found this PP as a secondary, before I go ahead and but it, is this suitable?

http://www.kenable.co.uk/product_info.php?products_id=1683

(Am I right in saying I am looking for an ECP/EPP compatible card?)

m_c
27-01-2013, 06:11 PM
5V signals can be susceptible to noise as Jonathan says, however provided you're sensible and don't do stupid things like run the signal cables next to power cables, most people don't have any issues.

If you're using Mach, and looking for lots of inputs for non-critical stuff i.e. buttons to make things happen where a slight delay isn't likely to cause disaster, I'd look at getting a PoKeys - POKEYS IO DEVICES (http://www.poscope.com/pokeys-io-devices.html)
Things like limit and home switches are critical, and have to be directly connected to the controller to get reliable operation.

cropwell
27-01-2013, 06:36 PM
Eclipse Computers in Coventry do a 2 parallel printer PCI card for £6.95
BUT
Although I have not had any problems with them, they have a terrible reputation for customer service (Google them !).
I used one of these cards, but it needs setting up properly. (I am going thru a Senior Moment phase 'cos I can't remember what I had to do).

Anyway, that card is a Netmos 9815. It is still in the computer but drives LPT2 and LPT3 and I have plans for putting in a second BOB to do limit switches or move some functions to that BOB and do the limit switches on the main BOB (which has 12v as I am using inductive switches).

Having said that, I now have a Motherboard with an onboard Parallel Port and this connector may be all you need Shiny Hardware Limited (http://www.shinyhardware.co.uk/prods/showprod.asp?pid=1720)
They also do a PCI parallel port card.
Shiny Hardware Limited (http://www.shinyhardware.co.uk/prods/showprod.asp?pid=15516)

Anyway, it is time for my medication now and the nurse says I have to put the computer away:apthy:

Cheers,

Rob

C_Bubba
27-01-2013, 06:43 PM
You also indicate that you want to maximize your I/O capability and you have indicated all the switches are NC so why not put some or all of them in series? If you put all of them in series, you will use only one pin. I would also heed Jonathan's advice on level shifting as it will reduce potential noise problems.
Just my thoughts.

JAZZCNC
27-01-2013, 08:28 PM
Why do you need so many switch's.? . . . Is this for a special purpose or just standard CMC machine operation.?

Unless your you plan on things like autotool changers or controlling many external devices then one PP is often enough by running limits and E-stop in series. After that then I'd look to the Pokeys device has it offers a cheap and simple why of doing it with massive amounts of inputs.

Personally I only use 24V thru all my Limits and E-stop system to eliminate any chance of noise issues causing false triggers. This is done thru relays or dedicated safety relay which shut things down at source or kills power in a controlled manner with the 5V signal from PC just used to inform control software an E-stop has occurred.

cncnoob
29-01-2013, 02:30 AM
Hi everyone.

Ok. Quickly to reply to a couple posts..

8069

To Jonathan. I've changed my design a little to incorporate 24v [Please see attached].
I've been playing around in simulation with this, but when the switch goes LOW I'm still left with some residual voltage, will this still damage my card? I certainly don't want to risk blowing my card, or even worse my system!
I'm not entirely sure I have the right values here either, just used trial and error until I ended up with a stable circuit..
(I'm no electronics guru as you can probably tell!)

I am still getting roughly 800mV on the PP pin.. Will this be a problem, is there another way I can do this so I get an absolute 0v here?


Also missing caps etc here, any suggestions on values/configs?



To cropwell. I tried to insert a 3k on the 5v line, but the sim just plain didn't like it, (as the schematic in your link). It kept blowing out the opto..
In terms of PP PCI card, I have used these guys before, so know they are consistent. I don't mind paying a little more for something, if I know it will turn up, work and I don't have to worry about returns etc. But thank you for the thought, it's always good to know there are places that do hardware that cheap!
I'm still not sure if the one I posted up is suitable?! Could someone please kindly confirm this?



To MC. The POKEYS looks interesting, am I right in saying that this is a straight up micro controller? If I ran the opto from the return of the 24v to this and programmed a controller, would that mean I could run the 5v straight in to the PP card input, or would I still need to add a load between the micro and the input pin?
The reason I ask is that I have been recently working with 8/32bit micro controllers, but am a little unsure when it comes to PC hardware electronics. For example, I would know how to send serial via USB, but then wouldn't know how to get Mach3 to interpret it as a function.
But then maybe I would be complicating things if I went this route.
Unless I went the voltage to PP route, reading from the micro controller input?
I need more info on this, so will have another look around for more info also..




To C_Bubba. Totally understand the reasoning behind having everything in series.. But, I'm kind of looking to keep everything separate for expanding, chopping and changing later on.
Also I would like to use the full 9 limit functions in Mach 3 (IE ++X, --X, ++Y, --Y etc). I have got this right, they are the limits per axis? Or am I missing something else here too..
I can't plug in to my current controller with out voiding the warranty, this is why I'm going the DIY route. It'll be cheaper, more flexible and having a dedicated board for limits means I get to use more inputs instead of just using one input for everything.
I am new to this all, so please excuse me if I'm missing the obvious, I'm just experimenting and want to give this a go. Hopefully it'll pay off, and then I can look in to building my own fully fledged controller one day.. (Fingers crossed!)




To JAZZCNC. May be putting in some digi probes, tool changing, secondary homing etc at a later date, if I'm going to make this thing instead of buying one, I need all the help I can get! :biggrin:
(From the controller, and other people!)
Or maybe I just generally need help.. lol
I certainly would like to try this, and if it works I'll be happy that I have those options available for expansion later on, even if I don't actually ever use them.
Realistically I'm only looking for ten at the moment, 9 limits (3 of which are the homes) and 1 for a probe that I'm going to also DIY shortly (if/when I get this up and running safely..)






Thanks everyone for the feedback, hopefully I'll hear back from you soon so I can get this sorted and not have worry about hurting myself or my machine!

All the best!

cncnoob
30-01-2013, 04:52 PM
Any thoughts?

C_Bubba
30-01-2013, 06:01 PM
"Also I would like to use the full 9 limit functions in Mach 3 (IE ++X, --X, ++Y, --Y etc). I have got this right, they are the limits per axis? Or am I missing something else here too.."
Yes, ++X, --X, ++Y, --Y etc refers to possible axis limits. But you still can use just one of them and as long as Mach stops when a limit trips, that is all you really care?
I generally don't get involved in setting up Mach as I don't use it, so what I have to say may be off base. But, the idea of hard limit switches is for the "aw crap" moment. Now having said that, If you want to use all of the named I/o points in Mach, I "think" you can call out the same pin number that you used for the others. As I said, this is for the "aw crap" moment when you want the machine to stop before it does harm to itself. I don't know if Mach tells you which limit has operated or not, but usually a quick glance at the machine will tell you where you went out of bounds.
Hope I am making sense.

JAZZCNC
31-01-2013, 01:47 AM
Any thoughts?

Explain what your trying to achive and will look at it closer but from what I'm seeing your overly complicating something very simple.?

Regards limits it's very easy and common practice to just wire them NC in series and use 1 input. The E-stop can be included in the series has well.
While Mach provides individual inputs for ++X --X and E-stop etc it doesn't care and any one switch tripping E-stops the system. This is why they can be wired in series along with E-stop.
In Mach you just tell the E-stop and all limits to watch the same Pin.
The only functionality you loose is that Mach won't light up the Individual Limit LED in diagnostics and instead light all the limit LEDs has well as the E-stop LED. But like Bubba says you'll know which switch has tripped by the crash bang wallop.!!

Another thing you can do to save Inputs is use Limits has home switches. When working and cutting Mach see's the switches and treats them has limits E-stopping the machine if tripped but when it's homing it ignores the switches has limits and uses them to indicate home position.
It does this by moving one Axis at a time Starting with Z axis then Y axis then X axis. Each time it hits the switch it stops, backs off the switch then Zero's the machine coordinate DRO's then moves the next Axis and does the same. This is why they can be wired in series because each switch is tripped then backed off to reset. In reality push any of the switches and it will set the position for the axis MAch is homing.? By this I mean you could trick MACH to set the X axis Home position by pushing the Y or Z axis switch. MAch doesn't know or care which actual switch was pressed all it's knows is that Pin (what ever) has changed state and stops and does it thing for that Axis it was moving.

What you can't do with series wired Home switches is Home ALL AXIS at the same time in one go. But this is not standard procedure for MACh anyway and to do this in MACH requires the Home all AXis macro altering anyway.
So with just 1 input used you have E-stop, limits and Homing leaving 4 more spare inputs on you typical PP.
Personally I don't like using limits has home switches so sacrifice another input and just wire the Home switches in series.
I do this mainly because don't actually run or use Limit's and E-stop switches thru BOB inputs like you would with 5V inputs on BOB using software driven E-stop has it's not safe enough for me.
Instead use hard wired E-stop system and run them thru Relays with 24v thru them to eliminate noise and potential false e-stops etc, I just use or control the 5v PP/BOB signal, again thru relay contacts to tell the software E-stop has occured and stop the G-code.
All powered devices are stopped by relays breaking the circuits so it's very safe and controlled. Only when machines safe will the system be allowed to restart via a dedicated momentary Re-set button.
This does however mean I can't use Limits has homes and that's the main reason I use separate Home switches on it's own input. Thou another reason is the ability to move my homing positions to any place on the table and not at the very extremes where Limit switches are usually located.

So to recap you only need 1 input if you want too or 2 at worst whether you choose to use software driven or hard wired E-stop system. Leaving 3 inputs for probes etc.!!

cncnoob
31-01-2013, 06:34 PM
Thanks for getting back to me.


Good advice there!

OK, so, relays, check, 24v check, now going for two inputs (home+limit, makes sense!), one additional for now with the probe and both in respective series.


Still a little lost on the PP PCI card..

Is the one I posted earlier suitable?

(If so, I'll get it in straight away!)


Thanks in advance!

JAZZCNC
31-01-2013, 07:10 PM
Still a little lost on the PP PCI card..

Is the one I posted earlier suitable?

Honestly Can't say has never used one but I do know using PP PCI cards can be a bit of a lottery with Mach due to the way some work. If it just emulates a PP port but uses USB bus instead of the proper serial BUS which I think some do then believe they are the ones that can give trouble.? But again in all honesty I don't know enough to comment confidently.

Suggest you go to Mach forum and check out some posts has it's been discussed a few times on there I think.?

If your only running a small machine or Lathe then checkout the Pokeys 56U or E has this will solve you several problems in one go.?
It's a 25Khz motion controller with either USB(56U) or Ethernet(56E) connection and gives 55 X Digital inputs 7 X analog 6X PWM outputs upto 26 Encoder pairs along with loads of other options plus it's MODBUS TCP so can be expanded to hundreds of inputs etc.
These are great for building Custom control panels and make using buttons to control MAch features easy. The encoder options also make it very easy to add a MPG for hand control movement or building a hand held Pendent.

Check it out here. PoKeys56E (http://www.poscope.com/pokeys56e)

cncnoob
31-01-2013, 07:36 PM
I was really just looking to see if the PP was compatible in terms of ECP EPP etc? Not sure what comms Mach3 uses?!

Might have a look around some forums etc..


It looks like its a full PCI PP so I'm guessing it wont be an EMU..
Ma order it anyway as its so cheap, if it doesnt work at least I can return it ;D

cncnoob
25-02-2013, 04:27 AM
Hi guys.

Could someone please kindly check over my schematic to make sure I'm not making any obvious mistakes?

I plan to run 24v from a mains adapter, and the 5v/GND is running from the PP.

I decided to go for a good quality relay opposed to an opto simply because it makes more sense to me now to go this route.


Thanks in advance!


8290

m_c
25-02-2013, 07:25 PM
It maybe makes more sense to you, but an opto with a suitable resistor (and zener if you want some extra protection) is far simpler. You can also add a capacitor across the opto if you want a simple hardware debounce.

But anyway, why D2? If it's a solid state relay, then you don't get any surges, so it's not doing anything.
Shouldn't R6 be connected directly to ground for quicker switching?
Fair enough a large capacitor over the input, but 100uF for C2 seems a bit excessive.
In fact, shouldn't R6 be tied to gnd to provide the voltage divider along with R1 and R2 for Q1?


It all seems a bit over complicated to me.

cncnoob
25-02-2013, 09:28 PM
Thanks MC..

I was following a design for a relay originally which suggested the resistor R2 to be here..
It was originally for a realy, which I switched for an opto/SSR.

I've been working on this again today with a little help from another forum.

Not sure what value I should change up in terms of C2, any suggestions? I've changed it to a 50 for now..

This is the updated design (as of today..).



8293