Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: brw0513 on October 13, 2012, 03:23:56 AM

Title: Limit Switches and Interference
Post by: brw0513 on October 13, 2012, 03:23:56 AM
First real post on the board for me!

I'm setting up the limit switches on my CNC router at the moment.  They're just the simple lever type, two per axis, wired in series and normally closed.  Yesterday they were working so well I sat back with a coffee to admire my success while watching the LED indicator lights up as expected on the Mach3 Diagnostics tab.

But today I've had a setback  :o  The only difference is that I also wired up the stepper motors and gave them a spin.  They worked as expected too.  But just when I thought this home made CNC caper was easy, I got an unexpected limit switch trip.  I can reproduce it, but it is random.

I'm wondering if the wiring to the limit switches should be shielded?  At the moment it's not - could that be my problem?

Thanks.
Title: Re: Limit Switches and Interference
Post by: Tweakie.CNC on October 13, 2012, 04:14:24 AM
Hi brw,

Welcome to the forum.

In order to prevent possible false triggering, such as you have experienced, the limit switch wiring should be made with shielded cable. Only connect the shield to GND at the controller end and you should be OK.

Tweakie.
Title: Re: Limit Switches and Interference
Post by: ger21 on October 13, 2012, 08:36:25 AM
A workaround is to set the Debounce setting in general config to maybe 5000 or so, which will filter out the noise a bit. You can set it higher if you need to, but the higher it is, the longer it delays Mach3 seeing the switch being triggered.
Title: Re: Limit Switches and Interference
Post by: brw0513 on October 14, 2012, 09:45:44 PM
Thanks for the replies.

I'll get some shielded cable and re-wire those limits switches.  And I might have a tinker with the debounce setting too.

Perhaps ferrite chokes would have solved my problem.  My system must be close to stable.  They would be the $6 and two minute solution.  As opposed to the re-wiring solution at $40 and four hours.
Title: Re: Limit Switches and Interference
Post by: Tweakie.CNC on October 15, 2012, 04:47:16 AM
If you try ferrite's I would be most interested to hear your results.

Tweakie.
Title: Re: Limit Switches and Interference
Post by: brw0513 on October 15, 2012, 05:26:20 PM
This may be another case where I've rushed in when I should have made another cup of coffee and had a good think about the problem.

Using unshielded single core cable and running to each limit switch in turn (i.e. a loop) probably just created a rather affective antenna to collect EMI.  Of course, if I tried to build an antenna it probably would have failed, but I'm great friends with Murphy :)

What I plan to do now is use 2 core shielded cable and run each back to a common point, series connect the switches at that point and take the circuit ends back to the limit input to my controller.
Title: Re: Limit Switches and Interference
Post by: 762x51 on October 15, 2012, 10:29:24 PM
I haven't tried this because I haven't had a problem - yet - but what about a bypass capacitor (0.1 uf or so) from each switch to ground?

Here is a discussion regarding them - http://www.seattlerobotics.org/encoder/jun97/basics.html (http://www.seattlerobotics.org/encoder/jun97/basics.html) 
Title: Re: Limit Switches and Interference
Post by: Tweakie.CNC on October 16, 2012, 01:46:43 AM
The bypass cap's have been proven to have good results but for long term reliability shielded cables may be a better.

Tweakie.
Title: Re: Limit Switches and Interference
Post by: brw0513 on October 26, 2012, 11:05:19 PM
Well...............my problem is worse now :(

After re-wiring the limit switches with shielded cable and grounding one end of the braid per separate cable run, my limit switch circuit is less reliable than ever.  On the bright side, perhaps this might make diagnosis easier.

I'll systematically try to rule out faulty switches and bad solder joints etc but after that I'll be stumped.  I'm beginning to think my CNC controller might be twiddling pins at the limit switch pin inputs - can't get a return call from the place of purchase (I deliberately purchased locally to get help if and when needed - sheesh).

Might even try configuring the Mach3 limit switch circuit as Normally Open, but that would be less than ideal even if it worked.

Suggestions welcome :)
Title: Re: Limit Switches and Interference
Post by: brw0513 on October 27, 2012, 03:13:47 AM
After much head scratching, I'm close to going to watch TV for the rest of the evening then sleeping on the problem.  Pity I can't get the World Series baseball on free to air TV here!

