Lab 8 STUNTS

The purpose of this lab is to use what we have done in the previous labs to be able to control the robot in a fast stunt (living up to the name of the class). Based on the previous labs, we know that this robot can be programmed to react to incoming information utilizing the Kalman filter.

Position Control

I chose to do Task A: Position Control. This means that when the robot reaches the black sticky mat, it should do a flip and then drive back to the starting line as quickly as possible.

In order to do this, I drove the robot forward as fast as possible from 2 meters away from the wall. Then, when the robot is around 0.5 meters away from the wall, the robot will flip and then it will drive back as fast as possible. To make the robot flip, it has to immediately reverse and drive back as fast as possible. I tried a few different methods to get my robot to flip - changing the orientation, stopping the car for a millisecond before reversing, and trying to hardcode the flip. These did not work unfortunately because I think the robot was too forward heavy so it would not flip :(. I have attached the code that I used.

PID control was not used in this lab because I didn't want the robot to slow down and then stop and then flip. We needed the momentum to be able to flip the robot quickly. At first, I tried adding the Kalman filter to be able to predict the distance accurately but my distance sensor wasn't able to predict quickly enough while keeping the car at max PWM. I chose not to add the Kalman filter then. It took a lot of testing to be able to figure out the perfect distance that would allow the robot to flip. Also, since I was really pressed for time, I quickly tried the flip at Philips but after seeing it not work, I went to try different surfaces. I didn't end up getting a video of my philips run because of the disappointment lol.

STUNT

I worked with Grace on this lab. Sadly, we were not succesful in flipping the robot. The robot would drive forward as fast as possible and then immediately reverse without flipping. It seems like there was not enough momentum to be able to flip it. We tried flipping the robot at different times as well because of how dependent it was on the surrounding conditions. The amount that the battery was charged + the floor stickiness also influenced if the robot would flip or not.

Using a fully charged battery made the robot go at the max speed but then also kinda veer around which was unfortunate as well.

After this being unsuccessful, we reverted back to open loop control to see if the robot even had a capability to flip or not. Using a time based approach, (timing how long the forward + backwards portions should take), allowed us to hard code each motion. It seemed like since the distribution of weight was uneven, it would not flip. Even if we started the robot backwards and upside down, it would still not flip which was super weird. This is seen in the videos below.