Lab 1 – Arduino Programming Basics

Results and Takeaways

The electric motors had spotty performance. At lower power levels, the motors would not run at all, and another issue that the group noticed with the motors was a lag upon start up. The electric motors would not start to spin until nearly reaching their full power. This may limit the success of our AEV as trying to speed the AEV up at certain points would take longer than expected, as well as trying to slow, break or completely reverse the AEV. The brake command also has a delay, as it does not bring the motors to a complete stop, rather just cuts powers to the motors allowing them to continue spinning as they slow down.

Potential errors could have occurred during this lab while writing the Arduino code, which were caught when the group tried to compile the code and upload it to the Arduino but were returned an error. This was fixed by fixing errors in the code and checking that the right uploading settings were selected for the Arduino. The lab was straightforward and was divided in such a way that all group members were able to participate and further guidance was unnecessary.

 

Upcoming Schedule

Task Teammate(s) Start Date Due Date Time Needed
Progress Report All 1/27/17 2/2/17 2 Hours

 

Team Meeting Notes

Date: 19 – Jan = 2017

Time: 1:50 p.m. (In Lab)

Members Present: All

Topics Discussed: Lab 1 Materials

 

Objective: Todays main focus was to complete the lab 1 procedure, and also create our u.osu.edu site.

To do:

  • Create u.osu.edu site
  • Complete lab 1 procedure

Decisions:

  • Site was created and made public
  • This week’s progress report will be written by Drake, based on answers to questions the group made in class and from class notes

Reflections:

  • All members of the group can effectively code for the Arduino
  • Electric motors have significant start and stop lag that will need to be taken into consideration

Appendix A – Arduino Code

  //Accelerate motor one from start to 15% power in 2.5 seconds.

celerate(1, 0, 15, 2.5);

//Run motor one at a constant speed (15% power) for 1 second.

goFor(1);

//Brake motor one.

brake(1);

//Accelerate motor two from start to 27% power in 4 seconds.

celerate(2, 0, 27, 4);

//Run motor two at a constant speed (27% power) for 2.7 seconds.

goFor(2.7);

//Decelerate motor two to 15% power in 1 second.

celerate(2, 27, 15, 1);

//Brake motor two.

brake(2);

//Reverse the direction of only motor 2.

reverse(2);

//Accelerate all motors from start to 31% power in 2 seconds.

celerate(4, 0, 31, 2);

//Run all motors at a constant speed of 35% power for 1 second.

motorSpeed(4, 35);

goFor(1);

//Brake motor two but keep motor one running at a constant speed (35% power) for 3 seconds.

brake(2);

motorSpeed(1, 35);

goFor(3);

//Brake all motors for 1 second.

brake(4);

goFor(1);

//Reverse the direction of motor one.

reverse(1);

//Accelerate motor one from start to 19% power over 2 seconds.

celerate(1, 0 , 19, 2);

// Run motor two at 35% power while simultaneously running motor one at 19% power for 2 seconds.

motorSpeed(2, 35);

goFor(2);

motorSpeed(1, 19);

goFor(2);

//Run both motors at a constant speed (19% power) for 2 seconds.

motorSpeed(4, 19);

goFor(2);

//Decelerate both motors to 0% power in 3 seconds.

celerate(4, 19, 0, 3);

//Brake all motors.

brake(4);