mechanicaldesign.iit.edu
  • Home
  • MMAE 232
    • Syllabus
    • Assignments >
      • Overview and Schedule
      • CAD Assignment 1
      • CAD Assignment 2
      • Technical Writing Assignment
      • Sustainable Chair Part 1
      • Sustainable Chair Part 2
      • Sustainable Chair Part 3
      • Sustainable Chair Part 4
      • Trebuchet Part 1
      • Trebuchet Part 2
      • Trebuchet Part 3
      • Trebuchet Part 4
      • Bio-Inspired Robot Part 1
      • Bio-Inspired Robot Part 2
      • Bio-Inspired Robot Part 3
      • Bio-Inspired Robot Part 4
    • Handouts
    • Lectures
    • Lab Instructions >
      • Lab Week 1
      • Lab Week 2
      • Lab Week 3
      • Lab Week 4
      • Lab Week 5
      • Lab Week 6
      • Lab Week 7
      • Lab Week 8
      • Lab Week 9
      • Lab Week 10
      • Lab Week 11
      • Lab Week 12
      • Lab Week 13
      • Lab Week 14
      • Lab Week 15
    • Laser Cutter Instructions
  • MMAE 432
    • Syllabus
    • Assignments >
      • Sketch Model Challenge
      • Brainstorming
      • Three Needs Presentation
      • Sketch Model Presentation
      • Critical Function Science Fair
      • Solid Modeling
      • Assembly Drawing Review
      • Alpha Prototype Technical Review
      • Final Report
      • Final Presentation
      • Design Notebook Review
      • Final Peer Evaluation
    • Handouts >
      • BuyIt
    • Projects from Previous Years >
      • Spring 2023
      • Spring 2022
      • Spring 2017
      • Spring 2016
      • Spring 2015
      • Spring 2008
  • External Resources

Week 7: Fabrication Lab

This lab session will teach you the basics of controlling a servo with an Arduino board. If you have a laptop, please bring it to lab this week. Last year, everybody in the class had a laptop so this was not an issue.  You will be working in groups of two for this lab, so as long as one member has a laptop, you should be fine.   

Prelab Install the Arduino software on your laptop by following the instructions here: http: //arduino.cc/en/Main/Software.

Lab

  1. Connect your servo as shown in Fig. 1. Use only solid gauge wire. Stranded wire is less prone to break, but it is next to impossible to use in a breadboard. If you do have to use stranded wire, be sure to ’tin’ the strands of it with solder. A breadboard’s connections are shown in Fig. 2 as solid lines. Typically one runs power (red) and ground (blue or black) at the periphery of the board.
  2. Connect your Arduino to your computer using the USB cable.
  3. Run servo example. File->Examples->Servo->Sweep.
  4. Set Tools->Board->Arduino Mega 2560
  5. Set Tools->Serial Port!to the correct COM port. If you do not know the correct COM port and you have a windows machine, open your Device Manager. Expand the Ports option. If you have an Apple product, find comfort in the fact that you look good at a coffee shop and check the Arduino website for help.
  6. Show the TA or Prof. Spenko that you can successfully run the servo example.
  7. What is the purpose of the for loops in the previous example?
  8. Create program to move your servo in the following steps. Do you need the for loops? (a) Move to 0. (b) Wait 2 seconds (c) Move to 180. Note that the servo may not actually get to 180. It may stop a few degrees short. That is fine. (d) Wait 1 second (e) Move to 45 (f) Wait 1 second (g) Move to 90 (h) Wait 0.5 second (i) Repeat
  9. What if you wanted to slow the servo speed down. What would you have to do?
  10. Show the TA or Prof. Spenko that you can successfully run this code.
  11. Connect two servos to the Arduino.
  12. Run two servos such that output follows:             pos1 = 90 sin (a*t) + 90                                           pos2 = 90 sin (b*t) + 90                                             where b and a are values of your choice a t is time. Play around with different values. You will find that you cannot make them too large. If you do, the input signal will be beyond the bandwidth of your servo. This means the servo will not be able to complete its full motion. To get time, go to the Arduino website and look under the reference section.
  13. Show the TA or Prof. Spenko that you can successfully run this code. You will use this knowledge in the trebuchet project and, more importantly, in the bio-inspired design project.
Picture
Picture
copyright 2019 Matthew Spenko