Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Technical Discussion (http://www.chiefdelphi.com/forums/forumdisplay.php?f=22)
-   -   MicroControllers at competitions (http://www.chiefdelphi.com/forums/showthread.php?t=123053)

yash101 12-12-2013 13:01

MicroControllers at competitions
 
I know it is a tad early for me to post about this, but I think that when I go to competition, I should take a Propeller Chip, MCP3204, a 120Amp shunt resistor, and some other various things. The reason why is because last year, we experienced the problem that our shooter motors kept dying and we had no way to measure the motor's current draw (because we didn't want to damage our fluke by a current spike). What do you guys think of this idea to aid in competition debugging?

Al Skierkiewicz 12-12-2013 13:30

Re: MicroControllers at competitions
 
Dev,
You are asking for a 0.1 ohm/1500 watt resistor. Do you have those laying around?
http://store.mwands.com/diversion-du...12-24-48-volt/

RyanCahoon 12-12-2013 13:32

Re: MicroControllers at competitions
 
Out of curiosity, what motors were you using?

Are you thinking for in-match debugging, or in the pits? Be aware that in-line current monitoring has been illegalrestricted by past years' rules.

Seems like this would be a good thing to have tested enough in your shop to know that the motors wouldn't die. That way you have time if you need to adjust gear ratios, etc.

Speaking of Fluke, what about an AC/DC clamp-on current meter?

RyanCahoon 12-12-2013 13:38

Re: MicroControllers at competitions
 
Quote:

Originally Posted by Al Skierkiewicz (Post 1311272)
Dev,
You are asking for a 0.1 ohm/1500 watt resistor. Do you have those laying around?
http://store.mwands.com/diversion-du...12-24-48-volt/

Al,
What's the difference between the device you linked and this one: http://www.amazon.com/Amico-current-.../dp/B008SOXFZC ?

Ether 12-12-2013 16:07

Re: MicroControllers at competitions
 
Quote:

Originally Posted by RyanCahoon (Post 1311273)
Be aware that in-line current monitoring has been illegal by past years' rules

Depends on how you do it I would think. What rule did you have in mind?



Ether 12-12-2013 16:14

Re: MicroControllers at competitions
 
Quote:

Originally Posted by RyanCahoon (Post 1311276)
What's the difference between the device you linked and this one: http://www.amazon.com/Amico-current-.../dp/B008SOXFZC ?

Yours is 200 amps at 0.075 volts (shunt)

Al's is 125 amps at 12 volts (load resistor)




Ether 12-12-2013 16:20

Re: MicroControllers at competitions
 
Quote:

Originally Posted by Al Skierkiewicz (Post 1311272)
You are asking for a 0.1 ohm/1500 watt resistor.

His post was admittedly somewhat ambiguous, but that's not the way I interpreted it.

I think he wants to insert the shunt in series in one of the motor leads and measure the voltage drop across it to get current.

Aside from questions of FRC legality, the shunt Ryan linked would would work: it would dissipate roughly 7 watts at 133amps:

0.075V/200A = 375e-6 Ohms. 133amps * 375e-6 ohms = ~7watts.

As you have previously pointed out on many occasions Al, instead of a shunt the voltage drop across a length of existing wiring would suffice to get a rough measure of current (for large currents).



magnets 12-12-2013 16:33

Re: MicroControllers at competitions
 
Quote:

Originally Posted by yash101 (Post 1311264)
I know it is a tad early for me to post about this, but I think that when I go to competition, I should take a Propeller Chip, MCP3204, a 120Amp shunt resistor, and some other various things. The reason why is because last year, we experienced the problem that our shooter motors kept dying and we had no way to measure the motor's current draw (because we didn't want to damage our fluke by a current spike). What do you guys think of this idea to aid in competition debugging?

Your multimeter (should) have a fuse to protect itself from current, so you should be all set.

What does the current draw tell you? Our team has attended 42 robotics competitions, countless offseason, and have played close to 1000 matches. We have never needed to measure the current draw of a motor at competition, nor have we heard of anybody needing to.

Andrew Schreiber 12-12-2013 16:35

Re: MicroControllers at competitions
 
Quote:

Originally Posted by magnets (Post 1311345)
Your multimeter (should) have a fuse to protect itself from current, so you should be all set.

