Tuesday, November 29, 2011

Brain vs. Brawn in 13 seconds

After dinner I decided to dig up last year's MyBlock with our proportional line follower routine.  I opened Justin's "Baby Fish" and copied it to a blank or 'new' file.  I copied the loops from last years proportional line follower (PLF) and also pasted it to this new file.  Merged it together, re defined the variables as they don't copy, and POOF!  less than 5 runs to get things right and it worked three times in a row.  See video.

Notes:  
Original file lacked BURM.  Fixed.  Ahem!
Original file had very high power levels (90) causing wheel slip.  All reduced to 60. Ahem!
Changed the really long run from 1900 to about 1130 degrees...using the old NXT RB to test for the sweet spot.
I played with the gain value which was on .3.  Gain or "correction factor" is a difficult concept.  Recall last year we wanted to "cool" or "modulate" the correction factor?.   .4 was too sloppy and could lose the line.  .2 was kinda too wiggly as it fought to stay on the EXACT edge of the line.  I settled on .25 gain but .3 might have been a better number.  Upped the power from 20 to 30 on the PLF motor block so it would go faster along the line.  We might even go higher if you want to test it.  I was doing a quick and dirty proof of concept.  You guys can polish it up.
Changed the loop which contains the PLF logic to a 15 second loop which will hold it on the wall.
That's about it.

"Dry run" or "pre pen to paper" (or fingers to keyboard) considerations:  Aka, never "ready fire aim!"
I guess the pre engineering was deciding which sensor to use.  Since we calibrate P1, our preference should be to use P1.  There were two options for P1, either North or South edge of the line.  Based on the objective of not spilling the purple bacteria, the decision was easy.  Read, we got lucky.  But something smart folks look at first.  In theory, there were four options.  P1, North or South edge or P2, North or South edge.  Quick eyeball with the bot on the mat and viola.


Coach's Coaching Comments:
13 seconds of Brains vs. 7 seconds of Brawn.  I guess I don't understand the lack of interest in re-using earlier learnings.  You want to build upon what you learn every day whether robotics or life.  Even if you are not sure you learned it correctly, you MUST have the courage test your learnings.  Sometimes failing is the best way to learn.  To avoid testing what you have learned will cause you a great deal of heartache down the road.

Enjoy the video and be the best you can be! Maybe after States we can look at a more robust line follower and add I and D of PID.


No comments:

Post a Comment