My router is made of aluminium extrusions.  I've measured a 1.2V AC voltage between the frame and earth when the stepper motors are energised.  I can't imagine that is normal but also can't really see where it is coming from.

More detective work ahead.
Title: Re: Limit Switches and Interference
Post by: 762x51 on October 27, 2012, 09:33:54 AM
IMHO you have a grounding problem.

You never have mentioned who's breakout board, drivers, and power supply you are using.
 
Are all of those components properly grounded?
Title: Re: Limit Switches and Interference
Post by: Fastest1 on October 27, 2012, 11:25:05 AM
It is most likely a noise issue. Do you have a star ground? Is your Ve- from your power supply landed there? You need the shields, VE- and the earth ground to all be tied to a central point. I didnt have that one wire (VE- from my PS) tied into mine for years and tried every remedy to no avail. Just random triggers well into a succesful running code. Finally, due to my misunderstanding of electronics and what people were telling me all along, I connected that wire (praying to not release the magic smoke, burn or shock me). It worked! I now run 0 debounce and have not experienced a trigger since. I have even disconnected my shields and run stepper and limit wiring side by side as a test with no problems. Btw all shields are reconnected and wiring seperated as that was only a test, no need to be stupid. I do that plenty.
Title: Re: Limit Switches and Interference
Post by: brw0513 on October 27, 2012, 10:14:24 PM
Grounding may well be the issue.  I've got lots to learn in this area, and having let the magic smoke out of one or two things in the past has me cautious  :-[

I'll post a few pics of my router on the next few posts - seems I can only post 4 pics at a time and getting some odd naming convention error at the moment trying to do it.

The frame is made out of aluminium extrusions bolted together with aluminium cast brackets or pieces of angle.  The frame is not grounded.

The stepper motors are mounted to pieces of aluminium angle.
Title: Re: Limit Switches and Interference
Post by: brw0513 on October 27, 2012, 11:48:20 PM
Here's a general pic of the router.

Hmmm.  Seems I can post one pic at a time provided it's small enough.
Title: Re: Limit Switches and Interference
Post by: brw0513 on October 28, 2012, 12:09:22 AM
The pics below show some details of my router.

