Voltage Range of Analog Inputs

Hi All,

What is the voltage range of analog inputs? In other words, a byte of 255 translates into how many volts?

Oh, and can anyone give the schematics for the current monitoring circuit?

-Thanks

i think the voltage range is 0-5V, but don’t quote me on this, i am only going from memory… anyone have an affirmative answer?

Yep…+0Vdc to +5Vdc…hence the +5Vdc on some of the analog port pins…

Does anybody know what is the maximum current that can go through the controller without burning it up? We are trying to figure out how to put a current monitoring circuit together, if anyone could give us hand we would greatly apreciate it. It is pretty hard to come up with one without any experience or engineers.

Eugene :confused:

*Originally posted by Eugene *
**Does anybody know what is the maximum current that can go through the controller without burning it up? We are trying to figure out how to put a current monitoring circuit together, if anyone could give us hand we would greatly apreciate it. It is pretty hard to come up with one without any experience or engineers.

Eugene :confused: **

I am wondering how you were thinking of doing this…it sounds like you want to somehow run something through the controller.

I would love to help, but I might need a little more information on what your thought are.

Actually, FIRST sent out a couple of good hints in the third update. (I think)

-Quentin

Forgive me if I’m blind, but the only reference to the electronics in the 3rd update that I saw was about the fuses, please correct me if I’m wrong.

The reason I’m asking this is because I wanted to build a custom circuit board that would monitor the current, and using the analog inputs on the controller input the data.

Problems with this idea:

  1. Is it legal to have the circuit board connected in a serial circuit to the motors, or the main braker? The current has to be measured in a serial circuit, right?

  2. Which transitors would have the correct rating to take the currents that might go as high as couple hundred AMPs?

  3. What is the maximum current that can go through an analog input on the controller?

And here is a unrelated question, do i need to have a power source when i connect a potentiometer (it is just a resitor right)?

Thank you all for helping us out!!!
We don’t have any proffesionals on outr team.

Eugene

