View Single Post
  #7   Spotlight this post!  
Unread 10-03-2011, 12:20
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Programming goofs!

For the 2005 game, Triple Play, we had six reliable autonomous paths that would pick up a vision tetra from the appropriate spot and place it on the center goal for a double bonus. We had a camera that would reliably find vision tetras. We just didn't have a working bit of code to connect the two. So we defaulted to the path that picked up a tetra from front center and placed it. It always worked, if that's where the tetra happened to be. I figure it was only going to take a couple of hours of programming on Thursday at the regional to get the camera to choose the path.

At the same time, the white KOP joystick we used for our operator that year proved to be noisy and unrepeatable enough that we decided to replace it. The high-quality arcade-style joystick we purchased was installed in our driver station, and we discovered that its output was only about half of the possible range. That would have made our arm move much too slowly for effective game play, so the first thing I did to the code when we got to the regional was to multiply the motor control value by two before sending it to the PWM output routine. The joystick worked great, and everyone was happy.

Our first practice match came up. The vision tetra was randomly placed in exactly the place our autonomous was going to try to pick it up. The team was ready to awe the venue with our fantastic autonomous performance. When the match began, our robot raised and extended its arm, drove to the tetra, picked it up...and proceeded to throw it into the air and thrash the arm wildly up and down, making the whole robot bounce. The drive team hit the emergency stop.

I immediately realized that the arm PID had been totally thrown out of whack by the extra doubling at the end. I spent the next half hour trying to retune it to account for the change in system gain, without success, then figured out that I could put everything back the way it was before and just double the joystick value on the way in instead of doubling the motor value on the way out.

I am not sure what exactly happened at that point. I probably restored the code from the wrong backup, because the autonomous code totally failed and never worked again. After most of the day without success, the team leader eventually decided we needed something quick that worked, so our great tetra-placing scripts were discarded and our robot spent the rest of the season bumping the hanging tetras off the corner goals for a one point score in autonomous.