Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Learning Robotics using Python

You're reading from  Learning Robotics using Python

Product type Book
Published in May 2015
Publisher Packt
ISBN-13 9781783287536
Pages 330 pages
Edition 1st Edition
Languages
Concepts

Table of Contents (19) Chapters

Learning Robotics Using Python
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Introduction to Robotics Mechanical Design of a Service Robot Working with Robot Simulation Using ROS and Gazebo Designing ChefBot Hardware Working with Robotic Actuators and Wheel Encoders Working with Robotic Sensors Programming Vision Sensors Using Python and ROS Working with Speech Recognition and Synthesis Using Python and ROS Applying Artificial Intelligence to ChefBot Using Python Integration of ChefBot Hardware and Interfacing it into ROS, Using Python Designing a GUI for a Robot Using Qt and Python The Calibration and Testing of ChefBot Index

Chapter 5. Working with Robotic Actuators and Wheel Encoders

In this chapter, we will cover:

  • Interfacing a DC Geared motor with Tiva C LaunchPad

  • Interfacing a quadrature encoder with Tiva C LaunchPad

  • Explanation of interfacing code

  • Interfacing Dynamixel actuators

In the previous chapter, we have discussed the selection of hardware components needed to build our robot. One of the important components in robot hardware is the actuator. Actuators provide mobility to the robot. In this chapter, we are concentrating on the different types of actuators that we are going to use in this robot and how they can be interfaced with Tiva C LaunchPad, which is a 32-bit ARM micro controller board from Texas Instrument that works at 80 MHz. The first actuator that we are going to discuss is a DC geared motor with an encoder. A DC geared motor works using direct current, and has gear reduction to reduce the shaft speed and increase the torque of the final shaft. These kind of motors are very economic and we can...

Interfacing DC geared motor with Tiva C LaunchPad


In the previous chapter, we selected a DC geared motor with an encoder from Pololu and the embedded board from Texas Instruments called Tiva C LaunchPad. We need the following components to interface the motor with Launchpad:

  • Two Pololu metal gear motors 37Dx57L mm with 64 count per revolution encoder

  • Pololu wheel 90x10 mm and a matching hub

  • Pololu dual VNH2SP30 motor driver carrier MD03A

  • A sealed lead acid/Lithium Ion battery of 12 V

  • A logic level convertor of 3.3 V to 5 V https://www.sparkfun.com/products/11978.

  • A Tiva C LaunchPad and its compatible interfacing wires

The following figure shows the interfacing circuit of two motors using Pololu H-Bridge:

Motor interfacing circuit

To interface with Launchpad, we have to connect a level shifter board in between these two. The motor driver works in 5 V but the Launchpad works in 3.3 V, so we have to connect a level shifter, as shown in the following figure:

Level shifter circuit

The two geared DC motors...

Interfacing quadrature encoder with Tiva C Launchpad


The wheel encoder is a sensor attached to the motor to sense the number of rotations of the wheel. If we know the number of rotations, we can compute the displacement, velocity, acceleration, and angle of the wheel.

For this robot, we have chosen a motor with an in-built encoder. This encoder is a quadrature type, which can sense both the direction and speed of the motor. Encoders use different types of sensors, such as optical and hall sensors, to detect these parameters. This encoder uses Hall effect to sense the rotation. The quadrature encoder has two channels, namely Channel A and Channel B. Each channel will generate digital signals with ninety degree phase shift. The following figure shows the wave form of a typical quadrature encoder:

Quadrature encoder waveforms

If the motor rotates clockwise, Channel A will lead Channel B, and if the motor rotates counterclockwise, Channel B will lead Channel A. This reading will be useful to sense...

Working with Dynamixel actuators


Dynamixel is a kind of networked actuator for robots developed by Korean manufacture ROBOTIS. It is widely used by companies, universities, and hobbyists due to its versatile expansion capability, power feedback function, position, speed, internal temperature, input voltage, and so on.

The Dynamixel servos can be connected in a daisy chain; it is a method of connecting device in a serial fashion, that is, connecting one device to another through the connected devices, and can control all the connected servos from one controller. Dynamixel servos communicate via RS485 or TTL. The list of available Dynamixel servos is given at http://www.robotis.com/xe/dynamixel_en.

The interfacing of Dynamixel is very easy. Dynamixel comes with a controller called USB2Dyanmixel, which will convert USB to Dynamixel compatible TTL/RS485 levels. The following figure shows the interfacing diagram of Dynamixel:

ROBOTIS provides Dynamixel SDK for accessing motor registers; we can read...

Questions


  1. What is the H-Bridge circuit?

  2. What is a quadrature encoder?

  3. What is the 4X encoding scheme?

  4. How do we calculate displacement from encoder data?

  5. What are the features of the Dynamixel actuator?

Summary


In this chapter we have discussed the interfacing of motor that we are using in our robot. We have seen motor and encoder interfacing with a controller board called Tiva C LaunchPad. We have discussed the controller code for interfacing motor and encoder. In the future, if the robot requires high accuracy and torque, we have seen Dynamixel servos that can substitute current DC motors. In the next chapter, we will see different kinds of sensors that can be used in robots and its interfacing.

lock icon The rest of the chapter is locked
You have been reading a chapter from
Learning Robotics using Python
Published in: May 2015 Publisher: Packt ISBN-13: 9781783287536
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}