Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: Fastest1 on March 12, 2009, 02:22:41 AM

Title: limit switches/ estop?
Post by: Fastest1 on March 12, 2009, 02:22:41 AM
I just built a HCNC Pro 4 axis controller and all is working except the limit switches. I think its a setting issue not hardware. Ok right now I have a mushroom switch that is n.o., closing the circuit makes mach3 stop via T5 grd and pin 10. That all works great. I can reset the flashing red icon on the screen after pulling out the mushroom and everything works great. I have estop enabled and set to active low. NOW if I hook up T5 ground and pin 11 to a set of series wired switches (continuity til switch is pushed). It will work according to mach3 as long as the hcnc is not powered up? The second I actually power up the board the limit switch flashes even if nothing touched it. I cant seem to reset it. Just stays flashing. I even tried it while disconnecting and disabling my estop, still triggers a limit warning and all control stops. What am I missing? This is just the z limits at the moment. I am
using 24/2 shieded. I have tried with active low selected and not selected. Seems to be no difference. Is there a switch/selection to jog off a limit? Everything
I read acted like a series connected set of switches were the cats meow. ?


Title: Re: limit switches/ estop?
Post by: Hood on March 12, 2009, 03:20:02 AM
Do you see the LEDs for the limits, on the diagnostic page , showing they are triggered? If not then it is likely to be noise so try setting the debounce Interval to 2000 (Config menu then General Config page) If that helps then best to check all your shielding again making sure it is only grounded at one point in your cabinet.
Hood
Title: Re: limit switches/ estop?
Post by: Fastest1 on March 12, 2009, 07:49:29 AM
Yes the led does light up when the switch is triggered. Though I am using shielded wire, I havent tied the grounds down on the limit switch yet. I do have the steppers grounded so I thought it would be acceptable for the test. I was wondering if using a n.o. switch for the e stop and a n.c. string of series connected limit switches were conflicting with each other because of a shared ground. The estop is on pin 10 and limits for z are on 11. Is that an issue?
Title: Re: limit switches/ estop?
Post by: Hood on March 12, 2009, 09:00:51 AM
I am meaning do you see the LED light when it FALSLY  triggers, is so try the Debounce Interval.
No having the limits and E-Stop on different pins is the proper way however a NC E-Stop would be better as if its a NO then Mach (and you) will never know a wire has broken or fallen off until you need the E-Stop and then it wont work.
Hood
Title: Re: limit switches/ estop?
Post by: Fastest1 on March 12, 2009, 10:01:51 AM
Hood
Thank you so much for the timely responses. I did think about the repercussions of using the switch I had. It is a switch with both options (NC/NO simultaneously) however I am using the NC side to depower the spindle when pressed and the other side triggers the mach to stop. The nc side of the switch also shows 110v so I didnt want it to connect with the board. I am going to install a toggle switch on the spindle also to allow safe tool changes without interuption of the gcode. If this is all possible. I believe it is. I will test the debounce setting in an hour or so, would that have an effect even if the switch was never touched? It seemed to do it regardless when/once I powered up the box. Seems to work great prior to powering up. It does sound like an induction/interferernce problem or my limited understanding of it. Not being a machinist/electronics/computer/cad student or tradeperson (I do have quite a bit of low voltage experience, media systems and window covering automation) it has been funny when you realize the vocabulary in all of the technical jargon and what it finally starts to mean after endless nights of reading in many fields. I spent so much time testing my HCNC pro board and mach software trying to get the steppers to jog that by the time they jogged, I understood so much more about the software. All of those problems were because I used a  defective ribbon cable between the board and the chassis jack I insisted on using. A little anal about appearance. Why else would we be interested in any of this otherwise? I have a problem gettiing absorbed deeply and not sleeping/eating acknowledging anything else til completion. I thought it was exciting, that is why I commit. Sorry for the life story and Thanks again for the responses. I do notice you help many people here as I have been reading as a guest for quite a while.
Title: Re: limit switches/ estop?
Post by: Hood on March 12, 2009, 10:31:35 AM
The ideal setting for the Debounce Interval is zero but you need to have everything wired well when it comes to the shielding for you to get that. Routing the limit cables close to any power cables can cause a fair amount of noise and Mach is very sensitive at picking up limit signals and it seems to be the case with yours.
  I have the limits on my Lathe and Beaver Mill on 24v and change this to 5v just prior to the signal entering the breakout board, 24v is much more imune to noise than 5v for the simple reason that the difference between Hi and Low is much greater in the 24V system.
 My Bridgeport just has 5v to the optical limits but I took care to shield the wires properly and tried to keep them routed away from mains wiring, I have the debounce as zero, so it shows that it can work. If setting the debounce to 2000 helps then its time to look at the shielding and cable routing.
