Go Down

Topic: connecting vss to gnd? (Read 905 times) previous topic - next topic

winner10920

I have two separate supplies on a board im designing, one is 12v 3a with a 7805 just to power the 328, the other is a supply for an hbridge which im guessing will be quite noisy
I have the 328 monitoring the current thru a opamp reading the voltage across a .1ohm current sense resistor on the low side of the hbridge supply, however this causes a need to connect my 12v ground to the ground of the other supply, is this a bad design? Is there a proper way to connect to two grounds?or even a way where I wouldn't have too? All I know is to only connect it on one place but nm else

MarkT

To sample that resistor's voltage accurately you need to ensure no signifcant IR voltages are developed across the ground connections involved.

In particular you should connect the ground line at the resistor's ground side to the Arduino board ground, using a twisted pair if possible with the signal wire (positive side of resistor to the analog pin).  This ground wire should not carry any current - ie the Arduino and 12V have independent power supplies.  That ground wire should ideally be the only common-ground connection.

Often this is hard to ensure, as the logic lines going to the H-bridge rightly has its own signal ground line(s).

One way round this is to take two analog lines from the resistor, one each side, to two analog pins - you take the difference in readings
to measure the voltage.  (Best done with a differential ADC rather than taking 2 readings separately in time).

Remember as that resistor is carrying significant current its ground side will rise above the 12V ground due to resistance losses in the wiring,
so its important to measure the actual voltage across the resistor as in these methods (otherwise you'll have to measure the stray resistances
to factor them into the equation)

If accuracy is less important, particularly if fairly low currents and high value of current-sense resistor are involved, then the simpler scheme of connecting grounds and not worrying about it will suffice.
[ I won't respond to messages, use the forum please ]

winner10920

It shouldn't be much more than 1/2 v across the resistor, that's what the opamp is for,
accuracy is important,  Im even gonna add a 10uh inductor for avcc, hopefully to get as much of the 10bit adc as I can get, im just worried about how the noise will affect it,
should I perhaps filter the connection between ground with like an lc circuit?  Or will that. Prob not be necessary ?

MarkT

Could add RC low pass on the signal line(s) to reduce noise - or filter it out in software - but note that current to a motor/controller
can be a very noisy signal in the first place, so low-pass filtering might be needed to keep things sensible.
[ I won't respond to messages, use the forum please ]

Grumpy_Mike

Quote
however this causes a need to connect my 12v ground to the ground of the other supply, is this a bad design?

No it is quite normal and it is required for your system to work, not only with the measurements but also with the control:-
http://www.thebox.myzen.co.uk/Tutorial/Power_Supplies.html

Quote
should I perhaps filter the connection between ground with like an lc circuit?

No definitely not. That would cause the two grounds to be at different voltage levels. This is known as ground bounce and can cause problems even when the grounds are connected directly together.

Quote
Is there a proper way to connect to two grounds?

It is called a star connection, all the grounds meet at one point, so in your case the two power supply grounds, the H-bridge ground and the arduino ground should all be at one physical point. That is not chained one to the other.

Quote
a way where I wouldn't have too?

This is caled isolation, it would require opto isolators for the arduino into the controls of the H-bridge and some form of galvanic isolation of the input voltage to the arduino. One way to do this is with an opto isolator with two photo transistors, one goes to the analogue input and the other acts as a feed back to an op amp on the H-bridge side, this is so you get a linear transfer.

oric_dan

G_M is right about the Star connection, the best way to avoid ground loops, the way
to connect muliple loads together.

On a single pcb with both uC and h-bridge, use 2 power input points on opposite sides
of the board. Connect h-bridge power on one side and uC power on the other. Use a
"single ground trace" only to connect the 2 sides together. It needn't be super wide, as
it will be carrying only minimal current. This trace will provide the return path for the
current-sense resistor ckt, so you needn't add any extra ground traces/etc.

If you ever want to power both sides using only one power source [may or may not work
well, due to motor noise], connect it to the h-bridge side to keep the high current flows
on that side of the board.

winner10920

Ok, so just one connection between the two, but is there any importance as to where that connection should be? I basically have two separate ground planes separated by a few millimeters,  i can add maybe a 16mil trace anywhere? Like middle or top
should I try and keep it closer to the circuit that needs the ground or should it not matter?

oric_dan

Even though I said there won't be much current in the "single" gnd trace connecting
the 2 sides, I always use 50-mil traces for grounds. Limits the trace resistance, and you
never know when someone will hook up the power on the wrong side, and pass 2-Amps
through your little 16-mil fuse [umm, trace].

You probably want the single point gnd connection located near to the 2 points where
the external power sources connect to the bd. This way any motor noise will not be
passing through all the rest of the onboard circuitry.

Go Up