Servos are incredibly versatile actuators. Robotic systems requiring precision contol utilize them. Students will become familiar with the basic operations of a servo motor.
You will need the following components from your kit for this assignment:
- Raspberry Pi
- Several Jumper Wires (see diagrams below)
- HiTec Servo
Construct the prototype using the diagram below:
-
Prerequisites:
- SSH connection to your Raspberry Pi (Using the Secure Shell App)
- Install Git on your Raspberry Pi (Should already be installed)
-
Get the code and run the script:
git clone https://github.com/WHS-Robotics-Engineering-2022-23/5-6-0-Servo_Control_with_Python-[your username]
cd 5-6-0-Servo_Control_with_Python
sudo python3 main.py
If everything is connected properly, your servo should be moving through several positions. Feel free to mess around with the code a little if you like.
To learn more, try this video:
A more detailed and complex application for a servo may be found here.
Now that you know how the sensor runs and can see how some of the code works, answer the following questions. Save them in a markdown file in this repo named, "observations.md". Shoot a video of your working servo using the code you were provided. Also, modify the code in your own way to change the behavior of the servo in order to demonstrate you understand the coding at a basic level. Push that new script to this repo and include a video of that as well in your "observations.md" file.
- In what various ways does the servo behave differently than a DC motor?
- What makes the use of a servo more complex (remember that if you were controlling a DC motor with a Pi, you would need to write some code)?
- What applications do you think servos are appropriate for? Explain.