Hood
Title: Re: limit switches/ estop?
Post by: Fastest1 on March 12, 2009, 10:58:55 AM
I cant wait to try it! Unlike old or new political parties in power, you do instill HOPE! John
Title: Re: limit switches/ estop?
Post by: Hood on March 12, 2009, 11:47:40 AM
Unlike old or new political parties in power, you do instill HOPE! John

I will reserve my comments about politicians to the ones in my own country :)
Well unless I am talking to Brett as its fun winding him up (http://forums.pcper.com/images/smilies/extras/yllol.gif)
Hood
Title: Re: limit switches/ estop?
Post by: Fastest1 on March 12, 2009, 01:25:37 PM
I thought I had responded. Anyway landed the shields to the chassis ground, and tried debounce at 2000 and then again at 4000. The delay before self triggering was longer than with no debounce but not much. Any other ideas? Again as long as power is off, estop and limits respond like they should, or as desired.
Title: Re: limit switches/ estop?
Post by: Hood on March 12, 2009, 04:53:00 PM
Ok as a test take out the limits wiring from the breakout board and jumper a short wire accross from pin 11 to Gnd and see if you still get the same issues.
Hood
Title: Re: limit switches/ estop?
Post by: Overloaded on March 12, 2009, 06:02:42 PM
As a different test, you might try temporarily removing the 110v AC from the NC side of your E-Stop PB.
? ? ? ?
RC
Title: Re: limit switches/ estop?
Post by: Fastest1 on March 12, 2009, 06:11:28 PM
Disconnected estop and limit switches, disabled estop input. ran jumper as suggested. Still falsely triggered limit. Though with a 2000 debounce I did get a longer delay. In ports and pins should z++, z-- & z home be enabled? It never responds if active low is selected.
OL I tried that last night and it didnt help. I even used that switch and switched to active low. Seems like it still triggered
Title: Re: limit switches/ estop?
Post by: Hood on March 12, 2009, 07:14:43 PM
Sounds like its your board that is creating the noise internally or picking it up anyway. If you can attach your xml I will have a look at it just in case there are any errors there but cant think how there could be but you never know :)
Maybe try some small capacitors from 11 to gnd.
Hood
Title: Re: limit switches/ estop?
Post by: Fastest1 on March 12, 2009, 07:43:05 PM
Will this tell you anything?
Title: Re: limit switches/ estop?
Post by: Hood on March 12, 2009, 07:46:18 PM
afraid I cant download that file, what is it?
Hood
Title: Re: limit switches/ estop?
Post by: Fastest1 on March 12, 2009, 07:47:45 PM
Sorry empty file was sent, not really sure how to convert it. It is too large to post. What would the capacitors do? The board was inspected by an excellent electronics repair person who is a friend. No apparent errors and it has pased all electrical tests with no issues.
Title: Re: limit switches/ estop?
Post by: Hood on March 12, 2009, 07:55:53 PM
The capacitors may help to  filter any noise that is present.
To attach your xml copy it from the Mach3 folder to your desktop and then rename the copy as Fastest1.xml then the forum will accept it.
Hood
Title: fastest1's Xml
Post by: Fastest1 on March 12, 2009, 08:54:23 PM
did it work?
Title: Re: limit switches/ estop?
Post by: Fastest1 on March 12, 2009, 08:55:53 PM
Any particular value? Is it possible the capacitor can damage the board?
Title: Re: limit switches/ estop?
Post by: Fastest1 on March 12, 2009, 09:01:04 PM
And how would I use it? Would each input get a cap or just attach all grounds to 1 cap? Or some other way?
Title: Re: limit switches/ estop?
Post by: Hood on March 12, 2009, 09:12:07 PM
think the norm is 0.1uF , you put a cap on each input to gnd but trying it on just the troublesome one would probably do. Might be best to seek the advice of your electronics guy first.
Hood
Title: Re: limit switches/ estop?
Post by: Fastest1 on March 12, 2009, 09:37:57 PM
Did you see anything in my xml file?
Title: Re: limit switches/ estop?
Post by: Fastest1 on March 12, 2009, 10:11:07 PM
I just checked the HCNC pro forum and Dave Rigotti, the boards designer recommended using a .01uF cap across grnd to pin used. I got 3 different .01uF caps, is there a difference I should be aware of? The types are a metalized film capacitor, a polyester film capacitor or a ceramic disc capacitor. Is 1 better or more durable than the others? They are all .01uF
Title: Re: limit switches/ estop?
Post by: Fastest1 on March 13, 2009, 12:24:54 PM
Today I tried the .01uF cap between pin 11 and ground on the t5 on driver board. It didnt seem to help until I set the debounce 100 or above, unfortunately no matter how high I set the debounce it would still falsely trigger. With the cap in place I did notice longer delays til the false trigger. I tried as high as 10000. That gave me 30-45 seconds or so that I could actually jog the steppers without a trigger. I have seperate fuses in my chassis for the spindle, steppers, driver board, acc etc. Today I first pulled the fuse to the variable speed spindle circuit. That didnt have an effect. Put that fues back in. Then I removed the fuse for the steppers and all worked fine software wise. The board was powered up just not the steppers. So I am getting closer, I think. Any ideas? Can I increase the value in that cap and expect better noise rejection? I notice you had originally suggested a value of .1uF. I will ask specifically of the boards designer if it will cause any issues. thanks
Title: Re: limit switches/ estop?
Post by: Hood on March 13, 2009, 02:50:54 PM
Definitely sounds as if your board is prone to noise, hopefully the larger capacitors will help, also try and route any mains wiring as far away as possible from the board.
Hood
Title: Re: limit switches/ estop?
Post by: Fastest1 on March 13, 2009, 04:50:57 PM
I am taking it you didnt see anything blatantly obvious that was incorrect in my xml? Wouldnt my xml keep changing with each setting change saved?
Title: Re: limit switches/ estop?
Post by: Hood on March 13, 2009, 06:07:43 PM
Your xml looked fine and yes it would change each time you shut down Mach with any change you had made during that session.
Hood
Title: Re: limit switches/ estop?
Post by: Fastest1 on March 13, 2009, 07:05:27 PM
I just received a email from the boards designer that a .1uF cap was ok though he said this was a rare issue with his users. It did happen but rarely. I did add some features to my enclosure like variable speed spindle control and such. This might cause some of the interference but it didnt have an effect when I pulled the fuse. I am trying for a zero debounce, correct? I did pick up the bigger caps, so I will know more tonight. The z axis is the only one I am dealling with at the moment, under "ports and pins" input, should all 3, Z++, Z-- & Z home be enabled? I would think so but I am not sure.
Title: Re: limit switches/ estop?
Post by: Hood on March 13, 2009, 07:30:19 PM
Debounce ideally should be zero but from the looks of it you will be struggling to get that. The default of Mach used to be 500 not sure what it sets as now on a fresh install/profile.
 Yes, if you have 2 (or 3 ) switches in series for the Z axis then enable them all and set all to the same port and pin,  you can put any amount of NC limits in series so you could have all axis on the same Input pin.
