Vehicle Code Testing

Vehicle Code Testing is the second of the three vehicle tests. In this test, two separate codes were written in order to determine which code aspects were better to use on the AEV. Group F decided to focus on the difference between using relative and absolute position when coding the AEV. The scenario the AEV must run consisted of the AEV starting at the start positions and then combing up and incline. After that, the AEV will the proceed past the stop, travel to the docking station, and connect to tt\he load waiting at the end. The two codes can be seen below. It can be noted that because the two codes are being used on the same design, the power for both codes are the same.

If needed, the Function Glossary can be seen here: Glossary

Absolute Position Code:

Code Comment
celerate(4,0,25,4); Accelerate all motors from star to 25 in 4 seconds
motorSpeed(4,28); All motors at 28%
goToAbsolutePosition(239); Go to position 239 marks
brake(4); Brake all motors
goToAbsolutePosition(293); Go to position 293 marks
rotateServo(90); Rotate servo 90 degrees
goFor(8); Go for 8 seconds
rotateServo(-90); Rotate servo -90 degrees
motorSpeed(4,28); All motors at 28%
goToAbsolutePosition(386); Go to position 386 marks
brake(4); Brake all motors
goToAbsolutePosition(646); Go to position 646 marks
rotateServo(90); Rotate servo 90 degrees

Relative Position Code:

Code Comment
celerate(4,0,25,4); Accelerate all motors from star to 25 in 4 seconds
motorSpeed(4,28); All motors at 28%
goToRelativePosition(239); Go to position 239 marks
brake(4); Brake all motors
goToRelativePosition(54); Go to position 54 marks relative to current position
rotateServo(90); Rotate servo 90 degrees
goFor(8); Go for 8 seconds
rotateServo(-90); Rotate servo -90 degrees
motorSpeed(4,28); All motors at 28%
goToRelativePosition(93); Go to position 93 marks relative to current position
brake(4); Brake all motors
goToRelativePosition(258); Go to position 258 marks relative to current position
rotateServo(90); Rotate servo 90 degrees

As seen below, the absolute position code completed 9 runs perfectly out of 10.  These runs stopped at the same position each time and was able to connect with the load 100% of the time. The relative position code completed 6 runs out of 10. Half of the completed runs would stop short of the position it was supposed to go. It was assumed by group F that the more the battery was drained the worse the outcomes of each run would be.

Absolute Position  Relative Position
Successful Run 9 6
Success Rate 90% 60%