Book Image

Python Robotics Projects

By : Prof. Diwakar Vaish
Book Image

Python Robotics Projects

By: Prof. Diwakar Vaish

Overview of this book

Robotics is a fast-growing industry. Multiple surveys state that investment in the field has increased tenfold in the last 6 years, and is set to become a $100-billion sector by 2020. Robots are prevalent throughout all industries, and they are all set to be a part of our domestic lives. This book starts with the installation and basic steps in configuring a robotic controller. You'll then move on to setting up your environment to use Python with the robotic controller. You'll dive deep into building simple robotic projects, such as a pet-feeding robot, and more complicated projects, such as machine learning enabled home automation system (Jarvis), vision processing based robots and a self-driven robotic vehicle using Python. By the end of this book, you'll know how to build smart robots using Python.
Table of Contents (24 chapters)
Title Page
Packt Upsell
Contributors
Preface
Index

Changing the speed 


Now that we have understood how to change the direction of the motor using the motor driver, it's time to take it a step further and control the speed of the motor using the motor driver. To do this, we don't really have to do much. The motor drivers are built to understand the PWM signals. Once the PWM signal to the motor driver is provided, then the motor driver in turn adjusts the output voltage for the motor and hence changes the speed of the motor driver. The PWM has to be provided on the same input ports IN 1 and IN 2 for motor A, and IN 3 and IN 4 for motor B. It is obvious that the pin on which the PWM is provided will decide the direction in which the motor will move, and the duty cycle of the PWM will decide the speed at which the motor will be spinning. 

Now we have understood how speed control in motor driver works. It's time to do it by ourselves. To do so, we do not need to make any changes to the connections; all we need to do is to upload the following...