(http://i178.photobucket.com/albums/w268/brw0513/Over_all.jpg)

X axis drive:
(http://i178.photobucket.com/albums/w268/brw0513/X_axis.jpg)

Y axis drive:
(http://i178.photobucket.com/albums/w268/brw0513/Y_Axis.jpg)

Z axis drive:
(http://i178.photobucket.com/albums/w268/brw0513/Z_axis.jpg)

Typical limit switch and e-stop:
(http://i178.photobucket.com/albums/w268/brw0513/EstopandLimitSwitch.jpg)

The spindle (not installed yet) is a TecknoMotor:
(http://i178.photobucket.com/albums/w268/brw0513/Spindle.jpg)

Plate used to connect the braided shields of all the limit switches:
(http://i178.photobucket.com/albums/w268/brw0513/Earthingjunction.jpg)

The controller is from PROMiCA (Australian company).  It includes the axis driver cards, power supply, and limit and e-stop functionality:
(http://i178.photobucket.com/albums/w268/brw0513/Promicafront.jpg)
(http://i178.photobucket.com/albums/w268/brw0513/Promicafrontdetail.jpg)
(http://i178.photobucket.com/albums/w268/brw0513/Promicaback.jpg)
(http://i178.photobucket.com/albums/w268/brw0513/Promicabackdetail.jpg)

Suprisingly, it did not include any grounding/earthing point so I made some.  The posts just loop to the earth pin on the incoming power supply fitting:
(http://i178.photobucket.com/albums/w268/brw0513/Promicabackdetail.jpg)

In the bottom two pictures, I do not have my limit switches or the e-stop button connected.  The bottom most green socket has two small loops of wire installed - the blue jumper is just a "dummy" limit switch circuit; the grey is the jumper for the e-stop.

When the stepper motors are energised and not grounded, I measure around 0.75V AC between stepper body and ground for the Y axis; 1.25V for the Z axis; 0V for the X axis.  This makes me wonder whether there is an insulation breakdown on the Y and Z motors.

I can get my controller to "limit switch" trip when I ground a motor during running, so highly suspect some grounding issue.

The odd thing is when I ground all the stepper motors, limit switches and e-stop switch the controller is constantly tripped so I can't do anything.

There is a few more things I can do, like disassemble the two leaky motors to have a look see - but would appreciate help.  
 
Title: Re: Limit Switches and Interference
Post by: brw0513 on October 28, 2012, 07:05:13 AM
After another hour or so of trials and tribulations, I think I've found a potential solution (pun intended :) ) although what I've found to work still seems a bit odd.

My stepper motors are wired with 4 core insulated (braided shield) cables.  At the motor end, the braid is not connected to the stepper motor body.  At the controller end, the braid is exposed and twisted together and soldered within a female bullet connector.  My intention was to use a mating male bullet for ease of connection of a fly lead to an earthing point.  I now wonder if the "proper" thing to do was to expose the braid of the stepper cable at the motor end and connect it to the stepper motor body?  But anyway..................   

When the stepper motors are energised, the un-grounded braided shield around each 4 core supply cable shows a small AC voltage.  Between the stepper cable braid and ground:

The Z axis gives 2.25V
The Y axis 2.0V
The X axis 1.75V

If I don't ground the stepper motor bodies, then each develops 1.5V AC between its body and ground.

When I leave these stepper braid sheilds ungrounded, but ground the body of the stepper motor and the braided shield of the limit switch cable runs, then the router operates perfectly.

Alternatively, if I ground the stepper motor braided shields and stepper bodies, but do not ground the limit switch cables, then the router operates perfectly too.

It is only when I connect the braided shields of the stepper motor cables and the braided shields of the limit switch cables that the controller trips out - and it happens instantly.  The PROMiCA controller is just not happy when I earth both the stepper cable braids and the limits switch braids.

Happy to receive any further comments.

     
Title: Re: Limit Switches and Interference
Post by: Tweakie.CNC on October 28, 2012, 07:31:09 AM
Just in general...

The shields of all cables are connected to GND at the controller end only and preferably to one single point or tag.
The machine frame and any other metal parts that you can touch are connected to protective Earth.
Earth and GND should be treated as two entirely separate circuits as far as wiring is concerned.
It is essential that you have no 'Earth loops' or 'GND loops' anywhere within your wiring.

The PC usually has its negative rail (GND) connected to Earth so this should be the only place where they meet.

Often points of conflict exist if the shielding of the LPT parallel cable or PC casing is connected to machine frame (Earth) or the heat-sink of a VFD is connected to the machine frame and also has it's own Earth wiring but there are many other areas where loops can easily be created.

As you have discovered, it is a difficult problem to resolve but unless it is resolved 100% then it may come back to bite you, at some future date - usually 3/4 of the way through a complicated and expensive job.

Tweakie.
Title: Re: Limit Switches and Interference
Post by: RICH on October 28, 2012, 07:56:13 AM
You should not have 1.5V from the frame. From what your posting you don't have the spindle / router running. The source for EMI would be the router, router used a in an actual router being used for the spindle. Yes there will be EMI from the stepper cable leads at the motor but don't think the EMI field would create the 1.5V you are talking about.


RICH
Title: Re: Limit Switches and Interference
Post by: brw0513 on November 20, 2012, 06:37:32 AM
I am pleased to say I have a solution to my limit switch problem :)  Not really the way I was hoping to solve it, but trying to find the source of the false tripping turned into a 2 week saga that was doing my head in.

I'm now using a 12V DC SPDT relay.  The six limit switches are in the 12V power circuit to the relay coil and the normally open switch is connected to the limit input to the PROMiCA IC3A controller.  It works wonderfully :) but I do have a 12V power supply and circuit that I never thought I'd need. 
Title: Re: Limit Switches and Interference
Post by: Hood on November 20, 2012, 07:03:40 AM
This is the reason reason nearly all industrial machines run 24v for the signalling side of things ;)
Hood
Title: Re: Limit Switches and Interference
Post by: BR549 on November 21, 2012, 01:23:23 AM
Looking  at your pictures I see where you can be having problems. It appears you have ground loops everywhere.  I would contact the drive controller manf for grnding suggestions for THEIR equipment hookup.

Just a thought, (;-) TP