![]() |
Current Monitoring system questions
hello, gots some questions on something im developing for the 2003 bot
my idea is to have several taps on the motors/compressor to record all the voltage levels of them and send that data into the RC.. then put it thru the V= i*r formula to get the current of a particular device. i figured the R of the wire isnt gonna change that much in a 2 minute compeition, so im pretty well off setting that as a constant. then the other half is getting one of the BS2's we got laying around to talk to the Dashboard port of the OI and send the stuff across to be displayed on a LCD mounted in the comtrol system. i know how to do all of the programming for this.. minus the communication part. every time i have tried to duplicate the Serin command used in the RC, i get a stamp error.. so i can only assume that the form they use is for IFC stuff only. well, if you have any suggestions... please drop me a line! ~PyroPhin |
I don't wish to intrude but... how exactly are you going about getting the current draw from the wire to the robot controller? Just checking.
Ugggh... I don't know where to start... The serin command in the default program cannot be used for any ordinarly stamp chip. Everything in the robot controller is actually performed by a central processor. The stamp chip only serves as an easier way for us to tell the processor what we want it to do. The serial input/output commands allow the two chips to interact. I have a difficult time picturing what you are trying to do... I certainly hope you're not trying to do what I am picturing... Why are you trying to connect the bs2 to the dashboard port? If you are trying to get the data from it then you must read the Dashboard Port documentation and serin the bytes in that format. IMO... you are biting off more than you can chew. |
the current draw thing is one of the things i am trying to figure out.. gotta find a way to get the 12V down to 5v.. was thinking voltage regulators of some sort...
and.. bah... it can be done.. and we shall do it!! |
Motor Current
Wildstang team#111 measured the current at all motors and sent the data back through the dashport. They could record the whole two minute match from an amperage point of view. I believe they just used a certain length of motor lead wire as a shunt and measured across it.
|
do you know if team 111 had an lcd display of sorts to tell them what the current draw was?
|
They monitored the current on seven or eight motors and sent the data back to the operator's station. They would record the data on a laptop or palm pilot for later analysis. I don't think they monitored the data during the match, but I imagine they could have.
Hey Raul, any chance you can have one of your electrical guys publish a white paper? |
okay.. so i know it's possible.....
you know any way of getting in touch with team 111's programmer? i gots a couple questions for him. Thanks! ~Pyro |
We had current monitoring as part of our control program. When the current exceeded a certain limit, the computer would back off the controlers until things were down to an acceptable level. Since the current value was part of the control algorithm, I assume it could be transmitted back through the dashport pretty easily.
It worked great at LA and Nationals, then caused no end of trouble at IRI. We think we finally figured out what is going on this weekend. If we're right some minor program tweaking should make it behave. We think it was just a little too sensitive to voltage drops and have a work-around designed but haven't tried it yet. I'm suprised gwross hasn't put his $0.02 in yet, as he was much more involved than I was. I'm just a mechanical, I leave the electron pushing to others whenever I can. ChrisH |
If you look on the wildstang site, I think it was under the Invention award or something they showed the circuit they used to create the current sensor and send it to a color palm pilot. Very slick, also fairly complex, if they didn't have a custom circuit board it probably was a lot of breaboarding to make the circuit in the schematic.
See here: http://www2.wildstang.com/2002/inventor/schematics.asp Very nice job Wildstang! |
Thanks for the Kudos, Matt.
I was one of the Motorolans that worked on the current-sensing (err.. StangSense) for Wildstang. We basically did what was discussed here earlier, taking a known voltage difference across a known resistance to get current. That was accomplished by using a known length of known guage of wire, to which you can find the natural resistance of, and finding the voltage difference across. That voltage difference was piped into a Maxim current-sensing op-amp (can't recall the part number offhand), which made that voltage difference (on the scale of mV) and converted that to a range from 0-5V. That value was then piped into an HC08 uprocessor, through an A-D, and we used the HC08 to do some time-averaging of the currents of the eight inputs (4 drive motors, shooter, conveyer, etc). All of this was then sent to the Robot Controller through a few of the analog and digital ports, and sent to the player side, where we had a color Palm processing the data, showing live current values, max current values, etc. We also had the ability to save that data during each match, so that after wards, we could look at/analyze why our current spiked at some particular moment, or what drive motors weren't spinning, etc. Definitely a lot of work, and a pain in the rear to solder together, but it was a fun little adventure! -Nate |
Ok I may sound a little dumb but what is the point of doing it this way? It sounds way too complicated.
|
|
Ok, we have most of this figured out, I hope, one last thing, how do we build a circuit that can measure DC current? Any schematic links?
Thanks in advance, Matt |
Quote:
Seriously, though, while building this past year's robot, we were concerned that we may end up drawing too much current and blowing breakers. Since this years challenge was more agressive than years past, we didn't want to end up dead in the middle of a tug-o-war. So, a few students and a few engineers spent way too much time designing the board.... and ended up getting to done about 4 hours before ship. We ended up building a second one for debug purposes after the ship date just to see if the thing even worked :eek: -Nate |
Well I guess I better check my e-mail a little more often...
You have no doubt read the above posts so let me fill in the holes. During the design and building phase of our robot we noticed that some of the drive motors appeared to be drawing way too much current. Since we have utmost faith in our mechanical design team (not to mention their years of experience) we made the assumption that the drive train was correctly designed so the fault must lie elsewhere. As most of you know by now, FIRST was shipping a slightly different motor (the Fisher Price look alike) than past years and the power curve and efficiency was far enough off to cause most teams problems until it was addressed. Some students and design engineers began to ask if it ws possible to accurately sense the current in individual motors and use the data for analysis or robot feedback. So began the circuit design known as "StangSense". See the link http://www2.wildstang.com/2002/inve.../schematic9.gif. This was really a team effort with 10-15 students and engineers all contributing to design, building and software. Essentially it is easy to measure AC current by using a current transformer but with the speed controllers at full output the pulsed motor drive goes to full DC so the output of a current transformer would fall to zero at maximum current. So the search was on for a device that would measure current at each motor and would be small enough to fit inside the enclosure. One of the engineers found a reference to Maxim for current monitors. We found one, the MAX 4172, that was designed to sense charge current in laptop batteries. The 4172 scales a voltage drop across a very small (much less than an ohm)series resistor into a current source. We scratched our heads over what to use for the small resistance, such as how do you fit high power resistors into the project box, the weight of the wire in our weight budget, etc. It was then that we made some calculations and determined that a one foot piece of #10 wire is approximately .001 ohms. That turned out to be just right for the 4172 design and the only weight we had to add was #22 wire from both ends of the 1' #10 we were using to feed the drive motors anyway. When you choose the right components, you can scale full expected current to be represented by a variable voltage between 0 and about 3.5 volts. (For our purposes this represents 0-135 amps) Motorola (did you expect us to use anything else?) makes a series of microcontrollers that have A to D converters available on some of the pins. So we fed the sense voltage to the A to D's which converted and multiplexed the signals so that they could be passed down just one input to the robot controller and then out to the Operator interface and dashboard port. Then it was a simple matter (I am not the software guy so it looks simple to me) of writing Palm software to interpret was was being received. In using a color Palm, the drive team had a choice of displays. They could see the current represented as moving bars that were normally green but would change to yellow and then to red when the current reached predetermined trip points. Or they could see a graphical top view of the robot with colors representing the current in each of the motors, changing again from green to yellor to red. We also stored the entire two minute match as data and were able to download that to a PC from the Palm, import the data into a spread sheet to see quantified data and chart the current. Since the dashboard also has a clock of sorts we could get a pretty good idea of what was happening during a match by replaying the video tape and comparing to approximate timing of the robot clock. Although we never used it for feedback, it became very useful for risk assessment vs. strategy, and since the battery voltage is also part of the dashboard output we were able to trace dips in battery voltage to high current demand which led to some changes in software. (don't let too many high current motors turn on at the same time.) We built a second portable unit that allowed us to diagnose other robots who were having problems with robot reset, damaged motors, burned speed controllers, etc. We offered this service to anyone who asked during regionals and nationals and helped many teams diagnose their problems. It is an immediate response for teams who had been scratching their heads over some serious issues. The data we collected during our first regional actually caused us to change the electrical layout of our robot to make the controller operation more reliable on high current draw. As you know the robot controller will reset when the supply voltage falls below eight volts, so it is imperative to prevent this from occuring. Thanks to this board and all the teams who began discussing the problems early on. Thanks to Andy Baker and the TechnoKat team for their input on breaker trip vs. temp, thanks to Joe Johnson and all the other dedicated engineers who helped us understand some of what we were seeing, and thanks to all the teams who let us hook up to their robot and gather data. You all helped make this project a success as well. Good luck to you all, |
Quote:
We didn't have a display of the current draw, and we didn't attempt to record any values. Instead, we used electronics to sense the current being drawn by our drive wheels, and programmatically limit the power being requested of the drive motors. Some of our electrical/electronics types came up with a circuit for our electronics box which output a voltage which varied from 0 to about 3.5 volts according to the amount of current being drawn by our three drive motors. (It's ALL black box magic to me.) Ideally, the output voltage range would have been 0 to 5 volts, but we didn't have time to get it tweaked to perfection. These voltages get read as analog inputs to the robot controller. Each time through the control loop, if any one of the values is above a certain threshold, the program scales back the power being demanded of all the drive motors. The scaling factor starts at 100%, and then every time through the control loop the current is above the threshold, the factor is cut back by 5 percentage points (but not below 10%.) Once the current gets back below the threshold, each time through the control loop the scaling factor is increased by 1 percentage point until it gets back up to 100%. |
Quote:
|
Dead link
Quote:
What's the correct URL? - Keith |
Keith,
We are trying to get the site back up. We had to change ISP's and the former ISP refused to give up "wildstang,com" so we moved to "wildstang.org". There have been problems though and I know Mike Soukup was working like crazy to get everything moved and updated. It's a slow process and we just completed our fall classroom time with a mini-competition Monday night. (the mini-comp uses Lego RCX and Robolab to give students a leg up on design, problem solving and software.) Sorry for the problems. I tried to include the schematic as an attachment here. I had to scale it down to upload and it was unreadable. |
Al's right, we switched ISPs and the crooks at our old one won't give us our domain name, so we switched to http://www.wildstang.org. I uploaded the old site to the new server last night so the diagrams should be there. Plese look and let me know if anything isn't working or you can't find what you're looking for.
[edit] The link you're looking for is http://www2.wildstang.org/ws/invento...schematic9.gif [/edit] Mike |
WHoa i though it was illegal to have custom circuits provide input!!!!!!!! SWEET!!!! OMG ITS NOT?awesome!!!
|
Outstanding info
Al That is worthy of being a white paper .Can you you cut n paste it as one .Great info. Jim :cool:
|
Re: Current Monitoring system questions
You will notice that alot of teams measured across calibrated lengths of wire, or even placed very small value resistors in series.......we just measured the voltage drop across the circuit breaker and multiplied by different coeficients for 20A and 30A breakers.
Simple...and works great. We used it in the stamp code to detect stalled drive motors...where we modulated them to keep the breakers happy. We also used it to detect another motor stall, and used it as a limit switch. (end of travel instead of a nasty microswitch that always gives p the ghost that the most inopportune time) I can pass along schematics if you are interested. -Quentin Quote:
|
Re: Re: Current Monitoring system questions
Quote:
Custom circuits just can't run DEVICES directly. No motor controller replacements, nor driving the motor controllers with the custom circuits. The RC is the ONLY device that's allowed to run the MOTION outputs. This makes sense. This rule is to GUARANTEE the robot WILL stop when told to by the arena controller. If the custom circuit could directly affect any output device, FIRST couldn't guarantee shutdown, and you'd immediately have a safety hazard if it DIDN'T shut down. Since the inspectors can't check your circuits, it's simpler to rule that ONLY the RC can command "real" things. Heck, if you think about it, if the custom circuit COULDN'T talk to the RC, what WOULD be the point of it beyond "fancy telemetry"??? The only real effect it's allowed is to tap the RC on the shoulder and say "Ahem... Pardon me... Here's something YOU should know about so YOU can do something about it..." :D Quote:
As a EE, I'm a big fan of custom circuits, and appreciate seeing the neat things everyone has come up with! :) - Keith |
Re: Re: Re: Current Monitoring system questions
Quote:
Done...I just uploaded it a few seconds ago...and I suppose, after the sysop reviews it, they will make it visible. I hope you find it interesting. If you (or anyone) has any questions, please feel free to email me. Enjoy, -Quentin |
Re: Re: Current Monitoring system questions
Quote:
As to the custom circuit, I agree with the other posts that a custom circuit gives us the opportunity to teach electrical to students in addition to mechanical. I also think that teams should be able to demonstrate during inspection, the ability to remove the custom circuit and still run. Even without this restriction, teams should make that their first priority. If it fails, remove it and still compete. |
current measurement?
bigqueue, you talked about measureing the current over the breakers to check the current going to the motors, how exactly does that work? I am trying to find a way to do exactly that, measure the current drawn by my 2 main drive motors. How/Where do you physically connect up wires to test this, and do I need a custom circuitry board to interpret this voltage measured? Thanks for the help.
|
Re: current measurement?
Quote:
http://www.chiefdelphi.com/forums/pa...le&paperid=155 You basically use an Op-AMP that has a common mode voltage at and/or above the power rail. Then you build a difference amp, and measure across the breaker. (actually, the side at the top of the breaker has to be done through a separate breaker because of the 1st rules of connection....but the current through that breaker is so low powering the OP-AMP that the drop is essentially zero) Look at that paper and tell me what you think. Then, ask me any questions and I will answer them. (I can also get you a full schematic and board layout if you want) -Quentin |
confusion!
Hey bigqueue, thanks for the help, but being a novice at electronics, I can understand BASIC schematics, but complicated ones overwhelm me. The 2nd schematic, I guess of the custom circuit itself, is a little intimidating. Could you explain what's goin on in plain english, and exactly what parts (ie. resistors, capacitors, input types) i would need to build this circuit. Once again, thanks for your help.
|
Re: confusion!
Quote:
1) The circuit pictured is a difference amplifier made with a single OP-AMP. The voltage gain is given by the ratio of R1 and R1 (and R7 and R9 which are the same values 12.1K and 100K respectively) I will not have enough space here to explain exactly how an OP-AMP works, but surfice it to say that this circuit gives you a voltage output that is 8.26 times the difference of the voltage difference between MS1+ and MS1-. 2) Given that this voltage is measured across the circuit breaker, and that we measured the 30A breaker to have a .006 ohm resistance, the output of this circuit when it measures across the 30A breaker is 49.4 millivolts per amphere flowing through the breaker. (it actually measures the voltage across the breaker, and assumes that ohms law actually works) I=V/R. 3) The zener diode at the output is used to clamp the output which is capable ot going up to 12v. (since the circuit is powered off 12v) I added this top protect the A/D inputs......(I'm not sure it is needed, especially given the series resistor and potential clamp diode in the A/D input...but I thought it was better to be safe than sorry) 4) The resistor and capacitor at the output (R51 and C10) are used to filter the output. Don't forget that the motor is controlled via a PWM, so the voltage to the motor is pulsed on and off...andthis will show up in the motor current....and this RC filters all that switching out into a steady DC voltage which is fed to the analog to digital converters of the robot interface. 5) Given that the input of the A/D is 0-5v, and that it is a n 8 bit converter (256 counts), each count is 19.5 millivolts of input....or about .4Amps per count. (for a total of 101Amps full scale) Sorry...but as I read this, it looks basically like what I wrote in my paper. I'm not sure this is any help. Please give me some more specific questions and I will try to answer them. Please note: picking the OP-AMP for this applicaiton is important. Its input characteristics must be specific to allow it to operate in this environment. (high common mode inout voltage...that is, both inputs must be able to sense at or above the power supply voltage of the OP-AMP.) Ask me more and I will reply. -Quentin :ahh: |
parts
I sort of understand what's going on here. Since schools are closed today due to the northeastern snow storm, I will run to radio shack today and pick up the electronics to build a couple of these circuits. If I take this schematic to radio shack, will they be able to help me find everything that I need? You mentioned getting the right op-amp. Which specific kind will I need? ie, what specifications should it have?
One last thing, I am planning on calculating the current for 2 motors, not just 1. Will I have to build 2 seperate/identical circuits and hook them up completely independently? Or can I use this single circuit for measuring 2 currents from different motors? Thanks for all your help! :) |
Re: parts
Quote:
No, I don't believe that Radio Shack will have the particular OP-AMP I used. I bought it at DigiKey. (LM6134) Note that each of these OP-AMPs packages have 4 OP-AMPS in them...so you can measure motor currents on four motors with in of these packages, (Radio Shack may sell an OP-AMP that has similar characteristics.....but I am not sure. They tend to seel pretty "jelly-bean" devices.) -Quentin |
trip to Radioshack......
I went to Radio Shack, and bought 90% of the stuff on the schematics. I bought a simple Op-Amp ($.99), but on the back of the box schematics, it only has 2 inputs, and an output. Your schematics have a ground coming out, as well as another wire (#4 on sheet) that appears to be +12v. I guess I'll have to take another trip out to R.S. and pick one up that looks similar.
Also, it dawned on me just now that i will have to put many resisters in series to create a net resistance of 12.1kOhm's and 2.2kOhms. I did not see these resisters at R.S, so i didnt buy them, only the nice round 10X mulitples R.S. had. Looks like 1 more trip out to Radio Shack today........ but probably not the last..... :eek: |
Re: trip to Radioshack......
Quote:
Well, the resistor values used can be changed....all you end up with is a different range of output. (I chose the values to optimize the output for both 30A and 20A breakers) If you went with 10K and 100K, you would have a gain of 10 vs 8.26 which will give you a lower full scale MAX current measuring ability. This is actually BETTER for the 40A breaker since it will have a lower resistance. But I can't over-state the importance of the OP-AMP. Something like a 741 or a 324 will just NOT do the job at all. (If I remember, the 324 is good at sensing close to the lower supply, not the upper supply) BTW: The 6134 is pin compatible with the LM324, so if you built it for the 324, (in a socket) you can simply switch in the 6134 when they come in. -Quentin |
what exactly?
i bought a LM324 when i was out, but your saying it ISNT a good choice? If i need to go buy another one, exactly which should I buy? I have a 724 and LM324 here now, will the LM324 be good enough?
|
339
I have a 339 Quad Comparator here also, will this work? from the schematics on the package, it looks like the same type of OP AMP.
|
Re: 339
Quote:
Besides, I'm not sure the common mode input voltage range of that device includes the voltage rail. The 339 and 324 are older devices, and though they are single supply devices, I think they sense down at GND better than Vcc. (At least that is the case for the 324) Sorry, -Quentin |
We are planning to put a simple comparator circuit across the ground lead of each motor. By comparing the voltage drop across this wire to a reference produced by a trim pot, the computer can determine when the motor is stalled, or at least drawing sufficient current to trip the breaker. The program will then automatically reduce power to the motors.
This will be especially useful during the autonomous period, when we might try to drive through a wall at full speed. We also plan to use this circuit to detect that the window motor has reached the end of its turning point, rather than use limit switches. Limit switches have a habit of breaking at inopportune times. By using the ground lead instead of the +12V lead you can use a garden variety comparator that senses down to ground, like the LM339. The open-collector output can be connected directly to a digital input on the robot controller, with no need for zener diode over-voltage protection. You would want to put a low-pass filter (series resistor with a capacitor to ground) on the input to remove the pulse-width-modulation pulses, as it is the average current you are interested in measuring. I could post a schematic if anyone is interested. |
Sorry I'm late
Quote:
Quote:
|
I don't understand why you say the 324 wouldn't work. It's working for me, the circuit I built measures current and thanks ot a creative selection of resistors, I have 1amp to 0.1vdc ratio, allowing measurement up to 51amps where the zener diode clamps prevent it from going higher as a safety precaution, so far it appears to have been working perfectly.
|
Schematic for current sensor
A relatively simple current sensor is depicted in the following schematic.
It uses a quad LM339 comparator, and all parts should be available at Radio Shack. The positive input of the comparator is connected to the ground pin on the Victor 884, and the negative input is connected to the common ground bolt on power distribution block. The voltage to be measured is then the voltage drop across the ground wire connecting each Victor to the power distribution block. The potentiometer (R2) is adjusted to provide a very low voltage to the negative input of the comparator (U1 - LM339). When the positive input rises above this voltage, which will happen when sufficient current is drawn by the motor, the comparator will change state. The output of the comparator is connected to a digital input on the robot controller. When the controller senses that the comparator output has changed state, it can reduce power to the motor, or, if in autonomous mode, it might stop the robot completely, as it may be jammed up against a railing. The positive input is filtered with a low pass filter (R3, C1) to remove the rapid voltage fluctuations caused by pulse width modulation of the motor. The values here may need to be adjusted, as I have not calculated the optimal values for this circuit, but have just stolen them from bigqueue's drawing of a different circuit . ![]() |
To Steve,
It is a multiplexed analog signal to one input on the RC. To jskene, Nice, simple design. How many motors do you monitor and does your software cutback to a predetermined value or does it step down until there is no trip sensed? |
Al;
We are just building the circuit today. We plan to put it on all 4 drive motors, and also on an arm motor to allow us to determine when it has reached the end of its stop. Regarding your question on what the robot does when it senses an over-current condition - in autonomous mode we are probably going to back up a bit then go forward, one time. If the condition repeats, then we'll just shut everything down and wait until manual control starts. This will save us from being E-stopped. In manual mode, we will back off power, and maybe flash a warning lamp for the operator. Due to the high starting current of the drive motors, we may have the robot controller ignore the overcurrent condition for 1/2 second when the operator has requested a rapid acceleration or change in direction. This should prevent us from tripping out uneccesarily. The 40 amp breakers will take momentary high current spikes. Note: The original version of the schematic had the +5V and GND leads of the LM399 reversed. The current version (Ver. 2) is correct. Jerry |
Jerry,
Sounds good. Let me know how it works. As of last week, we are planning on putting our Stangsense current monitoring on this years robot. We also are monitoring five motors, but at present use the data to highlight high risk operations to the drive team and to have data to analyze post-match. We are hoping to have a portable version that we can help teams analyze problems on their robot. If we can get the time after ship, we hope to be able to substitute our current monitors for breakers in suspect robots and give teams an idea of what is actually taking place. |
1 Attachment(s)
Here is a picture of a sense wire. Note that there is a two conductor wire used to feed to the custom circuit board. One wire is attached at the push on terminal and the other is attached to the wire, one foot away. The only thing remaining is to cover the terminal and the solder joint with heatshrink and cut the extra length to fit. This wire will be installed between the circuit breaker panel and the speed controller.
|
| All times are GMT -5. The time now is 02:49. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi