1
\$\begingroup\$

I have a circuit that takes two analog inputs and positions a stepper motor accordingly. The problem I have ran into is the ground has a lot of noise and in turn makes my a/d inputs noisy and then the motor starts to get shaky and all kinds of strange stuff. I have tried isolating the grounds and also a star ground. I am sure the noise is coming from the stepper motor driver and the high speed switching. The board has both 12V(for motor) and 5V(for microcontroller and a/d's) regulated supplies and the noise is also coming through on them. The only thing that I have found to eliminate this is when I attach the ground lead from the oscilloscope to the ground on the board and it goes away. Why is this? What can I do to try and solve this problem. I am completely out of ideas TIA.

\$\endgroup\$
  • 2
    \$\begingroup\$ Can you add a circuit diagram please \$\endgroup\$ – Dean Apr 22 '11 at 21:22
  • \$\begingroup\$ @noremac check my answer to this question it may be helpful: electronics.stackexchange.com/questions/3760/… (i'm the same Mark as the one there I just lost the login for that account way back) \$\endgroup\$ – Mark Apr 24 '11 at 17:56
  • \$\begingroup\$ Thanks mark. I have seen grounds laid out like the one in the image on that post and always wondered why they did that. That is definitely possible for my application. Should I ground the motor driver to the same plane as the microcontroller? I would love to upload an image of the schematic or board layout but my Internet is down right now and I am having to do everything from my phone. But on my next board revision I will try that layout. Also my return from the motor is a 70mil trace so I'm not sure if that is enough copper for a return. I will try adding a wire to the return tomorrow. \$\endgroup\$ – Noremac Apr 25 '11 at 3:34
  • \$\begingroup\$ @noremac well, if you can upload the images I can help but fundamentally what you want to do is draw the current/ground paths for signals over an image of the PCB (remember high frequency returns along the path of least impedance not resistance). Focus on signals that are sensitive, high current or connect sections with different grounds. Look for large loops (EMI issue) and/or places that ground currents are traveling under sensitive sections of the circuit. You also want to look for places where the resistance to ground may be high, such as long traces / lack of ground plane(s). \$\endgroup\$ – Mark Apr 25 '11 at 14:59
  • \$\begingroup\$ Dumb question, how do I upload the schematic and pcb layout? \$\endgroup\$ – Noremac Apr 25 '11 at 17:52
1
\$\begingroup\$

The actual topology of your ground system is important in cases like this. Currents don't just go away when they reach a ground node, they return to their source. What you want to do is to minimize the amount of conductor that the motor return currents share with the return current for the A/D section. For instance, the 12V return wire should go quite near the stepper driver, and for the 0V reference you can tie the logic ground and stepper-driver ground (12V return) together at just that point.

\$\endgroup\$
  • \$\begingroup\$ The pcb I have right now has 3 separate grounds. One for the microcontroller, one for the a/d and another for the stepper motor driver. The stepper ground has a trace that runs back and is grounded beside the ground from the power supply. The a/d and microcontroller grounds are connected with a zero ohm resistor. I did this to try and keep everything isolated. What your saying is I need to get rid of the resistor and run a trace from a/d ground and tie it into the same point at the stepper ground. I hope I understood you correctly. \$\endgroup\$ – Noremac Apr 23 '11 at 1:13
  • \$\begingroup\$ @Noremac - not sure i'm picturing what you have correctly, but it doesn't sound as though you're passing the motor return currents through the same path as the a/d and logic returns - in which case what i said doesn't help much. sounds like what you have may be more of an emi situation in the ground loop your a/d and logic form through the 0-ohm. \$\endgroup\$ – JustJeff Apr 23 '11 at 1:39
  • \$\begingroup\$ No they aren't being passed through the same return. The only two that are connected are microcontroller and a/d grounds and that's done with the zero ohm res. How could I test to see if it was emi? I really think it's coming from the motor driver because there is a slight pattern to it. If I could just isolate it from the a/d it would be fine. The rest of the circuit is fine, it's around 20mV of noise that is shoing up so it really messes with my a/d values. That's a lot of noise so the only thing I can think is it's coming from the driver. It's an allegro a3977 \$\endgroup\$ – Noremac Apr 23 '11 at 2:55
  • \$\begingroup\$ @noremac You said that the stepper ground is running through a trace. That better be a big trace or you'll get large ground bouncing issues due to high switching currents. \$\endgroup\$ – Mark Apr 24 '11 at 17:49
  • \$\begingroup\$ @noremac Also remember that high frequency ground return currents will travel through the path of least inductance rather than the path of least resistance. Functionally this means that the ground current for a particular signal will try to travel as close to the signal trace as it can. This can result in large loops which will radiate EMI. It can also mean that return currents are actually traveling back through the other sections of your circuit rather than through the ground trace. If you can post the schematic and PCB layout for more detailed recommendations. \$\endgroup\$ – Mark Apr 24 '11 at 17:52
1
\$\begingroup\$

Just try a few decently sized shunt capacitors from the 5V to gnd and/or 12V to gnd. Make sure of the polarity and voltage rating.

\$\endgroup\$
  • \$\begingroup\$ But which ground? \$\endgroup\$ – endolith Apr 26 '11 at 14:08
0
\$\begingroup\$

Sounds as if its grounding through the O'scope back to earth ground. Can you connect your pcb ground to the line cord ground?

\$\endgroup\$
  • \$\begingroup\$ I can't. I wanted to try that too. The problem is that the walltransformer I am using is a 2 prong and I can't find one I need with 3. The wall transformer selection these days seems to have gotten pretty thin. Digikey nor mouser have one. It's just a 12V 1A supply so it's nothing fancy. And dean I can't upload a schematic, sorry. I know it would help but I can't upload from my phone, I don't have the file on here. Everything seems to work just fine other than the noise in the ground that's causing me problems. Would a solid ground be better or isolated ground planes with a star ground? \$\endgroup\$ – Noremac Apr 22 '11 at 21:51
  • \$\begingroup\$ I hope I understood you correctly when you said line cord ground. I'm by no means an electronics expert just a tinkerer! It gets me into messes like this more often than not. It wouldn't be any fun though if I didn't have to beat my head against the bench at least twice a day though :) \$\endgroup\$ – Noremac Apr 22 '11 at 22:17
  • \$\begingroup\$ Yes, I meant house service ground. Can you replace the motor supply with perhaps a "brick" type supply that has a three prong plug? \$\endgroup\$ – SteveR Apr 22 '11 at 22:43
  • \$\begingroup\$ Yea I just found one today and ordered it. We will see how that goes. Hopefully it works out. I will let you know! \$\endgroup\$ – Noremac Apr 23 '11 at 1:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.