What does the current draw tell you? Our team has attended 42 robotics competitions, countless offseason, and have played close to 1000 matches. We have never needed to measure the current draw of a motor at competition, nor have we heard of anybody needing to.

I've used the current monitoring in Jags to diagnose binding in the drivetrain (old robot had picked up some gunk and locked up one side of the drive) as well as to identify that we were initially over geared this year. It's useful data to have for debugging.

magnets 12-12-2013 16:37

Re: MicroControllers at competitions
 
Quote:

Originally Posted by Andrew Schreiber (Post 1311346)
I've used the current monitoring in Jags to diagnose binding in the drivetrain (old robot had picked up some gunk and locked up one side of the drive) as well as to identify that we were initially over geared this year. It's useful data to have for debugging.

Was there anything you couldn't measure with a multimeter? A clamp on ammeter costs $60. The shunt resistor costs over $100.

Andrew Schreiber 12-12-2013 16:43

Re: MicroControllers at competitions
 
Quote:

Originally Posted by magnets (Post 1311348)
Was there anything you couldn't measure with a multimeter? A clamp on ammeter costs $60. The shunt resistor costs over $100.

Dunno, didn't need to. We had Jags on a CAN bus so it was baked in for us. But my gut feeling is no, a clamp on ammeter woulda been fine.

Ether 12-12-2013 16:47

Re: MicroControllers at competitions
 
Quote:

Originally Posted by magnets (Post 1311348)
The shunt resistor costs over $100.

$100 ?? The shunt resistor Ryan linked costs $7.52

Or don't even use a shunt. Just measure the voltage drop across a length of existing wiring.



Ether 12-12-2013 16:50

Re: MicroControllers at competitions
 
Quote:

Originally Posted by yash101 (Post 1311264)
last year, we experienced the problem that our shooter motors kept dying and we had no way to measure the motor's current draw

Are you reluctant to post some details of your shooter design? If you would do that, there are people here who could walk you through the math and show you what you were doing wrong.



FrankJ 12-12-2013 16:53

Re: MicroControllers at competitions
 
Beware that most current clamps measure AC only. The DC capable ones tend to be expensive.

magnets 12-12-2013 16:54

Re: MicroControllers at competitions
 
Quote:

Originally Posted by FrankJ (Post 1311357)
Beware that most current clamps measure AC only. The DC capable ones tend to be expensive.

Here's a 400 amp dc one for $50.

http://www.sears.com/craftsman-digit...p-03482369000P

RyanCahoon 12-12-2013 17:12

Re: MicroControllers at competitions
 
Quote:

Originally Posted by Ether (Post 1311339)
Depends on how you do it I would think. What rule did you have in mind?

Thanks for catching my error (again :o ). I've edited my original post. Contrary to the wording of my original post, I was only thinking of the general "custom circuits can't affect power pathways" rule and forgot the exception for low-impedance current monitoring. Presumably (0.075 volts) / (200 amperes) = 0.000375 ohms is low impedance...

Quote:

Originally Posted by Ether (Post 1311342)
Yours is 200 amps at 0.075 volts (shunt)
Al's is 125 amps at 12 volts (load resistor)

Oh that makes sense. I was reading the 12V as a safety rating or something along those lines.

Quote:

Originally Posted by magnets (Post 1311345)
Your multimeter (should) have a fuse to protect itself from current, so you should be all set.

Well it would be good to check the rating on the multimeter first. Not worth blowing unnecessary fuses. Also make sure that the probe leads are large enough to handle the current as well.

aldaeron 12-12-2013 18:15

Re: MicroControllers at competitions
 
Quote:

Originally Posted by magnets (Post 1311358)

I own one of these and used it last season for measuring shooter motor current. Works great and is easy to attach to various motors on your robot

-matto-

yash101 12-12-2013 18:49

Re: MicroControllers at competitions
 
Sorry. I just got home from school. I don't have one yet, but I was thinking of a very small shunt. The main point of this would be to find shorts. Also, I don't think it is illegal. You can have things between motors, as long as they don't change the power. In this case, the power difference would be so minuscule, that it would just be ignored. I wanted to use Ohm's law to get a precise measurement of a high amperage. For that, I wanted to use the MCP3204 ADC to measure the voltage drop, and plug that into the formula, to get the exact amp draw. Last year, that would have been useful because we had no idea how to check what was shorted, so we had to use trial and error. It would have told that our motor controller was shorted (though we could tell because of hot the wires were getting!)

