Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: wil trower on March 21, 2008, 12:04:11 AM

Title: Home switches
Post by: wil trower on March 21, 2008, 12:04:11 AM
I am going to wire my home switches  normally closed in seares , 3 switches , pin 12, lpt ground. Will this work or should I go another way? I do not have +5v on my board. Is it best to us shielded 22ga wire for wiring home switches? Sure could use some advise here, I have burnt one board, Stepmasternc screwed me out of one, Paid and did not receive !! >:( If this wire is what I should be using, where is the best place to buy??
Title: Re: Home switches
Post by: jimpinder on March 21, 2008, 05:18:09 AM
You can wire home and limit switches either way.

You do not need a 5 volt supply. Inputs to your computer are pulled to 5 volts by internal resistors in any case.
You may start at one of the ground pins - 18 - 25, go to the first switch, go to the second switch, then the third switch and then to the computer input which you seem to say will be pin 12. (why 12 - what have you got on the others ?? - you may use 10,11,12,13 or 15).

If you wire the switches normally closed, then this will put a 0v on the input - which will be pulled to 5v when a switch is opened by the carriage. This method is preferred by some, because it means that if any wires come loose, then a fault will occur before your carriage hits the end of travel - but to Mach3 it does not matter,it will work either way.

In you Config/Ports and Pins - show all the homes (if you are doing them all) as Port 1, Pin12.  Do NOT tick "active low"

There is very little current in the circuit, so any thin wire will do - I use wire taken out of a an old 25 wire printer cable. It does not need to be shielded - but do not run it NEXT to stepper motor wires etc that have a lot of changing current. 


Title: Re: Home switches
Post by: wil trower on March 21, 2008, 01:27:55 PM
Thanks Jimpinder...for your reply, I will wire my home switches in this way as you say. just to confirm,

 Ground from 18to25 to Z switch jump to Y switch , jump to X switch, then +5v back to pin 12 or any Input pin, correct?

The reason for wiring switches normally closed , I read it on one of the threads, an it sounded like the safest ! At this point I haven't wired them yet so I can go eather way?

I am only doing XYZ Home, should I enable X++ X-- and so on?

I will use printer cable wire for the home switches, just wandering if you can use solid copper wire very small, or would it brake with the movement?

At this point I haven't used any of my inputs, just picked 12 at random . I need to hook up my charge pump , e-stop , and the spindle inputs, will need the rest for these? Thanks again for yory HELP.
Title: Re: Home switches
Post by: Hood on March 21, 2008, 03:21:11 PM
Yes you want to have all of the X, Y and Z options in Mach on Pin 12 including the Home switches, that way you dont need seperate homes.
 Personally I use shielded cables on anything that has 5V in it, the difference between Hi/Lo with 5v is small and any noise picked up can easily trigger them.
Hood
Title: Re: Home switches
Post by: jimpinder on March 21, 2008, 04:44:17 PM
You have the idea - but not quite right.

You do not need any 5v supply - this is provided internally by the computer on pin 12

A quick diagram is provided.

As Hood says - you can shield the cable if you require - you can use solid copper if you wish - there should not be any movement - fasten the switch to the frame of the  mill and let the carriage operate it.

Hood also says you can , when you configure the switches, have them act as limit switches as well. This would be a good idea, you dont want the carriage to go beyond the switches or they will be damaged.
Title: Re: Home switches
Post by: wil trower on March 21, 2008, 07:11:28 PM
I have the switches wired as you said, except i have them wired Z, X, Y, only ground wire to the end of the last one, and hot wire from there to pin 12. I am not getting 5v out of pin 12. I have checked pins 10,11,13,15, they have 5v.  Could I have blown pin 12 some how. As for the switches being solid to bed, they are loose on the screws. I will take care of that. When I shut down my machine I am getting ticking sound out of the charge pump, and it's not wired to the board yet. It sounds like a current pop maby. It also was tripping the switches with out hitting and said limit switch hit, maby  because there loose?  I'm trying guys stick with me!! :)
Title: Re: Home switches
Post by: wil trower on March 21, 2008, 09:31:42 PM
OK...the no +5v on pin12 in fixed, when I tested the port  for 5v i forgot to push the normally closed home switch, for -0v.  I now have shielded wire to put on the home switches tomorrow.

Next will be the spindle wiring on the board, would that be input 10,11,15,??  ground com. on board??  Does this sound right?
Title: Re: Home switches
Post by: jimpinder on March 22, 2008, 04:32:35 AM
Get the home switches done and configured.

What are you wanting to do with the spindle - do you mean an index counter to check the RPM - if so that can use any input wire and be configured the same way as the home switches.
Title: Re: Home switches
Post by: wil trower on March 22, 2008, 01:38:52 PM
Yes you are right..Getting a head of my self !!  Will make sure the switches all work before moving on. That's what i want , slap my hand if I get ahead of my self. ;)

