Book Image

Learn Robotics Programming

By : Danny Staple
Book Image

Learn Robotics Programming

By: Danny Staple

Overview of this book

We live in an age where the most difficult human tasks are now automated. Smart and intelligent robots, which will perform different tasks precisely and efficiently, are the requirement of the hour. A combination of Raspberry Pi and Python works perfectly when making these kinds of robots. Learn Robotics Programming starts by introducing you to the basic structure of a robot, along with how to plan, build, and program it. As you make your way through the book, you will gradually progress to adding different outputs and sensors, learning new building skills, and writing code for interesting behaviors with sensors. You’ll also be able to update your robot, and set up web, phone, and Wi-Fi connectivity in order to control it. By the end of the book, you will have built a clever robot that can perform basic artificial intelligence (AI) operations.
Table of Contents (21 chapters)

Positioning a servo

To position a servo, we need to set up a servo horn so we can see it move, and then plug it into the motor controller board. A servo horn is a small collar with one or more arms, usually used to connect the servo spindle/axle to a mechanism they will move. Your servo motors will come with small bags of hardware, which will contain a few different horn types and screws to attach them both to the servo and the parts you want them to move. The following photo shows the bag and how to attach a horn to a servo:

Fitting a servo horn

Screw a one arm horn together with the servo, as shown. Use the very short small screws for this as the longer screws will break the servo. Note that the long collar of the horn fits over the servo's output spindle. Try to line up the arm of the horn in the middle. Importantly, in the last image, don't over-tighten the collar...