EricH 12-12-2013 20:50

Re: MicroControllers at competitions
 
Quote:

Originally Posted by yash101 (Post 1311397)
Sorry. I just got home from school. I don't have one yet, but I was thinking of a very small shunt. The main point of this would be to find shorts. Also, I don't think it is illegal. You can have things between motors, as long as they don't change the power. In this case, the power difference would be so minuscule, that it would just be ignored.

Ahem. Please Read the Rules Carefully.

You're almost correct, but you're missing one minor detail: It's power pathways that can't be changed (R54, 2013 rules)--if changing the power was all, there's a number of things that could probably be really bad that could happen. Except, as noted, for low-impedance current monitoring, such that the effect on outputs is inconsequential. Hmmm... how hard would it be to get a current sensor, wire it into the robot's own control system, and have a way to store and extract data from it? Hmmm... Must think about that one for a few minutes.

Yep. Totally possible, and plausible. You're the programmer, you get to figure out how to pop up the current info for any motor at any point during a match and/or log it for future reference. (Hint: I know it CAN be done.)

yash101 12-12-2013 21:11

Re: MicroControllers at competitions
 
It can be done. Quite easily, actually. However, using an MCU is a cheap and dirty way to get it done quickly. You can code an MCU much faster than you can code the cRIO!
Also, the current pathway isn't being changed. It is just being passively monitored using sigma-delta circuitry!

MikeE 12-12-2013 23:46

Re: MicroControllers at competitions
 
Quote:

Originally Posted by RyanCahoon (Post 1311276)
Al,
What's the difference between the device you linked and this one: http://www.amazon.com/Amico-current-.../dp/B008SOXFZC ?

Off topic but I can't help but chuckle at Amazon's shipping info tag "Ordering for Christmas?"

I can just imagine the little 'uns eagerly tearing open the wrapping paper under the tree, hoping after hope that they were on Santa's nice list...

MikeE 13-12-2013 00:11

Re: MicroControllers at competitions
 
Quote:

Originally Posted by yash101 (Post 1311496)
It can be done. Quite easily, actually. However, using an MCU is a cheap and dirty way to get it done quickly. You can code an MCU much faster than you can code the cRIO!
Also, the current pathway isn't being changed. It is just being passively monitored using sigma-delta circuitry!

Dev - there is a substantial hint (by Eric two posts above mine) that there's already a microcontroller-based current monitoring solution widely used by FRC teams.

By all means think through how you would solve the problem yourself - in fact it's encouraged - but also check into existing solutions.
The first step in any research project is to survey the literature, i.e. read around first.

Al Skierkiewicz 13-12-2013 09:20

Re: MicroControllers at competitions
 
As Ether has pointed out above, wire is a known resistance for length and can be easily monitored in much the same way as you propose for your shunt. A 1 foot piece of #10 wire will drop 0.1 volts at 100 amps. Inserting a shunt resistor in the pathway (wiring) feeding a speed controller does violate the rules as Eric pointed out above. The Jaguar has a resistor built into the input side of the controller to generate the current reading available on the CAN buss.
The clamp on ammeters may give you a false reading do to the switching load of an operating controller. Look at frequency response for the device you are considering or using. For most applications the switching frequency of the Victor is within spec while the Jaguar is not. Your mileage will vary.
Magnets, it would help if we knew what your team number is when you refer to team history.
A good method for diagnosing shorted device problems is simply to pull all the breakers except for the the DSC and then add them back one at a time until you find the offending device.

yash101 13-12-2013 15:33

Re: MicroControllers at competitions
 
I was thinking of using this method because it seems simple, and easy to calculate. E=I/R; I=E/R
That means that the voltage reading you get will be equal to the amperage/the shunt resistance. I want a low vRef to help me get a much better resolution! This should give me the exact value.
Anyways, you can measure the voltage drop and you know the resistance, so I=E/R

