Show Posts
Pages: 1 [2] 3 4 ... 35
16  Using Arduino / General Electronics / Noise on CNC limit switch wires on: May 18, 2014, 06:26:30 pm
Here's a picture of where my scope probes are connected and a few screenshots of what I'm seeing on the scope.  The ground wire for the scope is coming out of one of the unused terminal block pins.

17  Using Arduino / General Electronics / Noise on CNC limit switch wires on: May 18, 2014, 06:25:46 pm
Here are some pictures of my setup.  Inside the yellow electrical enclosure I have an Uno.  Plugged into the Uno is a gshield motor controller.  In the upper left is a proto board with some screw terminal blocks.  Into the top set of screw terminal blocks plug two push-button switches which then go to A0 and A1 on the Uno.  The 3 limit switch cables go into the screw terminal blocks on the right side of the proto board.  For the limit switches, I have the ground wire and shield connected together in the same opening in the terminal block.  On the X-axis limit switch you can see I have a 0.1uF cap, nothing on the other two.  On the bottom of the Uno (which you can't see) I have three 330 ohm  pull-up resistors for the limit switch lines, which are inputs D9,10,11 and the 5V pin.  The limit switches wires actually connect to the gshield, but it's a direct connection down to the Uno via the stacking header.  The ground on the proto board (and thus all the limit switches and push-buttons) comes from the ground pin next to D13.
The gsheild is powered by a 24 VDC power supply.  The Uno does not get power from the ghsield, instead it's powered by the USB cable from my laptop.
The three stepper motors are connected on the right side of the gshield.  The shields are not connected to ground, but they are connected to each other.  I initially had the stepper motor shields connected to ground, but this caused the Uno to think the limit switch was activated.  

I'm working on a schematic I'll upload shortly.

Edit: The limit switch wires have ferrite chokes right outside the yellow enclosure.
18  Using Arduino / General Electronics / Re: opto-coupler: transistor vs logic on: May 18, 2014, 03:53:10 pm
Quote
I'm showing the circuit using the normally-closed terminal.
@Runaway Pancake
Been telling him that for ages but he keeps on ignoring it.
I wasn't ignoring it, I appreciate all the feedback.  I did do some testing with normally closed switch - actually I just closed the limit switch to see if that made any difference with the noise I saw on the scope.  Unfortunately,  I didn't see any difference.  I thought I posted that on the forum, but apparently I didn't.
19  Using Arduino / General Electronics / Re: opto-coupler: transistor vs logic on: May 18, 2014, 01:54:34 pm
Quote
Can you explain why this would make it worse?
Because when the switch has been triggered it is only being pulled down with 1K5 which is not as hard as a direct pull to ground therefore making it more prone to interference.

What happened when you tried the fail safe option of having the switch normally connect to ground?

The way I see it you have a grounding problem.

Good point.  Do you have any suggestions for how I should filter out the noise?
20  Using Arduino / General Electronics / Re: opto-coupler: transistor vs logic on: May 18, 2014, 09:02:39 am
What ever made you think that would work?
I would imagine that is worse than ever.
Not worse, but not better either.  I wanted a low-pass filter to get rid of the noise on the limit switch line.  Can you explain why this would make it worse?
21  Using Arduino / General Electronics / Re: opto-coupler: transistor vs logic on: May 17, 2014, 10:09:16 pm
I tried the RC low-pass filter on one of the limit switch wires, it didn't seem to do much looking at my scope.  Attached is the circuit I used.  I used a 1.5k resistor.  Tomorrow I'll try 100k.
22  Using Arduino / General Electronics / Re: opto-coupler: transistor vs logic on: May 17, 2014, 07:34:00 pm
connect D9  between C1 and R2
R2 can have much higher resistans, 100 kohms.
0.1 uF and 100 kohms make an timeconstant (RC) of 10 ms
Pelle
Thanks. I'll give it a try.
23  Using Arduino / General Electronics / Re: opto-coupler: transistor vs logic on: May 17, 2014, 03:26:28 pm
Is this the right way to add the RC Low-pass filter (R2 & C1)?   See attached schematic.
24  Using Arduino / General Electronics / Re: opto-coupler: transistor vs logic on: May 16, 2014, 09:54:53 pm
FYI, a floating shield is useless.
Things definitely got better with floating shields on the stepper motor cables (limit switch sheilds were still grounded).  I noticed the difference on my scope.  And more importantly, with the behavior of the CNC router.  When I had the motor cable shields grounded, the CNC went into limit switch alarm mode right away.  With floating shields, this didn't happen anymore.  I'm not saying the way I have it now is the right way; it just works better then having all the shields tied together to ground.  I do have all the motor shields connected to each other. 

Quote
1) You get 4V of noise, how are your scope probes setup?  Are they set to 1x or 10x?  (It looks like you have the same scope as one I use at work, and I know they can be either).  If they are set to 10x, try setting them to 1x and see if the problem is still 4V.  (Looking at the problem can make it worse since the probe is high impedance)
They are set to 1X.  I have Rogol DS1102E