Hood
Title: Re: limit switches/ estop?
Post by: Fastest1 on March 14, 2009, 01:21:32 PM
Installed the .1uF cap on the limit switch input and ground. It didnt seem to change anything until I set the debounce to 25000. Then it would run the gcode fine without interruption (maybe). I do notice that the higher the debounce the longer time til false triggering. Also it blew a stepper fuse while I was bumping the Z+ limit, though that didnt happen again.
Title: Re: limit switches/ estop?
Post by: Hood on March 14, 2009, 03:04:33 PM
All that is happening when you are increasing the debounce is making it a longer signal before Mach will react to it, 25,000 is waaaaaaaaaaaay to much, there is definitely some serious noise getting picked up by your board. Not sure what the board is but can you take it out of the equation and connect direct to the parallel port?
Hood
Title: Re: limit switches/ estop?
Post by: Fastest1 on March 14, 2009, 07:05:19 PM
I have no idea how I would do that? It is an HCNC Pro board. The designer says this is rare and it doesnt look like it is a big problem on the forums. Though cnczone does have some reference to it. There seems to be 1 person using a different parallel port. I am running a laptop and it works fine at controlling the mill. I did see someone refer to setting the lpt1 to be SEP?
Title: Re: limit switches/ estop?
Post by: Hood on March 14, 2009, 09:04:24 PM
You could try that, not heard of SEP before, maybe they were meaning SPP (Standard Parallel Port) You will change it in the Bios.
Hood
Title: Re: limit switches/ estop?
Post by: Fastest1 on March 14, 2009, 10:44:15 PM
I believe you are right, just havent had time to pursue it yet.
Title: Re: limit switches/ estop?
Post by: Fastest1 on March 15, 2009, 08:35:45 PM
Afer trying many different solutions for the false triggering such as placing
the capacitor across the ground and pin 11 or which ever you are using for
limits, etc. Nothing was working. I set debounce to astronomical (up to 25000)
levels with no help. I am a stubborn man! I once again I insisted on a parallel
port jack on the exterior of my enclosure, instead of the cable running from the
board and thru the wall (grommetted) as Dave suggested. Of course the enclosure
he suggested is also plastic where mine is aluminum. It was causing a ground
issue because the cables metal shield was touching the enclosure which is
grounded. Once I pulled off the cable and ran it directly to the computer
everything worked great. I need no debounce, no caps or additional resistors,
etc. Hoewever I do notice if I hook the limit switch shielding to the chassis
ground all starts acting up again, so for now it will remain disconnected. I
also notice the steppers got remarkably quiet once the ground issue stopped.
That is twice that my stubborness and insistence on that jack in the back of my
controller was necessary. 2 different cables and 2 entirely different problems.
But Oh what I have learned about software trying to make it all work.

Title: Re: limit switches/ estop?
Post by: Fastest1 on March 15, 2009, 08:41:45 PM
Also I opened the bios window on my laptop and changed the parallel port to output only. There was 3 choices, bi-directional, output only and ECP. I tried this and it seems to work well though the grounding issue was solved just prior to that change. Computer is an IBM T42. There was nothing called SPP.
Title: Re: limit switches/ estop?
Post by: Fastest1 on March 15, 2009, 08:50:43 PM
Hood,
Do you have an opinion on whether I should hook the limits +'s all to the same pin and all the -'s to another. Or should I do each axis with its own 2 switches, 1 for + and 1 for -. I think I would like each axis to have both. Is one way better?
Title: Re: limit switches/ estop?
Post by: Hood on March 16, 2009, 03:34:16 AM
You can hook them any way you like and it will depend on how many inputs you have spare. You can have all Limits and Home switches all in series and connected to the same pin and Mach is happy with that. You can have all home and limits on an axis in series and each axis have its own pin and again Mach is happy. You can have each switch on its own pin as well if you wish, just as long as you tell Mach (in ports and Pins, Inputs) which way you have it set up then its doesnt matter. Most people have all switches in series and  use just one pin as it saves precious Inputs for other things.

Hood
Title: Re: limit switches/ estop?
Post by: Fastest1 on March 16, 2009, 09:58:14 AM
There are a few things that I obviously dont understand. I can not figure out how it finds "home" if all switchers are in series. But maybe I am misunderstanding the term "home". Thanks again, getting much closer.
Title: Re: limit switches/ estop?
Post by: Hood on March 16, 2009, 10:38:57 AM
When you Reference (Home) Mach just looks for a switch activating, because you have the same switch for Home and a Limit Mach will treat it as a Home switch, it will then Back off until the switch is closed and then move onto the next axis and do the same. Because when doing a Reference  only one axis is moving at a time it therefore has to be the switch on that axis that has been triggered.
 Once all axis are refernced Mach will then treat the switches as limit switches.
 Hood
Title: Re: limit switches/ estop?
Post by: Fastest1 on March 16, 2009, 01:26:25 PM
That helped my understanding a bit. Thanks