If you are measuring a 1 volt drop, and your resistance is .25 ohms, you will have: 1/.4, or 4 amps going through the circuit. Say you have a .025 ohm resistor (much more likely in FIRST), and you have a 1.024 volt drop, you have 1.024/.025, or 40.96 amps going through the circuit.
Now, say:
R(shunt)=.025ohm
V(drop)=4v096 (4.096 volts)
4.096/.025=163.84 Amps running through the circuit.
If you see that constantly, you know that there is a fault, and you know to fix the fault. I'd say, have code ready to put on the cRIO that cycles through your robot's motors at 100%. You can write down each current value, and if it seems excessive, you know to change the motor AND the motor controller!

MAKE SURE YOU CHANGE BOTH THE MOTOR AND THE MOTOR CONTROLLER. IF YOUR MOTOR IS BY CHANCE BAD, YOU CONTROLLER MAY DIE. VICE VERSA! (I think that the caps were required ;)

Ether 13-12-2013 18:47

Re: MicroControllers at competitions
 
Quote:

Originally Posted by yash101 (Post 1311809)
Now, say:
R(shunt)=.025ohm

The impact of an added 0.025 ohms series resistance on the motor power is not insignificant.

If you don't know how to do the calculation for that, ask and people will be glad to help you.



yash101 13-12-2013 19:04

Re: MicroControllers at competitions
 
Yeah. That's the main point: To get a reading without having a significant impact. I think something like this is called a "sense resistor"?

Dad1279 13-12-2013 19:22

Re: MicroControllers at competitions
 
Instead of a shunt resistor, Honeywell makes sensors that don't interrupt the circuit (senses current through wire like a clamp-on ammeter)

one example is: http://www.digikey.com/product-searc...=0&pageSize=25

Ether 13-12-2013 19:24

Re: MicroControllers at competitions
 
Quote:

Originally Posted by yash101 (Post 1311890)
Yeah. That's the main point

Maybe it's just me, but that sure didn't seem like the main point of your post. It sounded like you thought 0.025 ohms would be a good value to use.



Al Skierkiewicz 13-12-2013 22:08

Re: MicroControllers at competitions
 
Dev,
To put this in perspective, 0.025 ohms is equivalent to 25 feet of #10 wire or 12 feet of #12. It is also twice the internal resistance of the battery. That steals a lot from the motor(s) you are monitoring. So once you are drawing enough current to drop 4 volts at the resistor you will be dropping 2 volts across the internal resistance of the battery. At 5.5 volts, the regulator in the DSC gives out and stops producing PWM to the speed controllers.

yash101 13-12-2013 23:25

Re: MicroControllers at competitions
 
.025 ohms was just a practical example. In real time, I would use a 25mOhm resistor, and a 1v Vref on the MCP3204. That should reduce the drop significantly, without getting rid of the precision!
What do you guys think of this


Also, about the inductance-based current sensors, don't you need a circuit to constantly monitor it if you are using DC? Won't only the changes in amperage be shown? This still seems to be quite a simple way of getting a very accurate read of the current consumption! I think that this was of induction-based current sensing is relative, not absolute. This is what I learned when I went job shadowing at SRP. They use donuts, secondary coils for the wire, allowing them to read how much current is passing. Maybe I could do an experiment on a compass near a weak magnet, and this and see if the deflection changes as more power goes through!

Ether 14-12-2013 11:09

Re: MicroControllers at competitions
 
Quote:

Originally Posted by yash101 (Post 1312006)
.025 ohms was just a practical example

It's not practical. .025 ohms will have a significant effect on motor torque.

Quote:

In real time, I would use a 25mOhm resistor
25mOhm is .025 ohms.


Quote:

Also, about the inductance-based current sensors, don't you need a circuit to constantly monitor it if you are using DC?
A clamp-on DC ammeter uses a Hall Effect device to sense the static magnetic field created by the DC current.



yash101 14-12-2013 11:16

Re: MicroControllers at competitions
 
Quote:

Originally Posted by Ether (Post 1312146)
It's not practical. .025 ohms will have a significant effect on motor torque.

25mOhm is .025 ohms.


A clamp-on DC ammeter uses a Hall Effect device to sense the static magnetic field created by the DC current.



Sorry. I confused mOhms with uOhms!

I think it would be better to skip the resistor and bring along a foot of gauge 8 wire. That aught to do it without over-dropping the voltage.

Using a hall-effect sensor is a different way of thinking about it! I was thinking about measuring current by creating a transformer, with the second winding as a coil around the main wire!

