587,560 active members*
3,364 visitors online*
Register for free
Login
Results 1 to 16 of 16
  1. #1
    Join Date
    Jan 2011
    Posts
    0

    Limit switch problems

    Hi everyone,

    I am building my own CNC machine. It is roughly 30"x30"x10" set up as xxyz. I had my machine working properly on Linuxcnc's EMC2 with just the x and y axes while I was building the z axis. I finished the z recently and wired the z axis motor and limit switches. All of the motors run properly.

    I do have one problem though...

    When I power up the machine in emc2, I get a "joint 2 (z axis) on limit switch error", and the program prevents additional power up attempts. This is confusing because the z axis has not tripped the switches. Also, the program correctly registers when the switches are actually open and closed (it displays that little white arrow by the z axis coordinates).

    Is this a hardware or software issue? I checked the limit switch wires and they are free of shorts (they are like 10' long - could too much resistance be the problem?). I checked the pinouts and home settings, and nothing is conflicting (I used the same settings as my other working axes).

    Thanks for the help!

  2. #2
    Join Date
    Apr 2005
    Posts
    1778
    Can you physically trip one of the z-axis switches, before you power up and see what it reports?

    You should be able to use Halscope to see what happens on a pin when you trip the z-switch and compare that with what happens on the pin connected to the x or y limits when one of them is tripped.

    Is there a possibility that you wired one or both of the z switches Normally Open (NO) while the x and y switches are properly wired (NC)?

    Alan

  3. #3
    Join Date
    Jan 2011
    Posts
    0
    I tripped the switches before startup, and still the same thing happens. I checked the halscope and nothing strikes me as unusual. Also, I did wire the switches as NC as I intended. I tested them for continuity and they are working properly.

    I redid all of the wiring hoping to find a short or something - still no dice. I thought that I was possibly getting interference from the nearby motor power cables, but the problem remained even when I physically moved the limit switch wires away from the motor ones.

    I did discover new behaviors of this problem that might aid in a diagnosis:

    -The problem is resolved when I place a jumper across the wires directly at the ports on the parallel port breakout board (bypassing the switches). However, this short-circuit idea doesn't work on any other part of the wires (I thought that at a certain point in the wires the resistance might be too great. At that point I would place a short to signal a closed switch there. It didn't work).

    -At my initial press of the "machine power on" in the software, I don't have any issues. Only about 5-10 seconds later do I get an error message.

    -The error message doesn't appear when the machine is in the e-stop mode or the power supply is turned off.

    -The problem is not consistent at all. Sometimes I get an error immediately - other times, I get an error 30 seconds later.

    -Rarely, I can power on the machine without an error. I triumphantly go move the motors, but as soon as they move a fraction of an inch I get the error.

    -Finally, this issue happens regardless of which pin I use on the parallel port. It doesn't happen if no z-axis limit is included in the pinout.

  4. #4
    Join Date
    Apr 2005
    Posts
    1778
    Is it possible that you have an intermittent break in a wire?

    Is your z-limit supposed to be active high or active low? (i.e., are you shorting to ground or shorting to +5v).

    Check your voltage levels on the z-axis limit with a switch open and with a switch closed.

    On one circuit, I had to put a pull-up resistor on a breakout board because I was using an open collector device and it wasn't going high enough to be recognized by the computer.

  5. #5
    Join Date
    Jan 2011
    Posts
    0
    Thanks for the advice. I stumbled upon a solution by dumb luck when I was trying to isolate the electronics. It turns out that the limits function normally when they are hooked up with solid core wire (I used stranded core for some sections).

    This works but seems kind of sketchy to me. Is there any sort of signal boosting circuit I could use on these wires to increase their reliability?

  6. #6
    Join Date
    Apr 2005
    Posts
    1778
    Maybe it is just a problem of contact with the BOB. Try using the stranded wire but soldering the ends before inserting them the BOB connectors. So it is like solid wire at the the ends but flexible where it needs to be. I assume they are already soldered to the microswitches???

    Alan

  7. #7
    Join Date
    Feb 2007
    Posts
    532
    You could use an opto-isolator and run the limit switch circuit at a higher current than the current used on the BOB, that would remove any interference possibilities.

    I've seen a problem with this on a BOB for a friends machine a while ago. I built him a small opto-isolator setup for all four input circuits (estop + 3 limits) and all his problems went away. The BOB just had a pullup and filter cap, so was quite susceptible to interference. His symptom was similar although often the machine would move but powering on the spindle would trigger estop or a limit.

    If you think it'd help and you're OK with a soldering iron and veroboard (or similar) I can sketch up the circuit for you.. It was just some 4N25's, a couple of resistors and some filter caps.

    Cheers, Chris H.

  8. #8
    Join Date
    Jan 2011
    Posts
    0
    An optoisolator might help. I would really appreciate a schematic.

    Thank you very much!

  9. #9
    Join Date
    Nov 2012
    Posts
    5
    Im looking for a bit of help. Bought a blackfoot cnc router. I got all working fine but every so often the x axis would loose signal.Therefore I replace the breakout board with this:
    Upgraded 5 Axis Cnc Breakout Board For Max 5Pcs Single Axis Stepper Motor Driver | eBay

    Now I'm having a different problem! I never had problems with interference in the limit switches with the original breakout board however I do with the new board (at least I think its interference) I keep getting pulses coming through the limit switch wires every few seconds that trigger the emergency stop.

    The pulses can be read as .01v. I have changed the debounce. This didn't cure it. I understand that shielded wire is recommended for the limit switch wires but I don' understand how these pulses never affected the old breakout board but it is affecting the new one??
    Can anybody help please?

    Mike

  10. #10
    Join Date
    Dec 2003
    Posts
    24220
    Ground all supply commons to a earth ground star point.
    Make sure all metallic parts and motor frames are grounded.
    Al.
    CNC, Mechatronics Integration and Custom Machine Design

    “Logic will get you from A to B. Imagination will take you everywhere.”
    Albert E.

  11. #11
    Join Date
    May 2012
    Posts
    231
    Do you have a shielded cable for the limit switches? If so you only need to run the shield to ground on one side of the run. Otherwise you could run in to a ground loop problem.

  12. #12
    Join Date
    Nov 2012
    Posts
    5
    Thanks Al the Man and Dodger889.

    The cable is not shielded. I didn't have the need for it with the old bob. I grounded all commons as you suggested Al. This made no difference. I thought it could be that the new bob hasn't got the right pull up resistors to kill the interference so I took 3 parallel port cables, split them so I could have one cable coming from the computer taking the inputs from the old bob and sending the outputs to the new bob. ( I assumed this would work as the old bob never had interference triggering the limit switches) However after hours of work the interference was still happening when all was reconnected. I really don't understand how this could be.

    Mike

  13. #13
    Join Date
    May 2012
    Posts
    231
    Try this disconnect the power going to what ever axis motor that you are having problems with see if might be feed back from that motor power. since you did not mention if you have separate drivers. I would just do one driver motor power at a time. I hope this makes sense .

    Oh by the way commons should never be grounds to the frame or case. They should only go to the circuit common. Frame ground should go to earth ground. Check outlets for a true earth ground might help too.

  14. #14
    Join Date
    Dec 2003
    Posts
    24220
    Quote Originally Posted by dodger889 View Post
    Oh by the way commons should never be grounds to the frame or case. They should only go to the circuit common. Frame ground should go to earth ground. Check outlets for a true earth ground might help too.

    Depends on what what method you subscribe to.
    http://www.automation.siemens.com/do.../emv_r.pdf?p=1
    Your P.C. P.S. already does!
    Al.
    CNC, Mechatronics Integration and Custom Machine Design

    “Logic will get you from A to B. Imagination will take you everywhere.”
    Albert E.

  15. #15
    Join Date
    May 2012
    Posts
    231
    Quote Originally Posted by Al_The_Man View Post
    Depends on what what method you subscribe to.
    http://www.automation.siemens.com/do.../emv_r.pdf?p=1
    Your P.C. P.S. already does!
    Al.
    You are Also talking about a industrial setting. If you checked the sub notes it also state that all frame work and electrical should be earth bonds to include the cubical around that system. . Now if we all did this on our home systems then most of our RF problems would not be there.Which is 75% of the problems of the trips and errors of a new system or a change( upgrades) n the system. Now if we went to those standards used in industrial setting the cost would drive most of us from even trying to build a home system.
    When doing a wooden build(poor RF protection) a system that does not provide any or a true neutral ( earth ground) . Now for those that do a metal frame do not do an earth bond or understand what a true earth bond is. They figure that the ground lead in the power cable will provide the the earth bond.

  16. #16
    Join Date
    Dec 2003
    Posts
    24220
    Quote Originally Posted by dodger889 View Post
    You are Also talking about a industrial setting. If you checked the sub notes it also state that all frame work and electrical should be earth bonds to include the cubical around that system. . Now if we all did this on our home systems then most of our RF problems would not be there.Which is 75% of the problems of the trips and errors of a new system or a change( upgrades) n the system. Now if we went to those standards used in industrial setting the cost would drive most of us from even trying to build a home system.
    When doing a wooden build(poor RF protection) a system that does not provide any or a true neutral ( earth ground) . Now for those that do a metal frame do not do an earth bond or understand what a true earth bond is. They figure that the ground lead in the power cable will provide the the earth bond.

    I appreciate the document goes to the most extreme, but some simple principles still apply to ANY build where you are mixing low voltage TTL based electronics with 120v/240v AC controlled spindles etc.
    I still think that observing good bonding practice is not only possible on a wooden build, but if anything is more desirable.
    How many do not bother to take a ground wire with stepper wiring? Or ground the frame of all motors?
    From the reading of several like posts about random tripping of limits etc, there are other practices that also aggravate the problem in my opinion.
    One is plugging in each piece of equipment into separate power outlets, instead of supplying from one source and allowing the ability of all grounds coming back to a common star ground point.
    Another is the tendency to keep all P.S. commons separate, this is often based on advice from the manufacturers of the various pieces of equipment assembled for the final machine.
    I tend to believe this advice is based on more of protectionism of the individual equipment to avoid problems when unknown equipment is married together.
    If done with the proper caution it is far better in my opinion to common up supplies to the earth ground point, something I have been doing with P.C. based systems for 25 years.
    As I have pointed out before, your P.C. P.P. common is in all probability connected to one side of your 120v/240v spindle motor supply, therefore you want to ensure that there is no differential between these two!
    It is often those that play fast and loose with home built systems in this area, thinking they do not need to copy the practices that have been aquired over time, are the ones that post here about false tripping etc.
    Al.


    .
    CNC, Mechatronics Integration and Custom Machine Design

    “Logic will get you from A to B. Imagination will take you everywhere.”
    Albert E.

Similar Threads

  1. Limit switch problems.
    By Don Clement in forum Tormach Personal CNC Mill
    Replies: 32
    Last Post: 09-25-2009, 03:25 AM
  2. Limit switch problems
    By kennected in forum DIY CNC Router Table Machines
    Replies: 5
    Last Post: 07-01-2009, 05:21 AM
  3. limit switch and home switch setup
    By Runner4404spd in forum CNC Machine Related Electronics
    Replies: 0
    Last Post: 12-15-2005, 02:58 PM
  4. Limit Switch Problems
    By johnd in forum Mach Software (ArtSoft software)
    Replies: 2
    Last Post: 12-07-2005, 05:04 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •