Team #111 Wildstang just completed it’s first regional this year at Great Lakes and onboard the robot was our current sensing system which we have nicknamed StangSense. We are happy to report that it performed flawlessly, and now that we have a regional under our belt we wanted to share some information about our circuit for those who are interested.
Description:
Our custom circuit is primarily composed of a Motorola 68HC908 microcontroller and 8 Maxim MAX4172 current sensing chips. Each MAX4172 is connected to a 1 foot piece of 10 gauge wire which is connected between the fuse block and the speed controller. Connecting between the fuse and the speed controller eliminates the problem of current flowing in the opposite direction when the motor runs backwards. This piece of wire has a resistance of 0.001 ohms. Using this information, we can set the MAX4172 chips to show whatever current scale we want. Currently we are using a scale of 0 to 130 amps. This means that at 130 amps, the MAX4172 outputs 5 volts to the microcontroller’s ADC.
The microcontroller runs fast enough that it can sample the PWM pulses accurately. We are able to sample each motor current at roughly 6 to 8kHz. The microcontroller averages roughly 0.1 seconds worth of these readings before forwarding the average to the robot controller.
Data from the HC08 is fed into the robot controller using the digital inputs. We use 4 digital inputs to specify a motor number and 7 other digital inputs for the current data for that motor. This information is then placed into the packets that are sent to the operator interface without the intervention of the BASIC stamp. In this way, the BASIC stamp can read the motor current data if it wishes, but the data will be sent to the dashboard port at the operator interface regardless.
Once the current data is in the packet, the packet is sent over the RF link to the operator interface. Here, the packets are sent out the dashboard interface into a Palm m505 for further processing. The Palm parses the packets to produce several different displays as well as stores the packet data for post-match analysis. Here are a few screenshots of our Palm display:
http://www.wildstang.com/uploads/bargraph.gif
http://www.wildstang.com/uploads/blueprint.gif
The first screenshot is our bargraph mode which simply displays a bar which changes length and color depending on current. The second display is our blueprint or schematic mode which displays a graphical representation of the robot and uses color to indicate the current in each motor.
Once a match is complete, the StangSense database is downloaded from the Palm onto a laptop where further processing is done. With this data we can generate graphs of each motor’s current as well as the battery voltage over the course of the match. Here’s an example taken from one of our matches at the Great Lakes Regional (please note that on the Y scale, the numbers do not represent actual amps, but rather the 8 bit value that the microcontroller ADC is reading):
http://www.wildstang.com/uploads/graph.gif
For those teams that will be at the Motorola Midwest Regional this weekend, please stop by and take a look if you’re interested. Also, if there’s anyone else attending MMR who experimented with a custom circuit, please reply here as we’d really like to see what other teams did. Good luck to everyone, and we look forward to seeing you at MMR and Nationals!