gpetilli 14-12-2013 14:42

Re: MicroControllers at competitions
 
If you are truly looking at shunt resistors <<25mohm you absolutely should use the voltage across the wire from the PDB to the speed controller. The resistance of the wire per foot is easily found online and will be just as accurate as a resistor you could afford to add - plus its FREE. Just put a volt meter across the wire (or add your micro-controller). If you are looking for a failure, the difference between 133 amps and 125 amps is not really relevant anyway.

Joe Ross 14-12-2013 15:03

Re: MicroControllers at competitions
 
Quote:

Originally Posted by yash101 (Post 1312149)
Sorry. I confused mOhms with uOhms!

Assume you use a 25µΩ resistor. At 100 amps, how much voltage drop would there be? How many useable bits of resolution would there be between 0 amps and 100 amps with your ADC?

yash101 14-12-2013 16:54

Re: MicroControllers at competitions
 
To increase the 12 bit resolution, I want to decrease the vRef voltage to something like 1v or .1 v, etc.

gpetilli 15-12-2013 13:00

Re: MicroControllers at competitions
 
Quote:

Originally Posted by yash101 (Post 1312529)
To increase the 12 bit resolution, I want to decrease the vRef voltage to something like 1v or .1 v, etc.

As someone who designs ADCs for a living, I strongly recommend against using a Vref less than 1v. At 1volt each count of yor ADC is already 25uv and noise of a CMOS amplifier is about 10uV. The best answer is to use a resistor that gives you a voltage that matches the input range of your ADC. I still think the suppy wire is in the right range. The key is to use a high impedance sense circuit with a Kelvin connection in parallel with the supply routing to the speed controller so a not to influence the system performance.

Al Skierkiewicz 15-12-2013 15:05

Re: MicroControllers at competitions
 
Dev,
Your original statement about DC is true for transformers. You only get an output when the input (primary) is a varying voltage. In a transformer, when you switch on a DC current, the secondary will produce an output during the transition and then settle back to zero. That is why Hall effect devices are used for current monitoring in DC applications.

yash101 15-12-2013 16:27

Re: MicroControllers at competitions
 
That makes sense. Does anyone have a good place for me to grasp info on how hall-effect sensors work? I am interested in these neat devices! :)

techhelpbb 15-12-2013 16:40

Re: MicroControllers at competitions
 
Quote:

Originally Posted by yash101 (Post 1312976)
That makes sense. Does anyone have a good place for me to grasp info on how hall-effect sensors work? I am interested in these neat devices! :)

2 for one - tutorials and something specific for hall effect sensors.

http://www.electronics-tutorials.ws/...ll-effect.html

So has anyone used a length of wire, resistor or hall effect sensor on a fielded robot as a current sensor?

Alan Anderson 15-12-2013 21:27

Re: MicroControllers at competitions
 
Quote:

Originally Posted by techhelpbb (Post 1312981)
So has anyone used a length of wire, resistor or hall effect sensor on a fielded robot as a current sensor?

At IRI a few years ago, I know a few robots had self-contained logging hall-effect current sensors strapped against the battery leads. I don't remember finding out who was responsible for them.

Joe Ross 15-12-2013 21:45

Re: MicroControllers at competitions
 
Quote:

Originally Posted by Alan Anderson (Post 1313091)
At IRI a few years ago, I know a few robots had self-contained logging hall-effect current sensors strapped against the battery leads. I don't remember finding out who was responsible for them.

FIRST was trying to determine current draw in order to set the requirements for the 2009 PDB.

Al Skierkiewicz 16-12-2013 07:40

Re: MicroControllers at competitions
 
WildStang manufactured a current monitor called StangSense a number of years ago. We used a one foot piece of #10 wire and a current monitor circuit from Maxim. We then ported the data to the robot data link and recorded the data at the driver's station. I believe the file is still on CD someplace.
The current monitor that was added to robots at IRI was from HQ. They wanted to gather data to confirm the high current spikes I had mentioned in conversation. The data recorders were supervised by Wayne Penn as I remember.

Dad1279 28-12-2013 12:37

Re: MicroControllers at competitions
 
http://www.andymark.com/product-p/am-2709.htm

New product from AndyMark, using a Hall-Effect, but needs to be inserted in the circuit.


All times are GMT -5. The time now is 03:57.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi