Lab 8: Stunts!

This lab involved using the past labs (lab 6 and 7 specifically) to control the car's stunt.

Stunt A

In my case, since I chose Task A in PID control, I did a stunt of flipping the car. This stunt was executed in the lab space, where we had to start < 4m from the wall at the designated start lin, drive forward until it reaches the sticky mat, flips and drives back to the start line

Based on what the past students and my lab group members did, I first set the motor PWM value to 250 to drive forward as quickly as possible.

Implementing into the robot

Due to complications in the implementation, I decided to not use the Kalman Filter during this task and make it as simple as possible. The car first drives as fast as it can towards the wall, and when the ToF sensor value reaches certain point, it sends a backwards signal of 250 PWM value and returns back towards the starting line. The exact ToF value was decided through *multiple* trial and error, especially since my orientation of the robot was unique (explained below).

Below are the videos of the full stunt trials. The first one is currently the best run, with 3.5 seconds from the start to the end. The latter two trials did a successful flip, but did not pass the starting line.

The main issue, which is also shown in the video is that my right wheel is significanly stronger than my left. I first tried the stunt with calibration factor that I found in lab 5, by decreasing the PWM signal of the right wheel to 0.65 (significanly lower than my peers) of the given value. The robot did go straight with the calibration, but due to the decreased overall speed, the car just WOULD NOT FLIP!! Out of curiosity, I removed the calibration and tilted the car at the start to the right to prevent it from going completely to the left and ran it with full capacity on both of the wheels, and it worked. Although I could've tweaked the wheel mechanically and rearrange the mass distribution of my robot, I just concluded the lab with what I had due to time crunch.

The biggest two problems I faced during this lab were the uneven weight distribution on the chassis and the uneven motor capacity. The weight issues were solved through reorientation of the sensors and batteries during the run, but the motor capacity could not be fixed in such limited time. Even with fully-charged batteries, the calibration factor was 0.65 and gradually degraded to 0.5 as the battery was used up. With such unevenness, it was practicaly impossible to have successful stunt with the robot driving straight.

The motor and distance value graphs below only depict the ToF sensor values as the car races towards the wall since the data after the flip is not significant.

Other two videos

Bloopers

Somehow the robot wanted to do 50% of task A and 50% of task B