|
Code malfunction after robot reset?
I have found myself in a most perplexing programming situation, and I'm hoping someone can help me figure it out in time to actually get this robot programmed before shipping. We have been using Kevin Watson's encoder code as a basis for our own code. The only modification I've made to it so far is to add our own joystick mixing function to user_routines.c, and call it in Process_Data_from_Master_uP(). This function does not do anything with the encoders. I downloaded the fresh code from Kevin's website, put his patched header file in the right place, pasted in the mixing function, compiled it, and downloaded it to the robot. I tested the joysticks, and it worked exactly as expected. I turned off the robot, and came back to it later to find that the code was flipping out. The motors spin at random without touching the joysticks, and if I look in Dashboard, I can see that several of the PWM outputs (including ones my code doesn't touch) are forever incrementing and overflowing, hence the motor craziness. When I switch the robot into autonomous mode, it keeps doing the same thing, despite me having no code in the autonomous function (aside from the IFI default to set all of the PWMs to 127, which is apparently not happening). I have sent the same HEX file to the robot again, and it continues to be crazy. When I put the IFI default code with our mixing function onto the robot, everything behaves again. I replace it with the encoder code, and it flips out.
Basically, my question is, how can the same code work and then suddenly not work? Does the encoder code leave some sort of persistent change even after reset? The fact that this problem persists into autonomous mode indicates to me that this problem extends beyond a simple coding error. Thank you in advance.
EDIT: One other important tidbit. I'm not using PWM 13-16, so I don't think it's a problem with the encoders causing the "special" PWMs to wig out.
__________________
Team 1743 - The Short Circuits
2010 Pittsburgh Excellence in Design & Team Spirit Awards
2009 Pittsburgh Regional Champions (thanks to 222 and 1218)
2007 Pittsburgh Website Award
2006 Pittsburgh Regional Champions (thanks to 395 and 1038)
2006 Pittsburgh Rookie Inspiration & Highest Rookie Seed
Team 1388 - Eagle Robotics
2005 Sacramento Engineering Inspiration
2004 Curie Division Champions (thanks to 1038 and 175)
2004 Sacramento Rookie All-Star
_
Last edited by jgannon : 19-02-2006 at 13:30.
|