Quote
2) Try the low-pass filter.  Since you aren't going for anything high speed, Use a big cap and small resistor.  Make sure to put it next to the Arduino.
I was going to use a 0.1uF cap with 1.5k resistor.   Do you think I should use a different combination?

Quote
3) Try adding some clip-on ferrite beads near your Arduino on the cables.  Just clip them around the whole cable.
Limit switch cables or stepper motor cables?

Quote
4) How are your grounds configured?  Do you have a loop in it, or is it in a proper star configuration?  Can you put the electronics in a box, separate from your motors?
There's a power supply that provides 24 volts to the motor controller (AKA gshield).  The gshield plugs into the Arduino Uno, but the gshield does not power the Uno.  Ground on the gshield and Uno are, of course, connected via the stacking headers, but the Uno is powered via USB from my laptop.  I tested the CNC's 24 VDC power supply with my ohm meter to see if the ground terminal was connected to mains ground - it was not, which is what I would expect.  But I figured I might as well check.
I have a ground wire coming off the Uno that goes to a little proto board with some small screw terminal blocks attached.  This is where the limit switches are wired into.  So all the grounds are pretty close together on the proto board. 
Here's a picture of the setup.  The three limit switch cables enter on the right, go into the terminal blocks, then down to the gshield, which is just bringing up pins D9,10,11 from the Uno underneath.  I have the shield drain wire going into the same terminal block opening as the ground wire.

When I took my measurements with the scope I put the probe right on the limit switch wire as it entered the terminal block.  The ground clip was connected to a wire I had coming out of another terminal block on the proto board.

330 ohm pull-up resistors are soldered to the bottom of the UNO.   I've got a 0.1uF cap on one of the 3 limit switch cables, it's inserted into the screw terminal block along with the wires (cap was installed after I took the above picture).

Moving the electronics would take a lot of rewiring; something I'm not ready to do yet.

Thanks for your help.  I'll give the low-pass filter a try tomorrow.



25  Using Arduino / General Electronics / Re: opto-coupler: transistor vs logic on: May 16, 2014, 05:09:41 pm
Quote
What do you mean by artifacts?
An artifact is something that shows in the data but is not real, it is a byproduct of the measuring or storage system.
For example you might see ringing on a line, this ringing can be real, that is it is actually in the circuit or it can be caused by the scope lead being applied to the signal pin. If when you use a better scope lead there is no ringing then you conclude that the first observation was an artifact, it was not real.
There are many other ways to get artifacts in your measurement like trouble with grounds. As I said I don't believe those measurements are real.

I'm taking an oscilloscope class next week, this will be a good topic to ask about.
26  Using Arduino / General Electronics / Re: opto-coupler: transistor vs logic on: May 16, 2014, 01:46:45 pm
I find it hard to believe that those are real signals, they look like artifacts especially with such a small pull up resistor.

What do you mean by artifacts?  I tried Googling "electrical noise artifact", but I got only medical stuff.

I'll see if using normally closed switch helps.
27  Using Arduino / General Electronics / Re: opto-coupler: transistor vs logic on: May 16, 2014, 10:42:24 am
That's way beyond "noise" (4V of radio noise in a wire?)

Looks more like power supply and/or grounding problems to me.
Do you have any suggestions for how to diagnose this further?
28  Using Arduino / General Electronics / Re: opto-coupler: transistor vs logic on: May 16, 2014, 08:20:25 am
Hmmm.  Then I'd probably be better off with a simple low pass filter.  What do you think?

Normally a stronger pullup would do the job, if you're saying it doesn't then it's impossible to say what to do without knowing:
a) The source + type of the noise
b) Why it would affect a switch on the end of a shielded cable.
c) What type of switch it is

I'm already using a 330 ohm pull-up resistor. 
The noise is coming from the pulses going to the stepper motors.  The wires to the stepper motor are shielded, but the shield is floating.  The wires to the limit switches are also shielded and the shield is connected to the ground on the Uno.
The limit switch is a McMaster Miniature snap action (see attached) (# 7779K22).

The problem is the Arduino thinks the limit switch was triggered when it wasn't.  Originally I had the stepper motor cable shields connected to the shields of the limit switches and all that was going to Arduino ground.  In this config the problem was bad.  The Arduino would immediately think the limit switch was tripped.  Then I disconnected the motor cable limit switch so it was floating and it was a lot better.  You can see some screenshots from my oscilloscope here:
http://www.shapeoko.com/forum/viewtopic.php?f=3&t=3423#p25805

29  Using Arduino / General Electronics / Re: opto-coupler: transistor vs logic on: May 16, 2014, 07:57:08 am
Quote
I don't have a 2nd power supply, I'm planning on just using the Arduino power. 
that defetes the whole pointed having an opto isolator making it a total waste of components, there will be no differance

Hmmm.  Then I'd probably be better off with a simple low pass filter.  What do you think?
30  Using Arduino / General Electronics / Re: opto-coupler: transistor vs logic on: May 15, 2014, 07:41:27 pm
Both need pullup resistor on the open collector output for the next stage to see valid high out.

The data sheet says the HCPL2631QT has an internal pull-up resistor
Pages: 1 [2] 3 4 ... 35