Prototype and System Models

In designing our prototype to model our solution, we have constructed a 3-D printed part to attach to the Servo motor.

Graph 1

The arm will then rotate and hit the wheel of the prototype to act as a brake. This will help the team fulfill the requirements set by the verification plan in order to meet the needs of our users.

Prototype Design:

Here are the pictures of our car prototype design:

Graph 2

Graph 3

Graph 4

Graph 5

Code: 

Our sample code that is met for some of the requirements in our verification plan:

// Test Reflectance Sensors

 reflectanceSensorTest();

  // Test Motors

  motorSpeed(1, -50);

  motorSpeed(2, 50);

  pauseFor(3);

  motorSpeed(4, 0);

  pauseFor(2);

  motorSpeed(1, 50);

  motorSpeed(2, -50);

  // Test Servo

  rotateServo(180);

  rotateServo(90);

  rotateServo(0);

// Begin Requirement Testing

  double wheel(0);

  while(wheel < (40)) {

          motorSpeed(1 , 60);

          motorSpeed(2, -60);

          wheel = getForwardCounts();

  }

// Braking Speed and Stopping Precision

  rotateServo(180);

  motorSpeed(1, -60);

  motorSpeed(2, 60);

  pauseFor(1);

 motorSpeed(4, 0);

 

Analysis of Code:

Testing the reflectance sensors, the servo motor, and the engine motors before beginning the requirement testing is crucial in determining the set up on the Arduino board itself is correct. This code is mainly testing that the board is picking up the correct direction of the wheel when it rotates, ensuring that the servo motor is rotating in the correct direction, and that the engine motors are aligned in the right precise precision to move the prototype efficiently. Beginning the requirement testing, there is a variable that is receiving information as to how many times the wheel rotates, and engages the motors until the wheel has rotated a specified number of times. After the wheel has rotated enough to break the while loop, the braking speed and stopping precision code is enacted. The servo motor will then rotate until it hits the front wheel of the prototype, while the engines will run in reverse direction at the same magnitude for one second.

 

Prototype Design Requirements:

Table 1

These requirements will be implemented into our verification test plan by utilizing the curved track, the gates on the linear track, and several measured stops on the linear path in order to test the stopping capabilities of the prototype. The design process will be dictated by these requirements based on the capabilities that the prototype can fulfill. We plan on utilizing the Servo motor to construct an arm that will effectively help break the speed of the prototype itself, but we also need to be aware of keeping the design simple enough in order to accomplish the requirements of having the mass be under 250 grams, being able to dismantle the prototype, and also accessing the battery.