We used the count difference (count b- count a) to determine whether the Motorcar should bear left or bear right and thereby constantly adjusting itself to move in straight line. We saw that when the count was positive, the Motocar drifted towards the right and we needed to add friction to the left wheel so that it would bear left. When the count was positive, the Motorcar drifted to the left and we needed to add friction to the right wheel so that it would bear right.
So we created a program "s-bb" that used the "if then else" blocks and the "bear left" and "bear right" blocks that we made in the previous challenge.
We added a print statement so that we could see the count difference and we could also see the oscillation because the count would vary from -3 to 3.
This is our program:
We played around with the power settings hidden in the "bear left" and "bear right" blocks. We had previously had the power settings reduced to 9000 and when we ran the program, we could see a minor wobble in the Motorcar, hence the oscillation. So we decided to make the difference slightly smaller by have the the power settings reduced to 9700. When we ran that program, the Motorcar did not wobble and moved straight!
So we tried our program on different surfaces.
We first tried it on up on the ramp. Here is a quick video of it:
Then we tried it down on the ramp. We found that the MotorCar moved a lot straighter while it was going down the ramp and than up the ramp. As it was going up the ramp, it beared right a little bit and wasn't able to make it all the way to the top. However, the MotorCar was able to make it all the way down the ramp without falling off.
Here is a video of it:
When then just tried our program on the concrete floor along a tape line. Here is a video of it:
When we set our MotorCar on the carpet, it did not go as straight as it did on the concrete floor.
Here is a video of it:
We then tested out program under different conditions. We first set both wheels to have low friction. The result was that the MotorCar went fairly straight on the tape line but it beared right slightly in the end. Then we gave one wheel (the right wheel) higher friction and the result was that the MotoCar wobbled a lot more than before and this time it beared slightly to the left. Finally, we set both wheels to have a higher friction. This time the MotorCar moved the straightest along the tape line , even if was a bit wobbly.
No comments:
Post a Comment