Review and Practice

Self-check

  • In this activity, you:
    • Identified a servo’s major parts.
    • Connected battery power and a servo to your breadboard.
    • Wrote scripts to control which positions the servo held.
  • Were you able to properly tune the servo?
  • Were you able to use y = mx + b to calculate duty cycle and resulting angles?

                                   
Questions

  1. What are some ways that a hobby servo is likely different from a servo you would find used on larger equipment? Why?    
  2. What is fed to the servo through the connected cable?
  3. Given the setup of the servo, what are the smallest and largest angles through which the servo can rotate?
  4. Why does this servo horn not make a complete rotation?
     

Exercises

  1. Approximately what analog value will result in the servo horn pointing to 90°?
  2. Approximately what analog value will result in the servo horn pointing to 180°?
  3. What command is used to set the servo horn in motion to a specific location?
  4. When controlling the servo, what is the purpose of pin16.set_analog_period(20)?
  5. What’s the actual high time from pin16.write_analog(77)?


Projects

  1. Create a script that will move the horn back and forth between 0° and 15°.
  2. Modify the terminal control program so it restricts the range from 45° to 135°.
  3. Modify the terminal control program so that it informs the user of an error when they try to enter a value that's out of the valid range.