Sunday, April 11, 2010

Final Challenge-3

For this part of the challenge, Esther and I created a program that uses proportional control to make the MotorCar go straighter. In order to do this we changed our previous Bang-Bang control program. Instead of the "set power" blocks to be fixed to a certain value, we made them vary according to the count difference. When the count was positive, we subtracted the difference times a gain (a coefficient) with the total power (10000). When the count negative, we added the count difference times the gain to the full power. This means that if the count difference is small then the set power will be set to a value closer to full power, which would make the vehicle only bear slightly left/right. If the count difference is great then the set power will be set to a value much smaller than full power, which would make the vehicle bear left/right much more. We had to figure out what gain we needed to incorporate in our program. After a couple trial and error runs, we found that the gain value of 800 was the correct one and made the MotorCar move very straight. This is a picture showing our "set power"blocks:This is a picture of our "straight porprotional" program. Except for the "set power" blocks, it looks exactly the same as the Bang-Bang control program.
We first tested our program on the concrete floor along the tape line. The MotorCar stayed within the line, but it beared to the right slighty. This is a video of it:

We then tested our program up on the ramp. The MotorCar successfully managed to reach the top without falling. This is a video of it:

Then we tested our program down the ramp. The MotorCar beared to the left and was very close to falling off. This is a video of it:

Then we tested our program on the carpet. The MotorCar didn't move as straight on this surface compared to the other ones. But it did not deviate too drastically. This is a video of it:

After testing our program on different surfaces, we tested by altering the friction on the wheels. When both wheels had low friction, the MotorCar moved fairly straight and beared slightly to the right. When one wheel (left wheel) had high friction, the MotorCar moved just like when both wheels had low friction. Finally, we set both wheels to have high friction and the MotorCar moved very straight! It followed the tape line perfectly!

Then we tested to see how changing the gain would affect the MotorCar's straightness. When we set the gain to be 50, the MotorCar drastically turned towards the right. When we set the gain to be 500, the vehicle wobbled a bit and beared to the right. Then we set the gain to be 1110 and 1550, the MotorCar beared to the right but not as noticeably as when the gain was set to a much lower number. We finally tried 900 and 700 and the MotoCar moved fairly straight but beared slightly to the right. After testing all these different values, we re-tried our program with the value of 800. The MotorCar moved very straight and it showed us that we were able to constantly reproduce a straight path when our gain was set to that value.

No comments:

Post a Comment