I think the analog connector can only source something in the range of 50mA to the pins when the resistor is at a dead short (0 ohms) so I would guess this is a safe max amount. (The max rating is listed in the Innovation First instruction manual

Matt

To measure current from the battery (or to the motors for that matter), you should put a very low resistance shunt in series with the power lead. Technically it doesn’t matter which one but we use the positive lead. You then have a low voltage (in the millivolt range) that can be measured across the shunt and amplified (with a simple op-amp circuit) to accomodate the 0-5v of the A/D converter on the controller. We (Team 802) are measuring total battery current and that’s how we are doing it.

Correct me if I’m wrong. It’s been a while since I’ve had electronics. I do believe that if you hook an amp meter in series, you will here a loud and distinct pop of a fuse (a breaker if it’s a good one). I think you measure amperage in parallel and voltage in series. Don’t forget the difference between the two, it’s an important one…

Here’s a circuit I banged out that might be able to help you.

It has a small current sensing resistor in series with the battery and circuit breaker. The voltage across the resistor, which is proportional to the battery current, is determined and amplified by a difference amplifier circuit that has a gain of 25, which allows the 1 milliohm resistor to fill the available range on the A/D input. (200A through the circuit corresponds to 255 A/D counts). And the wheel on the bus goes round and round.

You might want to throw on an output filter to remove the PWM ripple, and perhaps another gain stage to fine tune the circuit’s range, but it should work reasonably well now.

Please note that Digikey doesn’t have any 1 milliohm resistors that can handle enough power to work here - so you have to ‘make’ your 1 milliohm resistor from five 5mOhm precision resistors, or ten 10mOhm precision resistors (in parallel). Five of these would be able to handle 24W continuously, which is short of the 40W required for the anticipated 200A spikes, but I think they would hold up in practice, because the average power dissapated would be well below 24W.

If you have any questions, let me know. I know that I didn’t document the image too well, but it shouldn’t be too hard to get the general idea.





*Originally posted by nwagers *
**Correct me if I’m wrong. It’s been a while since I’ve had electronics. I do believe that if you hook an amp meter in series, you will here a loud and distinct pop of a fuse (a breaker if it’s a good one). I think you measure amperage in parallel and voltage in series. Don’t forget the difference between the two, it’s an important one… **

Having just had General Electronnics I at the community college, I can say you’ve got your measurements reversed. Current is measured by breaking the circiut and placing a meter accross the break (series). Voltage can be measured at any point with respect to any other point (parallel).
Like you said, it’s important to remember the difference between current and voltage…

CURRENT is a measurement of the number of electrons flowing past a certian point in a given time frame. I’ve always pictured it as: you break the circiut, forcing all of the electrons to go through the meter, “counting” them.

VOLTAGE on the other hand is a measurement of potential. “Pressure,” if you will. When you measure voltage, you’ve to keep track of what point you are using as refrence. As such, you could wire a volt meter in series… but you’d read 0V. The difference in potential accross a perfect conductor is 0. (Try measuring the voltage drop accross a resistor, and then measure the voltage at a point with respect to ground…)

Of course, keep Mr. Ohm in mind! Voltage = Current * Resistance

Hope that helps!

Thanks, this was really helpful, without you guys I would have been lost.

Eugene

This all sounds pretty tricky to an escapee from M.E. land…

For my money, I would rather infer current. You know battery voltage. Assuming you have consistant batteries (big assumption I know), your battery has an internal resistance that will give you some information about battery current.

AND…

you can refine your estimates by doing a test. It would be possible for example to stall a motor of know resistance for a very short time (say by moving an arm against the stop), when you first install your battery or upon first power up.

If you watched battery voltage during this test, you could calibate your sensor (i.e. the built in battery voltage sensor) to various current levels. It would be also possible to give the motor several different voltages in order to get several data points.

For my money, this seems the better path than putting resistors in your battery path.

Joe J.

P.S. Of course, there are other ways to infer current as well, but that is a message for another day – perhaps for another year.

A lead-acid battery’s internal resistance actually depends upon the state of the battery’s charge, and the temperature. While you could use the drop in the battery’s voltage to determine the current that it’s sourcing, the calibration could vary greatly over the course of an event, and even over the course of a match.

Of course, now you’re going to come back and tell me that that’s what you do, and that it works fine, aren’t you? :slight_smile:

What we need to do is petition Innovation First to include a current monitoring output on their Victor speed controllers.

Many of the ideas presented here are good ones but there are some potential hazards.

  1. (My personal favorite) Measuring battery current on a working robot is best done with a current meter like an AmpProbe or other similar device. These are clamp on meters that will not put your controller (or you) in the presence of the several hundred amps that may be periodically delivered by your battery.
  2. I would frown on any resistance you add between the battery and controller. The controller resets at about 8 volts and a resistor will get you close under extreme loads. Feed the controller from the battery side of the resistance.
  3. If you are not sure how to do it, don’t connect circuitry to the robot controller inputs except as listed in the manual. A bad hit on the analog input is a fatal (i.e. permanent, non warranty) failure.
  4. Opening the circuit and inserting a voltmeter would prevent anything from working and should read near the battery terminal voltages. (Open circuit voltage)
  5. Much truth about the variable battery internal resistance, it also varies from unit to unit due to production variances. Ironically, it is the internal resistance that ends up dropping the available voltage to the robot during large current draws. When the voltage is so low that it drops below 8 volts (controller dropout) it is because four volts is being dropped across the internal resistance.
    Good Luck All,
    Al

A clamp-on meter would be the ideal case if you were just out to determine what current was being drawn. However, if you were out to monitor the current load on your battery so that you could either scale back the motor command in software to aviod tripping the breaker, or feed back the current draw to the driver so he can keep that in mind as he’s trying to win a shoving match, you would need something like what I posted.

The resisitors I recommended range from 1 to ten milliOhms. That’s on par with the resistance of the wire carrying the current to the battery, it’s just measured precisely. It is also much less than the battery’s internal resistance, so much so as to be irrelevant in a robot’s overall circuit.

Now, that’s not to say that there aren’t ways that one could do this wrong. Please get help if you don’t know what you’re doing, and test your circuit before connecting it to any competition hardware.

When I suggested that teams infer battery current, my real point is that there is no reason to put a so-called shut resistor in line with main battery feed because there IS a resistor in series with the battery already… …it is called the internal resistance of the battery! In fact, that is how simple battery models work – they simply put an ideal battery and an internal resistance value in series as the model of the battery. To first order, it is a pretty fair approximation.

The trick is that battery resistance is not completely fixed, it varies from battery to battery and (I am guessing) from a fully charged battery to a less fully charged battery. My proposal was just to get a fix on what that internal resistance was by putting another resistor across the battery leads (say a stalled motor) and then using the internal battery voltage measurement on the RC to infer the internal battery resistance. Knowing that resistance, it is not that hard to then watch battery voltage and infer what current is going through the battery.

Now, that is a lot of words and ideas, but in the end, I am not really recommending that anyone measure battery current because I think it is a red herring.

From my experience designing power hogging robots, I do not think very many teams will have trouble tripping the 60 Amp fuse. AND (more importantly) those few that do will not be likely to have the cleverness to make the current monitoring circuit work, yet alone do something intelligent with it once they HAVE a working current signal.

It is not a simple matter to go from current measurement to how soon will my breaker trip. Yes, you can easily just clip current to 60 Amps but that using sledgehammer to kill a gnat. Getting closer to the edge of tripping but NOT tripping is tricky business involving keeping track of current usage over time and estimating how hot the breaker is at this moment based on that current history. The problem is made even trickier when you start to realize that you should limit current not to what will trip the breaker in the next few seconds but before the match is over. Now you are really into the crystal ball realm.

My bottom line, finish your robot early. Give your drivers time to practice. If you see that it is possible to trip the breaker, try to engineer your way out of it by changing ratios for example. Failing that, have your drivers LEARN the edge of the cliff. With time, they will be better current monitors than anything you could code in Pbasic.

Just one man’s opinion.

Joe J.

Joe, you’re absolutely right.

What’s happened here is that we have a solution in search of a problem. The nifty new circuit board that we’re allowed to use is a great hammer, but determining the current load on the battery might not be the best nail for it.

Is measuring current through the custom circuit board possible, legal, and safe? Yes to all three. Is it useful or recommended for those not sure of what they’re doing? Probably not.

My team (118) will probably end up with a current measuring circuit board, and I’ll keep y’all posted with what we end up doing, and how well it works.

Kris

*Originally posted by verdeyw *
**Here’s a circuit I banged out that might be able to help you.

It has a small current sensing resistor in series with the battery and circuit breaker. The voltage across the resistor, which is proportional to the battery current, is determined and amplified by a difference amplifier circuit that has a gain of 25, which allows the 1 milliohm resistor to fill the available range on the A/D input. (200A through the circuit corresponds to 255 A/D counts). And the wheel on the bus goes round and round.

You might want to throw on an output filter to remove the PWM ripple, and perhaps another gain stage to fine tune the circuit’s range, but it should work reasonably well now.

Please note that Digikey doesn’t have any 1 milliohm resistors that can handle enough power to work here - so you have to ‘make’ your 1 milliohm resistor from five 5mOhm precision resistors, or ten 10mOhm precision resistors (in parallel). Five of these would be able to handle 24W continuously, which is short of the 40W required for the anticipated 200A spikes, but I think they would hold up in practice, because the average power dissapated would be well below 24W.

If you have any questions, let me know. I know that I didn’t document the image too well, but it shouldn’t be too hard to get the general idea. **

I like your idea, but I think the circuit might have a little problem if you use the 741 OP-Amp.

The problem is that of common mode voltage of the inputs. The circuit you have shows the 741 sensing close to it’s power rails, and I am pretty sure it is NOT capable of that.

I’m also not sure, but it looks as though you have it powered off of a 2nd battery, which might make it worst if it’s voltage is below that of the 12v robot battery.

We have actually built a circuit to measure motor currents, and it looks like it is working. We do have one little secret, which I will NOT devulge at this point…,and you have to trust me, I’m sure that others will be doing the same…but I don’t want to “crow” about it until I get it in it’s final form and working. (which is always a challange)

I will post a PDF of the schematic when it is finally all up and working.

Anyways, I like your difference amplifier circuit with minor change.

-Quentin

Measuring DC current: I would consider using either a Anisotropic Magnetoresistive (AMR), Giant Magnetoresistive (GMR) or Hall effect sensor, all of which they sell in the DigiKey catalog. They measure field strength and are non-contact.