I was going to transfer the rest of the wires from the old board , and just had 3 wires left from the Charge pump, one spindle wire input on old board and one wire charge pump on input pin, and a ground from charge pump on old board ? I will worry about these later !!
Title: Re: Home switches
Post by: wil trower on March 22, 2008, 09:09:31 PM
Have all 3 switches wired in series X-Y-Z , Gd to X switch then to Y switch then to Z switch and +5v to pin 12... enabled all limits and homes port 1, pin 12, Active low setting is RED Check... it says triped limit switch...All led's in Diagnostics are lit....I do not know what to do???  I used shielded wire grounded the shielding copper wire to the bed and have all switchees fastened solid to the bed...any ideas??
Title: Re: Home switches
Post by: Mcgyver on March 23, 2008, 04:56:12 AM
@wil tower,

Take your multimeter and confirm that all switches are connected in Normally Closed  position. The most limit switches have 3 connections, one common, 1 normally open and one normally closed. so confirm you have used the right pins on the limit switch. When you have connected the 3 limit switches in series check again on the 2 wires at the ends if they are normally closed. If you are sure about that connect everything to the parallel port.

In mach config/ports and pins you have to configure this:

Lets assume that your limit switches are mounted in the most positive side of each axis.....

x++....enabled..... port1......pin12.....active low(red cross).....emulated(red cross)
XHome...enabled...port1....pin12....active low(redcross)...emulated(redcross)
X--...enabled...port1...Pin12(doesnt matter what you put in here).....activelow(redcross..also doesnt matter)....emulated(GREEN CHECK)

The configuration as shown above you are using 1 switch for each axis, the switch is used for both homing and X++. the X-- switch is emulated, this way you can configure mach with software limits so you dont have to use 3 other switches for the lowest limit.

In the configuration shown above you have the option to wire a external e-stop button through to the limit switches.
If you use normally open switches you would have to need 3 inputs instead of one. most commenli used system in limit switches is the normally closed system.

If you are using a Breakout board with resistors on each input and with a voltage on one of the input pins you can hook up the stuff directly. If you want to connect it DIRECTLY to the parallel port try using 5V from your USB, hook up the Minus from the usb to gnd, connect the plus from the usb to first wire of your limit switches, the second wire of your limit switches to pin 12 through a 10Kohm resistor.


Good luck!
Title: Re: Home switches
Post by: jimpinder on March 23, 2008, 06:37:11 AM
Think about it !!!!

The diagnostics page shows whether the COMPUTER thinks the switches are ACTIVE or not.

You would appear to be quite correct with the setting for the limits and homes - all should show port 1 pin 12, and all should have the "active low" box with a red cross - in other words the switches are active on a high voltage. Your switches are showing on, because pin 12 is not detecting a 0v signal.

The fact they are all showing "active" when they should be off means that (as in the safety case I mentioned earlier ) one of your switches could be faulty, or one of your wires could be loose, or one of the switches is connected the wrong way round, or the 0v return pin you have selected may not be connected internally in the computer, or to your break-out board if you have one.

As a "quicky" go into config and change one of the active high to an active low - and see if the corresponding LED on the dianostics page changes.

Make sure none of the switches are activated by the carriage.

Then connect a longish wire to a 0v terminal on your board - and, with the diagnostics page open, starting at pin 12, touch the wire onto pin 12 and see if the diagnostic page changes (a multi meter probe with a sharp point would be a good idea ). If it changes, then work from pin 12 backwards through the switches, checking with the 0v probe as each connection.

The  LEDs should change as you "inject" the 0v - until you come to the faulty switch/wire/connection whatever.

On your system - all the LEDs will be lit or out simultaneously. Once you get them out, you are in business.

The three switches will work as limit switches in normal use - have a look at the instructional video about them - and how to configure the system so you can "back off" the switches if hit. If you ask the carriage to "home" the same switches are in use, but their method of working is changed by the computer, until the carriage is homed, and then they revert to limit switches.




Title: Re: Home switches
Post by: Chip on March 23, 2008, 11:30:21 PM
Hi, Wil tower

Just a couple of Notes:

Not all printer ports and cables use all the 18-25 pin's, If your using your own connector, Bridge solder 18-25 and attach your Gnd. wire.

In Config, General Config, Top right side, You may need a De-Bounce value of 1000 - 2000 for Switch bounce or Noise issues.

Thanks, Chip

