Shop OBEX P1 Docs P2 Docs Learn Events
Voltmeter/Ammeter — Parallax Forums

Voltmeter/Ammeter

Justin SaneJustin Sane Posts: 35
edited 2006-05-09 00:58 in BASIC Stamp
I am looking for an effective method to read analog signals of Voltage and Amp with BS2. The purpose of this·is to measure the torque of electric motor.·I know that I will need analog module, and I am still rookie in this field.

Any suggestions would be apperciated!

Justin



P.S.

Is this effective way to measure electric motor

(Torque times angular speed) divide by (Voltage times Current)?

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·"Imagination is the one weapon in the war against reality."
-Jules de Gaultier

Comments

  • stamptrolstamptrol Posts: 1,731
    edited 2006-03-27 18:08
    Justin,

    This is a pretty straight-forward application. I'd use an LTC1298 a/d chip ( available from Parallax or Digi-key ). It gives you two 12-bit analog channels and is easy to interface. Depending on how you measure the current, you may need an amplifier circuit, too.

    Your formula will be OK for DC motors. AC calcs will have to take into account the power factor.

    You don't say how fast you want the updates to be, but you can probably make the readings, do some calculations and carry out some control functions at a couple of times per second.

    Cheers
  • allanlane5allanlane5 Posts: 3,815
    edited 2006-03-27 20:13
    Current reading can be tricky. Typically, people use a known-value 'shunt' resistor in series with the current, and then measure the voltage across this resistance. This is tricky because if you get the grounds wrong you'll be measuring the 120 volts line voltage instead of the milli-volt delta across the shunt. Most IC's (including the BS2) will burn up big time if connected across 120 volts.

    There's IC's with built-in shunt resistances for this purpose, though. Just be careful out there.
  • Justin SaneJustin Sane Posts: 35
    edited 2006-03-27 22:03
    stamptrol said...
    Justin,

    This is a pretty straight-forward application. I'd use an LTC1298 a/d chip ( available from Parallax or Digi-key ). It gives you two 12-bit analog channels and is easy to interface. Depending on how you measure the current, you may need an amplifier circuit, too.

    Your formula will be OK for DC motors. AC calcs will have to take into account the power factor.

    You don't say how fast you want the updates to be, but you can probably make the readings, do some calculations and carry out some control functions at a couple of times per second.

    Cheers

    Forgive me for not being clear enough.

    Currently I am trying to measure current/voltage of two paralleled 24volt DC motor (maybe I will increase it to 30v) running on lithium-ion battery.

    12 bits is more than enough for me, I am thinking about ordering one. Thanks! smilewinkgrin.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·"Imagination is the one weapon in the war against reality."
    -Jules de Gaultier

    Post Edited (Justin Sane) : 3/27/2006 10:10:26 PM GMT
  • Justin SaneJustin Sane Posts: 35
    edited 2006-03-27 22:08
    allanlane5 said...
    Current reading can be tricky. Typically, people use a known-value 'shunt' resistor in series with the current, and then measure the voltage across this resistance. This is tricky because if you get the grounds wrong you'll be measuring the 120 volts line voltage instead of the milli-volt delta across the shunt. Most IC's (including the BS2) will burn up big time if connected across 120 volts.

    There's IC's with built-in shunt resistances for this purpose, though. Just be careful out there.

    Do you mean that I will need to read voltage to find Current by using ohm's law? I am not quite sure if I understand how shunt resistor works.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·"Imagination is the one weapon in the war against reality."
    -Jules de Gaultier

    Post Edited (Justin Sane) : 3/27/2006 10:11:06 PM GMT
  • Paul BakerPaul Baker Posts: 6,351
    edited 2006-03-27 22:21
    Yes you are correct, current is measured by measuring the voltage drop across a small value/high current capacity resistor then using ohms law to figure out the current. Since you seem to be putting this in a permanent installation, you dont need to worry about it being hooked up wrong (except when you originally put it together). To be perfectly explicit, it should be put in series with the motor (placed between the motor and battery), it should be a fraction of an Ohm and it should be a power resistor capable of carrying a current a sizable amount above the stall current for the motor (not only do you want to avoid the resistor exploding, but many resistors will change thier ohmage when placing alot of current through them (with respect to thier designed current carrying capability) which will skew your measurments.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·1+1=10
  • allanlane5allanlane5 Posts: 3,815
    edited 2006-03-27 22:25
    Oh, and at 24-volts, a paper-clip makes an ok low-resistance high-current resistor.

    Glad to know you're not trying this with 120 volts AC.
  • Justin SaneJustin Sane Posts: 35
    edited 2006-03-29 13:18
    Some kind of drawing will be helpful, I am still little confused.

    I know how ADC works, but how can I send the info of Voltage and Amp as analog signal to input?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·"Imagination is the one weapon in the war against reality."
    -Jules de Gaultier
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2006-03-29 13:34
    Justin -

    You will be measuring the analog voltage DROP across the shunt. That analog voltage will be converted to a digtal value in the ADC, and then read into the PBASIC Stamp. Once you have that value, you will mathematically determine the amperage represented by that voltage drop across the known resistance of the shunt, using Ohm's Law.

    Regards,

    Bruce Bates

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    <!--StartFragment -->
  • Kaos KiddKaos Kidd Posts: 614
    edited 2006-03-29 17:27
    Allan...
    A paperclip... I would have never tought... unless I was forced with a need... [noparse]:)[/noparse]

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Just tossing my two bits worth into the bit bucket


    KK
    ·
  • allanlane5allanlane5 Posts: 3,815
    edited 2006-03-29 17:34
    Thanks. I got the Paper-clip concept from an article in Byte magazine, in the Circuit Cellar column, by Steve Ciarcia. It's very clever though -- paper-clips are made from steel, which has enough resistance to be useable in 2-inch lengths or so, and they disappate heat reasonably well.
  • Tracy AllenTracy Allen Posts: 6,658
    edited 2006-03-29 17:52
    Justin Sane said...
    Some kind of drawing will be helpful, I am still little confused.

    I know how ADC works, but how can I send the info of Voltage and Amp as analog signal to input?

    Here is a bit of a diagram.

    attachment.php?attachmentid=41011
    The current sensing resistor is in series with the motor on the ground side, and as shown it is 0.1 ohms, so it develops 0.1 volt per amp. The op-amp amplifies that times 10 to put 1 volt per amp into the ADC. I don't know what currents you are dealing with, but the resistor values would be adjusted accordingly to scale it right.

    There is a voltage divider across the motor. It would probably be a good idea to add a capacitor to filter out noise. The voltage across the motor is less by the amount across the 0.1 ohm resistor, and you can either account for that in the calculation, or ignore it.

    The 0.1 ohm resistor is drawn to suggest a Kelvin connection. All that means is that you can't ignore the effect of the rest of your wiring and connections in relation to 0.1 ohm, whether you use a paper clip or a professional type Kelvin wired (4 terminal) shunt.

    In some cases it may not be advisable to break the motor wire on the ground side to iinstall the shunt. There are circuits for sensing on the high side too, but they are a little more involved. Also, since this is a moto, the op-amp will need a protection circuit at its input.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com

    Post Edited (Tracy Allen) : 3/29/2006 5:55:14 PM GMT
    342 x 144 - 4K
  • Justin SaneJustin Sane Posts: 35
    edited 2006-03-29 20:57
    thanks bunches, you guys.

    I really appericate it! smile.gif


    I'm going to try it this weekend, but one more question.

    I just dont want to overkill my design, so I am wondering if this is good shunt for me to use? (I want stable component)
    http://www.allelectronics.com/cgi-bin/item/FL-30A/search/SHUNT_FOR_30ADC_METER_(PMD-30A)_.html

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·"Imagination is the one weapon in the war against reality."
    -Jules de Gaultier
  • allanlane5allanlane5 Posts: 3,815
    edited 2006-03-29 22:09
    Good idea. The problem is, I can't tell from that website what the actual resistance of the shunt is, nor the full-range voltage of the meter it goes with.

    But you KNOW it will stand up to 30 Amps, so that's probably a good idea.
  • Justin SaneJustin Sane Posts: 35
    edited 2006-03-30 02:52
    allanlane5 said...
    Good idea. The problem is, I can't tell from that website what the actual resistance of the shunt is, nor the full-range voltage of the meter it goes with.

    But you KNOW it will stand up to 30 Amps, so that's probably a good idea.

    Do I really need to know the actual resistance before I buy it? Cant I just check its resistance with my DMM and program off that?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·"Imagination is the one weapon in the war against reality."
    -Jules de Gaultier
  • Tracy AllenTracy Allen Posts: 6,658
    edited 2006-03-30 05:34
    DMMs are not good at measuring low resistances. Shunts typically produce 50 millivolts at full rated current, in which case R = 0.05 / 30 = 0.00167 ohm. Compare that to the lowest scale on your DMM. But they don't tell you the scale factor, only that is goes with the panel meter they are selling along side it.

    This one is a better bet:

    www.allelectronics.com/cgi-bin/item/SNT-25/search/25_AMP_SHUNT,_50MV=25A_.html

    They tell you, 50mV at 25 amps. Observe the 4 termnals, two for the high current and two to tap in for the measurement.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • Justin SaneJustin Sane Posts: 35
    edited 2006-04-02 03:03
    let me try again.


    So heres my schematics, I need some help. From what I see, I think that op amp is built in LTC1298, am I wrong?


    I have feeling that theres something missing between shunt resistor and LTC1298. I know that there have to be some kind of resistor to protect the ADC and basic stamp itself.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·"Imagination is the one weapon in the war against reality."
    -Jules de Gaultier

    Post Edited (Justin Sane) : 4/2/2006 1:48:49 PM GMT
    985 x 623 - 62K
  • Justin SaneJustin Sane Posts: 35
    edited 2006-04-02 03:17
    Tracy Allen said...
    DMMs are not good at measuring low resistances. Shunts typically produce 50 millivolts at full rated current, in which case R = 0.05 / 30 = 0.00167 ohm. Compare that to the lowest scale on your DMM. But they don't tell you the scale factor, only that is goes with the panel meter they are selling along side it.

    This one is a better bet:

    www.allelectronics.com/cgi-bin/item/SNT-25/search/25_AMP_SHUNT,_50MV=25A_.html

    They tell you, 50mV at 25 amps. Observe the 4 termnals, two for the high current and two to tap in for the measurement.

    Thanks for your suggestion

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·"Imagination is the one weapon in the war against reality."
    -Jules de Gaultier
  • Tracy AllenTracy Allen Posts: 6,658
    edited 2006-04-02 20:19
    Hi Justin,

    A couple of things don't make sense about the schematic. Are you expecting this circuit to measure both the voltage and the current of the motor? It won't do that as shown.

    The circuit as shown with the differential connection to the shunt could measure the current. But in answer to your question, the op amp is not built into the LT1298. The resolution as shown is 0.00122 volt per bit, so with a 50 millivolt shunt, you will see only 41 steps at full scale. If it is a 25 amp, 50 millivolt shunt, the resolution will be a measly 0.61 amps. Also in answer to your question, it would indeed be a good idea to put protection resistors(~10k each) in series with the ch0 and ch1 pins of the LT1298.


    Are the power supplies for the LTC1298 and the motor & throttle completely separate, or do they share a power source in common? I don't see why power for the throttle circuit comes from a tap on the motor. What kind of motors are these, anyway?


    If you are expecting the circuit to measure both motor current and voltage, it will have to be rearranged substantially, and the LTC1298 will have to share a carefully chosen common ground with the motor circuit. Let me know if that is what you want to do.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • Justin SaneJustin Sane Posts: 35
    edited 2006-04-02 23:51
    Tracy Allen said...
    Hi Justin,

    A couple of things don't make sense about the schematic. Are you expecting this circuit to measure both the voltage and the current of the motor? It won't do that as shown.

    The circuit as shown with the differential connection to the shunt could measure the current. But in answer to your question, the op amp is not built into the LT1298. The resolution as shown is 0.00122 volt per bit, so with a 50 millivolt shunt, you will see only 41 steps at full scale. If it is a 25 amp, 50 millivolt shunt, the resolution will be a measly 0.61 amps. Also in answer to your question, it would indeed be a good idea to put protection resistors(~10k each) in series with the ch0 and ch1 pins of the LT1298.


    Are the power supplies for the LTC1298 and the motor & throttle completely separate, or do they share a power source in common? I don't see why power for the throttle circuit comes from a tap on the motor. What kind of motors are these, anyway?


    If you are expecting the circuit to measure both motor current and voltage, it will have to be rearranged substantially, and the LTC1298 will have to share a carefully chosen common ground with the motor circuit. Let me know if that is what you want to do.

    I am trying to measure voltage drop, in order to be able to use ohm law for current. Honsetly, I have no experience with measuring shunt with ADC. I looked all over internet, and I couldnt find anything in handyman's term.

    I am not really sure what kind of motor it is. All I know that it has a built in power supply for analog switch, such as hall effect or potentmeter.

    I was told that I might will need to use Op-amp, but I am not sure about that.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·"Imagination is the one weapon in the war against reality."
    -Jules de Gaultier
  • bennettdanbennettdan Posts: 614
    edited 2006-05-09 00:58
    Hey Justin
    Jameco has a 0-50mv output shunt that can handle 50amps the part# is 162309CC.
Sign In or Register to comment.