Measureing Current across a H bridge with resistor?

Status
Not open for further replies.

ghostman11

Well-Known Member
hi all, i am working on a large, model railway layout, it has in excess of 200 electricaly isolated tracks. the plan is to drive theese sections of track with H Bridges using pic's and probally shift registers, however at the moment we also have a small oval 'testing track' with wich we are trying out various control methods etc. the following is a overall schematic of the H Bridge design we intend to use (please note ignore the transistor values on the drawing as theese havnt been decided yet so i used generic for the drawing).


now my question is... we want to be able to measure the current being drawn from the H bridge output from the track section, i have discounted things like high side chips etc due to the large number that would be needed eventualy, so i wondered if i conected a resistor as shown in the second drawing and conecting to the pic's AN0 would i be able to read the current? the exspected range of current would be from around 100ma to say 2.5-3A.
is this possiable or if not how would i do it?
many many thanks
 

Attachments

  • h bridge over view.png
    46 KB · Views: 209
  • resistor.png
    54.8 KB · Views: 173
I do not see where R12 and measuring voltage will give you any information.
I hope the emitters of Q3 & Q6 go to a supply.
If you disconnect the bottom transistors emitters from ground and connect them through a single 0.1 ohm resistor back to ground you can get a feel of the current flow. Connect AN0 to this point through a low pass filter to remove the AC noise. 0.1uf from AN0 to the micro's ground. 1k resistor from AN0 to the top of the 0.1 ohm resistor. 1V=10 amp. Your 0.1 to 3.3A will show as 0.01 to 0.3 volts.
 
thank you ron thats realy helpful advice!! infact no i didnt have the emitters of Q3 and Q6 connected!!! i will correct this thank you for spotting it! i will redo the drawing and repost so it can be checked. that deserves some quedos points me think
 
Put the sense resistor in series with the connection to the track and measure the voltage at both ends of the resistor.
Then current = (V1 -V2)/R.

Or put the resistor between the common connection to Q4+Q5 emitters and the 0v return to the supply.

Also, I guess that you are using PWM to control the speed of the train.
The A to D will have to be synchronised to the PWM pulses otherwise the readings will be all over the place.

JimB
 
modified

ok i think this is what was meant tho i confess to not getting the meaning of top and bottom of the resistor!! (sorry some stuff just dosnt get through to me after the stroke)
thanks for the tip jim i will be using pwm so will take the reading from AN0 when the signal is high on the pwm, also will a 0.1r 3W wire wound resistor be ok?
 

Attachments

  • modified.png
    58.2 KB · Views: 180

Hi,

They say the sense resistor should not be wire wound as it can introduce effects into the circuitry, though perhaps not as important of hobby use ?
I simply used several .6W Film resistors paralleled together.

Assume you are designing a dcc system ? - you might find the voltage from the sense resistor quiet small and very prone to spikes that will need a lot of 'conditioning' by your adc routine.

I built this simple circuit for a 4 channel dcc diy system, the emergency stop switch is essential.
Until you see it, if a fault develops and full power sent to the loco it literally takes off the track .
You might want to try building it and scope the signals so you can see what you are dealing with.

Interested to know what your 200 separate tracks with 200 H bridges are for ? something that big would have thought you need to use a well proven system ?
 

Attachments

  • overload.jpg
    201.3 KB · Views: 172
hi wp, the system isnt strictly speaking DCC, its a huge layout tho and the tracks have been isolated in many place's. the H bridge in the diagram is just for testing a couple of thing on a small oval circuit 8' x 4', its kind of a see if this works sorta thing . so i take it the diagram is ok to go ahead and board up?
many thanks chaps
 
Back in post #5, R13 should connect to the top end of the current sense resistor not the ground end.
 
cheers ron i had a dopey moment!!! good job i dont play with tesla coils lmao

hi J,
I guess you are going to use PWM to drive the bridges.?
If so it could be a little 'tricky' to measure the exact 'average' current flowing thru the bridge.??
E.
 
I agree with Eric Gibbs, measuring the current this way is not the best if the load is not pearly resistive. If you want to know the difference between 1A and 1.1A there are other ways. This is just a train track not an instrument.
 
i would like to hear what the other ways are??? maybe i can go down a different track (pun intended ) nothing is written in stone yet as i havent made the board (although its ready to go if i stick with this design) it dosnt have to be very accurate all i am looking for if there is a sudden jump of say 250ma. the next controller will be more accurate as it will use pwm and feedback if possiable. this controller is actualy for helping to design other parts of the layout. i will try and post pics of the layout so far, we hope to have all the track laid and to start wireing it up within 6 months.
 
as a side note if i wanted to measure the voltage again with the pic is it better to use a voltage regulator output to the v+ ref pin and gnd to the pics v-ref pin or dosnt it make much difference if the internal ref is used?
 
as a side note if i wanted to measure the voltage again with the pic is it better to use a voltage regulator output to the v+ ref pin and gnd to the pics v-ref pin or dosnt it make much difference if the internal ref is used?

hi J,
The internal Vref is OK at +5V.

E.
 
hi eric cheers mate. the internal should be fairly accurate as i have decided to stick a regulator on the 5v line anyway. this is actualy little ghostmans project but i seem to be doing most the work
 
hi wp i hadnt see that post! i will need to have a careful read but at first glance looks promissing thanks for the info much apreciated
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…