Self-check
- In this activity, you:
- Measured a servo signal’s period.
- Calculated its frequency.
- Verified that pulse width (how long the brief on-times last) is what contains the information the servo needs to respond to by correctly positioning its horn.
- Predicted a pulse width at a certain angle and wrote a script to:
- Set the servo to that angle
- Test to verify that your predicted pulse width is correct
- Were you able to measure a servo’s signal period and calculate the frequency?
- Do you understand how the pulse width controls the servo horn position?
- Were you able to write a script to control the servo angle and verify the measurements on the oscilloscope?
Questions
- Who might use an oscilloscope for servo measurements?
- What do you call the time that the signal stays high?
- Is the pulse width for a 45° angle narrower or wider than the pulse width of a 180° angle?
- What term is used to describe the space between two adjacent rising edges?
- What will the time difference be between the first and second signal period for a 90° angle?
Exercises
- What is the function of write_analog(value) in regards to the servo?
- What determines the angle of the servo horn?
- How do you determine the frequency of a signal?
- What is the duty cycle for a 15° angle?
Project
Predict the pulse width for 15°. Calculate the duty cycle for positioning the servo horn at 15° then write the script to verify your prediction that moves back and forth 0° and 15°.