PDA

View Full Version : Wiring home and limit switches



Lee Roberts
18-12-2008, 08:27 PM
Wiring limits and home switches can be handled in a multitude of ways.
But first you need to know what software you plan to use before deciding on a method. Typically limit switches have both normally open contacts (NO) and normally closed (NC) contacts. Depending on how you want to wire you can wire them in series or parallel with other switches.

http://www.mycncuk.com/images/dump/limits/Limitswitch.png

http://www.mycncuk.com/images/dump/limits/Nop.png

http://www.mycncuk.com/images/dump/limits/NCS.png

For example, CNCpro utilizes one input pin for each axis. Commonly that one input pin is wired to two fixed switches, one for home and the other for limit. It could also be used with one switch that moves with the axis and either via ramps or mechanical triggers actuates at the travel ends. Home is defined by the software setup as to which direction the axis is traveling when the switch activates. When using stepper motors, there typically isn't a need for more than two switches per axis. Servo's on the other hand, may need two dedicated limit switches to protect from a open loop failure causing a run away servo.

MACH3 software is very versatile and can be configured in many different ways. A common way is to have a seperate home switch for each axis, and one pin to all of the limit switches wired in series utilizing the normally closed contacts.

Below is two methods of wiring limit, home and kill switches. By utilizing a series wiring of normally closed limit switches, when one switch opens it sends a signal to the computer to stop issuing step pulses to the axis drive motors. In parallel, you have to use normally open switches to sense a switch activation. The top drawing utilizes independent normally closed switches for a home for each of 3 axis and is more compatible with MACH3. The bottom is another method to do home switches.

Utilizing normally closed switches is more noise immune, and thus reduces the risk of false switch actuation. The other noise benefit from utilizing NC contacts is coupling noise back into circuits and wiring for step/direction motor controllers.

http://www.mycncuk.com/images/dump/limits/Switch_wiring_3.png

http://www.mycncuk.com/images/dump/limits/Switch_wiring_2.png

m.marino
21-01-2009, 12:14 PM
Lee,

I am using as stated in other posts here a Stepperworld which has the ability to add switches to it on the board. I am having problems uploaing the image and will try later. The switched are labeled S4 through S6 plus ground and was wondering what would be the best way of setting up a circuit board to complement Mach3 with that set up to be able to set either boarder switches or zero points.

Thanks ahead and will try again to load the file. Does the system prefer .GIF or JPEG for uploads? As I reduced it with GIMP to 800x600 and saved it as such but it is still seeing it at the larger file size even though the file is coming from a different saved point in the drives.

Michael

Lee Roberts
21-01-2009, 08:03 PM
Whats the file size ?

m.marino
22-01-2009, 04:12 PM
Whats the file size ?

16.8KB is that to big?? most file groups take half a Meg last I knew??:confused:

Michael