Title: Re: Home switches
Post by: wil trower on March 24, 2008, 12:06:43 AM
Thanks guys...I have copied your last post and tomorrow,back to the shop and recheck everything...After I wired the switches i taped them,  and wandering if maby when taping i pulled a wire or shorted across another post on one of the switches. just have to see tomorrow,  way to much Easter dinner and just got home.  Thanks again for your" support"   

P.S. not that it makes any difference but is there any way to edit my name it should be Trower not Tower. When i registered probly jumped the R.
Title: Re: Home switches
Post by: wil trower on March 24, 2008, 12:20:21 AM
Disregard the name problem just fixed it!!!!!  profile..I have a profile!!!
Title: Re: Home switches
Post by: wil trower on March 25, 2008, 08:30:55 PM


OK.....I pulled a wire off a switch when i taped them.  Repaired it,,  I have continuity through all 3 switches now,,  oV at pin 12 until i hit a switch and it goes to +5v..   That's good i think,  all led's are out on the diagnostics ..   But now it keeps triggering a limit switch when I try to jog the axis,  I set the Debounce to 2000 and it helped very little.  If I take out the X++,X--,Y++,Y--Z++Z-- it stops triggering the limit switches, but won't stop when i jog to the switches. Probly something I'm not doing again..

I have done the ,I forgot what you call it, the wave test for lack of a better word for it without going back and looking!!
Pulse per second 25 KHZ mode   24119
CPV Sspeed   1296
Apic timing constant   4142
Time short  36
Time long 49
Demo Version R2.63
Debounce set in both boxes  2000
Input Signalcurrent state  24069
Time in INT. +6.8 to 8.2
When I reset the E-Stop it takes 3 seconds and the limit switch triggered goes on, I timed that several times , maby that will tell you something!!








 







Title: Re: Home switches
Post by: jimpinder on March 26, 2008, 05:51:33 AM
Are you saying it trips a limit switch when the carriage is no where near the switch ???

Now you have the system up and running - have a look at the videos to show you how they are controlled.
Title: Re: Home switches
Post by: wil trower on March 26, 2008, 12:54:25 PM
YES...it is tripping the limit switch long before it gets to the carrage.. 

The leds in diagnostics will flicker just a second before the limits trigger..actually the flicker is the limit tripping..

I have watched the videos several times , but i will watch them again , retaining all that info can be a problem for me..

The only thing i have on the board is the Motors ,  E-Stop ,  Limit switchs ,
Title: Re: Home switches
Post by: jimpinder on March 26, 2008, 02:08:35 PM
I am not being critical - but - since you have wired the switches "active high" they will trigger if anything is loose, poorly connected etc.etc.
Are you sure that your installation is well soldered and robust before we start trying to find the problem ???

The motor moving the carriage can loosen something, or disturb it enough to give a signal. With modern electronics the signal need be only micro seconds long to activate.

Yes - it may be some cross signalling, the way you have run your wires, but before we get into that, test the obvious.
I have just spent all afternoon improving my installation - the system works fine, but funnily enough it is the limit switches and bits that cause the bother. There is a temptation to do without them, because my system runs well enough, but there is something in me that says - no, get it going properly, and life will be simpler.

I don't know !!!
Title: Re: Home switches
Post by: BluePinnacle on March 28, 2008, 09:00:59 AM
this is the same way I had my limits wired up, and they triggered occasionally for no good reason. I fixed the problem by using a relay interface, ie feed 12v into your series switches, series switches to relay coil, relay coil to 12v ground. Then fix the n/o contacts across pin 18 and 12. This gives you some isolation from the long wires and damp switches you normally find on NC machines. Computer pins have a high output impedance and will happily trigger if they so much as smell a path to ground.

mount the relay close to the computer with short wires to the socket and remember to fit a diode backwards across the coil to absorb the flyback pulse.

Suggestion: find an old mobile phone charger which outputs 5v (nokia, usually) as they make great little power supplies for small stuff like this, and use 5v relays. use 12v and a bigger supply if you would like to run 12v hardware like low-voltage lamps.
Title: Re: Home switches
Post by: wil trower on March 28, 2008, 10:09:21 PM
Thanks BluePinnacle...I may have to try that yet ,but it would take a drawing for me to follow that program... :) 

I have resoldered all the switches and put Double shrinktube over the Soldered pin terminals on the switches, that made the connection much tighter, less movement..  Put noise suppressiors on all the wires between the switches.. Radio Shack said they work and they were cheap!! 

Took Mach3 off my computer and reinstalled , just thought there might be a problem with the download !!  The Limit switches are working OK now, still have some work to do on the Home switches..

Problem I have now is in the tunning the motors, they won't jog when tunning??  The axis will jog when not in motor tunning ?? Haven't figgered that one out yet !!  Thanks for the great support. 

Jimpinder..Criticism is good if it works and ,I believe it did.. ;D