Lab 8 Stunts
The goal of this lab was to combine everything done in the last few labs to execute a stunt as fast as possible.
Position Control
As done in lab 6 and 7 I continued to do the position control task. This involved starting the robot about 3m away from the wall, performing a flip on a sticky mat 0.5m from the wall and then returning to the starting line. The goal was to complete this as fast as possible.
I decided to use my Kalman Filter and disengage my PID controller to complete this task. I used the KF since it was the fastest method to determine when 0.5m was reached. The PID controller was based on position control which would mean that the robot would slow down as it reached the target which is not what we want for this stunt.
For the Kalman Filter I kept my A and B matrices the same as the sample rate did not change by a lot but I did reduce my reliance on the TOF sensor since less reliance was needed to be accurate to 0.5m than the previous 0.304m. This made my KF even faster.
My control looked like the below:
- Forward at 255 PWM
- At 0.5m, backward at 255 PWM for 0.5s
- 0 PWM for 0.05s to stop the motors while flipping so that orientation doesn't change much
- Return at 255 PWM backward