Thursday, April 15, 2010

Final Challenge-7

For this challenge, we created a procedure that uses proportional control to make our car go exactly ten feet. Like the previous challenge, we combined two of our older programs "go ten feet" and "proportional control". However, instead of using time to control when the motors were running, we used the counts with the use of shaft encoders. We used our unit of .037 inch/count to figure out how many counts where needed to go a distance of 1o feet. We obtained a total count of 3243 and we tested it out to see it worked, but the car passed the 10 feet mark. So we lowered the count to 2960. So this is the program we came up with:

Like in the previous challenge, we made the car coast instead of braking. Below is a picture of our power settings and how they are a product of a constant gain factor and the average of the shaft-encoder variables.
After making our program, we tested it out on the concrete floor. It worked extremely well (moved very straight) and stopped exactly where it was supposed to.
Here is a video of it:



We then tried it on the carpet. The MotorCar beared right slightly, not as badly as it did when it was running under the "bang bang distance" program. This time, the car stopped short by 2 inches of the 10 feet mark.
Here is a video of it:


We then tested our program with the car going up the ramp. We were impressed because the car moved very straight and it came closer to the mark then when it was running the "Bang Bang" distance. It was about 4 inches short of the 10 feet mark.


Finally, we tested it out with the car going down the ramp. The car beared to the right but it straightened out very well, which made us very happy and convinced us that our proportional control was working. The car did not pass the 10 feet mark as much as it did the "Bang Bang" distance control. Instead of being off by a foot, it was off by around 6 inches. Here is a video of it:

These trials showed us that the proportional control worked much better than the bang bang control for this distance challenge. But we were still unable to make the car stop exactly at the 10 feet mark on the three surfaces (upramp, downramp, carpet).

We then tested out different gains because we wanted to see how it affected the motion of the MotorCar on the concrete floor. Our original gain was 800. We first tried a lower gain of 100. This resulted in the car deviating right. It still went 10 feet, but it did not go straight at all. We then tried a higher gain of 1300. The car still went 10 feet but it also deviated to the right. This showed us that we had the right gain and that changing it would really affect the results and if we had tested it out the ramp, the car would have surely fallen off.



No comments:

Post a Comment