Lee Roberts
22-01-2009, 07:38 PM
Yea the file size is set to 500k, see here: Click Me... (http://www.mycncuk.com/forums/showthread.php?t=501)

HUKBMBEAR
26-09-2010, 08:17 PM
Hello Lee - I have just seen your wiring diagram and thought you might have a view on the following

I have just started getting the equipment together to add limit/home switches to my machine, and have found the following diagrams
31433144

The first has three wires running to all switches while the second has a serial connection to the switches which includes the emergency cutout. I can see how the second works , but am unable to see why the first has the three wires. - The connection board is the same as shown :

3145

Are you able to comment on this set up and how it compares with your diagram

Would apprcieate anything you have to say

Thanks

Ken

irving2008
26-09-2010, 10:19 PM
The reason is that the inputs to the board have to be switched between 0v and +5v. generally the inputs are pulled up to +5v by a resistor on the board and the switches then short the input to ground. An alternative approach is to use both poles of the switch to switch the input line between a 0v wire and a +5v wire. This is how the home switches in the first diagram are wired, as individual inputs. But the same approach is used for the limit switches in the lower part of the diagram and this is just wrong... in fact the way that is wired when one limit switch is activated it puts a short from 0v to +5v, which will probably have the effect of stopping everything but for the wrong reasons.... I would ignore that and go for the single chain of switches. However I would seperate the PANIC switch from the limit switches. A panic switch should always control a relay which supplies power to the motors. That relay MAY have a contact that does the panic input to the breakout board and thence to MACH3 as per these diagrams... one should NEVER rely on MACH3 to stop the motors in an emergency, the panic switch should always act directly...

HUKBMBEAR
27-09-2010, 08:31 PM
Thanks Irving - I di think that the kill switch in series with the limits looked funny - effectivley actinas another limit switch and relying on the catches in the switch to keep the power off (dangerous if it failed.) so the second diagram (without the kill switch at present is the next step) - going by the other suggestions in this thread I should use NC contacts. The Home switches look like they are using separate connections with the board numbers mimicing the port outputs.

For the kill switch - would I be OK fitting that to the mains side as a breaker to cut all power to the controller and motors and leave the PC on.

Thanks

irving2008
27-09-2010, 09:22 PM
Yes the normal arrangement is to use a contactor with a low voltage (under 50v, typically 12 or 24) relay coil. The contactor is normally open, and you close it manually which energises a small transformer which provides power to the contactor coil via the kill switch, thus holding the contactor closed. Hitting the kill switch interrupts the power to the coil causing the contactor to drop out. This arrangement prevents it being re-energised accidentally in the event of a power failure. You have to manually close the contactor and it wont stay closed unless the power is on.

Another, cheaper, arrangement uses a 10A 240v NO relay (4 contacts) with a 12v coil and a low voltage transformer as used for lighting. This requires a start switch to energise the coil which is then held energised by the relay via the kill switch.

HUKBMBEAR
27-09-2010, 10:00 PM
Thanks Irving for all the advice its been a great help in clearing this up - just have to put it to work now

Cheers Ken

Colin Barron
28-09-2010, 06:59 PM
The reason is that the inputs to the board have to be switched between 0v and +5v. generally the inputs are pulled up to +5v by a resistor on the board and the switches then short the input to ground. An alternative approach is to use both poles of the switch to switch the input line between a 0v wire and a +5v wire. This is how the home switches in the first diagram are wired, as individual inputs. But the same approach is used for the limit switches in the lower part of the diagram and this is just wrong... in fact the way that is wired when one limit switch is activated it puts a short from 0v to +5v, which will probably have the effect of stopping everything but for the wrong reasons.... I would ignore that and go for the single chain of switches. However I would seperate the PANIC switch from the limit switches. A panic switch should always control a relay which supplies power to the motors. That relay MAY have a contact that does the panic input to the breakout board and thence to MACH3 as per these diagrams... one should NEVER rely on MACH3 to stop the motors in an emergency, the panic switch should always act directly...

It is interesting what hitting the Emergency stop will do, if too heavy a cut is going to damage the spindle then killing power would probably be ok, but if someone has a hand trapped then that is not the best option.

I worked on japanese grinding machines where all end of travel prox switches and the emergency stops were wired into the omron c500 machine controller. If the emergency stop button was pressed, the spindle would turn off, the table would retract in case someone was trapped, then power would go off turning off hydraulics and all power.

Danielroyal25
06-07-2013, 12:37 AM
Hi guys, I'm working on the control panel for my cnc 4 axis router (2nd x axis to be slaved). I will be running a 24v safety system and within this will be 2x e-stops, limits and home switches.
When triggered the 24v system will cut power to the 70v supply to the steppers but I'm confused how the triggering item I.e. e-stop will communicate to the bob to show Mach 3 what has caused the stop if wired in series as surely any item within the parallel wiring loop could be seen as the cause? Or is this the case, Mach just sees a fault and its down to the operator to find the cause?
Are relays typically used from the 24v system to send the control signal to the 5v break out board inputs?
I am working on a diagram for my system which could do with being looked over by someone that knows what they are talking about, should have this posted mid next week if you could comment. I have seen loads of diagrams of set ups but want to draw one for my system to get it clear in my head as this side of it is not my strong point. Cheers.

JAZZCNC
06-07-2013, 03:23 AM
Hi Dan,

The way it's done is to series wire the E-stop and limits thru the 24V coil (coil not contact) of a relay. Then take the +5V signal from the BOB and run thru the contact of same relay and back to -5V on BOB.
This then informs Mach an Estop has happened so stop the G-code from running.
Inside mach you just set inputs up to watch same pin for both e-stop and limits. This does mean fault LED's in Mach will show both E-stop and limits tripped at same time. If you want to know which individual switch tripped then only way round this is to use an input for each switch. Has you can see this will need many inputs which you don't have and In practice this doesn't matter much has you'll know what's caused it.

The other contacts of the relay can then be used to either control other relays or directly turn something off IE: 70V supply.

Home switches shouldn't be run thru relays has the delay is too long and makes them inaccurate. Just use the 5V signal from bob for relays has your only using it when homing so very rarely do they get affected by noise etc so ok to do so.
They can also be wired in series and just use 1 input has Mach only homes one Axis at a time and actually doesn't care where the switch is pressed because it just records the coordinates for the Axis it's referencing at the time when it see's the input trigger then does the same again for next Axis when sees input trigger again.
In theory and practice when wired in series you can set the home position for X axis by pressing Z or Y axis switch because it just records the position it's at for Axis it's referencing when input fires.

Note If your using 2 motors slaved to an axis then you must have each motor on separate inputs. One can be wired in series with other axis but the other must be on it's own separate input. If not then Mach can't individually home each motor for squaring gantry.

Danielroyal25
07-07-2013, 12:03 PM
Cheers Dean! That's a big help.

I don't know if this should be posted in another section really, but its all related.

When switching off the 70v supply should it be switch before or after the transformer or does this not matter?

Do many people have an input to the 24v system from the pc incase the computer crashes / turns off for some reason acting as an e-stop or would the code just stop running the anyway not harming the machine?

So that the drain resistor isn't constantly connected during the 70v supply is it connected via a relay so that when power is removed the resistor is engaged to drain the motor supply system?

JAZZCNC
07-07-2013, 02:24 PM
When switching off the 70v supply should it be switch before or after the transformer or does this not matter?

It's arguable but you could break circuit after transformer but me personally for safety sake then I want power killed. Same goes with VFD.? you could just send a stop signal to vfd but again for safety sake just kill power to vfd.
It's like with the drives you could just kill the enable signal and keep the drives powered but that's not safe enough for me and I want the machine off line full stop.
This is why you have a master relay.? One relay controls all other relays and if the other relays which are controlled by limits, E-stop,Door,coolant switches etc are not safe or ready then master relay won't allow a reset.


Do many people have an input to the 24v system from the pc incase the computer crashes / turns off for some reason acting as an e-stop or would the code just stop running the anyway not harming the machine?

Well that's the job of a charge pump feature if BOB has it, usually from pin1. Charge pump monitors pin 1 and if it doesn't see a signal shuts down it's outputs etc. Not full safety but enough to E-stop the system if PC crashes which then if designed correctly should shut down the master relay which kills power to every thing else and not allow restart.



So that the drain resistor isn't constantly connected during the 70v supply is it connected via a relay so that when power is removed the resistor is engaged to drain the motor supply system?

Yes exactly just use a NC contact so when working it's disengaged from circuit and put back in to drain caps when off.

Danielroyal25
13-07-2013, 07:22 PM
If I use separate home switches for x,y,z & x2 linked directly to the bob and then have my individual limit switches + and - for x,y & z linked via the 24v circuit, where are the home switches to be positioned?
Originally I was going to use the home switches to act as limits on one end and have limit switches on the other but if I go for the setup above I'm confused as to where the homes should be placed.

JAZZCNC
14-07-2013, 09:23 PM
If I use separate home switches for x,y,z & x2 linked directly to the bob

Ok first Not sure what your meaning here Dan with x2.? You only have 1 home switch per axis.


then have my individual limit switches + and - for x,y & z linked via the 24v circuit, where are the home switches to be positioned?
Originally I was going to use the home switches to act as limits on one end and have limit switches on the other but if I go for the setup above I'm confused as to where the homes should be placed.

Ok well if using Micro switch type then you still have the LIMIT switches at the ends, so 2 switches per axis.
The home switches are normally positioned just before the limit switches and so they home to a corner or end you would like to designate Zero position in Machine coordinates. That said they can be positioned anywhere you like really.!!
Personally I set my machines up so they home to corner then all my moves are always positive in machine coordinates. Mach is then setup to always home negative, this way it can't ever home in the wrong direction.

Now to answer the question of how do you put a home switch before limit switch.? It's easy really.!! . . . . You position The switch so gets triggered by a ride over Ramp not a hard stop. The ramp allows the switch to ride over while cutting and still have access to Limit switches at the ends. (Thou better other way round so static switch with mobile ramp triggering.!)
Home switch inputs are only watched or checked while homing so when it rides over the ramp it triggers, rest of time it's ignored.
This does mean the Home switches need an input of there own, they can still be wired in series but separate input to limits.

This is the reason why you can use Limit switches has home switches if sharing the same input or switch because the opposite is true while homing.!. . Limit's are ignored.
So if set to do this Mach treats the input differently while homing and instead of seeing the switch trigger and setting E-stop condition it now sets the current position has Zero Machine coordinate and resets Axis DRO's to zero.

Really micro switch type switches are not the best for Home switches unless very high quality due to them not being very repeatable. MS are fine for limits has they just work has ON/OFF triggers.
Inductive proximity switches or hall affect switches are better being much more accurate/repeatable and with contact less operation so they work without ramps etc.

Hope this helps clear it bit more.!

Danielroyal25
14-07-2013, 10:16 PM
awesome, cheers Dean. That's what i was unsure of during normal operation the home switch being hit / operated, but that clears it up.
With X2 i just meant the home switch on the slaved X axis to get the gantry square (4 switches in total).
I have some Omron micro switches for the limits and Honeywell switches for the homes. Cheers!

cropwell
15-07-2013, 08:15 AM
I got a bit annoyed with my machine stripping the delrin on the Z axis, so I decided to put limit switches on it. At the same time I put a couple of extra home switches to give home and limits on X++, X--, Y++, Y-- and Z++. While I was about it I put in status LED's (C'mon it's my toy :thumsup:)

The Limits had to go on a second BoB that I had that worked on 5v, so I basically OR'd each module to operate a reed relay, to give a Ground signal to indicate a limit switch had been triggered.

My main control board worked on 12v for the inductive prox switches and again each axis was OR dioded on the extra inputs for the X and Y axis's.

The only stupidity was the Override to kill the limit signal was a push to break switch. This means I have to hold it pressed while I reset Mach3 and keep it pressed while I jog off the limit. I am changing this to a SPDT switch which puts power onto a buzzer when the override is on. I know it is overkill but hey - I have retired and I need all the excuses I can find to stop other people finding me jobs.

OK - If anybody wants more detail I am happy to provide it, but right now I have to go and clean up in the Kitchen :worked_till_5am:

9277

Danielroyal25
01-12-2013, 09:47 PM
I'm just about to order my cy cable for the limit switches. If using a multi core cable I.e 4 core, is only one single core used to physically wire the switches together and the other cables are left unconnected?
Is the minimum 2 core cable that you can get?

EddyCurrent
01-12-2013, 10:16 PM
You don't need to use CY cable for your limits assuming it's a 24v circuit. I would use twin cable and bring them back to a junction box where you can series them up. If later on you want to change how they are connected then you won't need to rewire them, just change how they are connected in the junction box. The limits circuit is low current and low voltage so I plan to use twisted pair CAT5 cable, because it's twisted it is effective at screening out noise.

cropwell
02-12-2013, 11:19 AM
My only caution is that CAT5 cable tends to be single core and that would not be suitable for constant flexing. You would have to use the type suitable for patch cables. I wish I had thought of it, I have an oudle of it (15+ metres) and I bought cable from BRIMAL (Welcome to Brimal Components (http://www.brimal.co.uk)) They have a good range of interesting bits at keen prices.

Danielroyal25
08-12-2013, 09:03 PM
Thanks guys. Just another stupid question: as the x axis is slaved do I only need limits on one side only or both. I have homes on both to ensure the gantry is squared.

JAZZCNC
08-12-2013, 09:11 PM
Thanks guys. Just another stupid question: as the x axis is slaved do I only need limits on one side only or both. I have homes on both to ensure the gantry is squared.

Just one Side Dan. Think about having the Switch travel on the gantry with Triggers at each end to save on wiring and switches.