|
Detecting and handling sensor failure gracefully
On our robot this year we had 3 different pots each responsible for some control necessary for the robot's operation. Two of them helped to resist backdrive (from gravity) and otherwise aid in control, and the remaining was necessary to keep a chain from breaking. That being said, it was fairly important that our pots were working -- otherwise we would lose our competitive edge. And, unfortunately, on Thursday and Friday we had problem after problem with the pots. On Thursday we managed to break 3 or 4 pots (hasn't happened before), mostly unexaplainably -- by break, either the shaft itself came out, the plastic backing ripped apart or the pot mysteriously stopped turning! Well, by Friday, after we had lost our supply of spare pots (many thanks to team 16 and the others who helped us out), the problems started changing. The series of PWM wires connecting the pots would become slightly unconnected, causing the pot to become useless. Then, responsibly for some strange intermittent control issues, I tracked another problem down to a bad PWM cable ... and then another bad cable.
To make a long story short, on Friday our controls didn't work correctly in over the majority of the matches (although we only had a few minor issues at our 3 other regionals). Obviously this is not a good thing! Now, I could have hit sensor override to stop the erratic behaivor (the various appendages would try to hit a setpoint, but since the pot was increasing constantly, they'd obviously never reach it!) -- but this would cause undesirable, and potentially devestating effects with the other elements of the robot. So I started thinking about how the team can get around this next year (alas, I'll be in college) ... and I wondered if I couldn't detect a sensor failure in software and find a way to handle it on an individual basis, rather than all or nothing.
I'm interested to hear if anyone else has done this, or has any thoughts on the issue. The "symptoms" of the two major problems are these: if the pot is unconnected somewhere, the value in software will increase by one each loop; if a PWM cable is bad, the resistance between "red" and "black" will be significantly lower than the rated value (100k in my case, and it was reading about 7k). For the first problem, I imagine simply keeping track of the last N values (say N = 20) so long as the motor output is neutral -- and if the values are progressively rising, it would tend to indicate a bad pot. Then, for the second problem, I thought perhaps I could hook up a current sensor, and using the knowledge of the voltage, deduce resistance and make sure it is within +- 5% of 100k (or whatever it happens to be). Does this sound reasonable? Anyone done this before?
|