Raspberry Pi Hands-on Seminars

Slides:



Advertisements
Similar presentations
Sensing and Control.
Advertisements

1. Instrument Clusters Theory Support Automotive – Displays & Accessories 1 of 13 Instrument Clusters Topics covered in this presentation: Analog Instrument.
Introduction To Frc electronics
Microprocessor Motor Control Spring Introduction  Stamp projects Robots  Sensors  Motor control  Logic Rocketry  Reading acceleration (“g”
Servos The material presented is taken from a variety of sources including:
EML 2023 – Motor Control Lecture 4 – DAQ and Motor Controller.
Wiring the new control system MVRT 2010 – 2011 Season.
Make sure that you have a grounding strap to avoid static discharge that can ruin your computer. You always need to have a grounding strap connected to.
Part 1: Introduction FRC Introduction  FRC 2907 since 2008  Each area of the robot has a team assigned  The Electronics team is headed this year.
Servos The material presented is taken from a variety of sources including:
L.
ITE PC v4.0 Chapter 1 1 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public Computer Networks  Week 1: Introduction; Computer Hardware and Software.
How to Build a Digital-Physical System-Lab Assegid Kidané Fall 2014.
Digital I/O Connecting to the Outside World
Introduction.
Introduction to Arduino Prepared by R. Lamond.  “Arduino is an open-source electronics prototyping platform based on flexible, easy- to-use hardware.
1. A guide to wiring your robot. Jerry Skene Past mentor – Chantilly Robotics
1 Motors & Motor Controllers ECE AC or DC Motors AC –Few robots use AC except in factories –Most of those that use AC first convert to DC DC –Dominates.
RM2C Understanding Connections on the Robot Control Board (RCB).
1 Exercise 1 Computer Hardware. 2 Objectives for Exercise 1 When you complete this exercise, you will be able to:
APT 2.0 Simon Dawes & Keith Rickard Update 1. What is the APT? A utomatic P hotometric T elescope Built by Jack Ells in 1984 (based on JBAA) A utomatic.
Dean Brock, Rebecca Bruce and Susan Reiser, CCSC SE 2009 Using Arduino Material taken from Todbot blog Bionic Arduino Todbot blog Bionic ArduinoTodbot.
Microcontroller Hands-on Workshop #3 Ahmad Manshad New Mexico State University Institute of Electrical and Electronics Engineers November 7, 2009.
ENGR 6806 – Motor Control Prepared By: Rob Collett September 15, Office: EN2074.
Electricity and power supplies
Copyright © 2007 Heathkit Company, Inc. All Rights Reserved PC Fundamentals Presentation 4 – Inside the Computer.
Translate the following message:
MICRO CONTROLLER MODULE 1. Learning Objectives Name some gadgets that use microcontrollers. Define a microcontroller. Differentiate between a computer.
SE3910 Week 2, Class 1 Today Basic Circuits Other ??? Tomorrow Lab 2, S365 (Complete prelab BEFORE) Thursday See ScheduleSchedule SE-2811 Slide design:
Dr. John Helferty.  Arduino  Wi-Fi Shield  Relay  H-Bridge  Standard Servos  DC Fans  Impeller  Battery  PCB  Headers.
Capacitor Foundations of Technology Capacitor © 2013 International Technology and Engineering Educators Association, STEM  Center for Teaching and Learning™
7.2 V battery pack and charger Put the battery in the charger station at the end of the lab. period. Red light indicates charging. Ken Youssefi Introduction.
Overview What is Arduino? What is it used for? How to get started Demonstration Questions are welcome at any time.
Motors & Motor Drivers ECE 450.
Using Hobby Servos with the Arduino living with the lab © 2012 David Hall.
Servos The material presented is taken from a variety of sources including:
Computer Hardware Introduction to Computer Components and Terminology.
Microprocessors Tutorial 1: Arduino Basics
Introduction :  In the beginning, the calculator is the basic idea of computers out, then that arrived at the large computers.  in1980 or late seventies.
Submitted by:.  Project overview  Block diagram  Power supply  Microcontroller  MAX232 & DB9 Connector  Relay  Relay driver  Software requirements.
Mechanical Components and Programming Ken Youssefi Introduction to Engineering – E10 1.
Limited rotation servo basics David Hall output shaft servo horn red wire = 5V + black wire = Gnd - white wire = control signal standard servo.
1 Microcontrollers. 2 Programmers work in the virtual world Machinery works in the physical world Microcontrollers connect the virtual and physical world.
BlueROV Electronics and Controls Documentation
Components of Mechatronic Systems AUE 425 Week 2 Kerem ALTUN October 3, 2016.
Instrument Clusters Topics covered in this presentation:
Motors & Motor Controllers
Python with Raspberry PI Kit
Having fun with code, using Arduino in a middle school CS classroom
Introduction to Motors, servos and steppers
Class 1: Building a Raspberry Pi LED Flasher
Overview What is Arduino? What is it used for? How to get started
Microcontrollers, Basics Tips and Tricks with PIC MCUs
Introduction to Servos
Microprocessors Tutorial 1: Arduino Basics
Overview What is Arduino? What is it used for? How to get started
PC Mouse operated Electrical Load Control Using VB Application
Servos The material presented is taken from a variety of sources including:
Servos The material presented is taken from a variety of sources including:
Programming Concepts (Part B) ENGR 10 Introduction to Engineering
How to avoid catching things on fire.
Servos The material presented is taken from a variety of sources including:
Personal Computers and Applications
Instructor Resources.
Internet-of-Things (IoT)
Hitec HS 303: Robotic Servo Motor
UNIT 11: RC-SERVOMOTOR CONTROL
Python with Raspberry PI Kit
Instructor Resources.
Robot and Crickit HAT © Copyright 2019 by Dr. Elizabeth I. Horvath and Dr. Eva A. Horvath 1.
Presentation transcript:

Raspberry Pi Hands-on Seminars Interfacing to Servo Motors Gregory Griffes Gregory Griffes 8/16/15

Overview Types of servo motors and operation Electronic connections to a servo Python code to control a servo Wiring and operating your own servo motor

Hardware High power charging hub Custom servo cable Servo motor RPi GPIO Breakout breadboard 3.3v to 5v Level shifter (I2C safe version)

Parts Needed Canakit Ultimate Starter kit with breadboard, breakout board, ribbon cable, jumper wires, and electronic parts one Tek Republic TUH-3700 USB 3.0 7 Port Hub charging hub ($30) one HiTec HS-5055MG digital servo motor ($18) one Parallax continuous rotation servo motor ($10) one Adafruit 4-channel I2C-safe Bi- directional Logic Level Converter ($8)

Step 1: Avoid Damage to your Rpi hardware ESD – ElectroStatic Discharge Use a wrist strap, mat, & ESD bags

Step 2: Breadboard Remove the Rpi from the static bag Connect breadboard circuit (see video) Make sure the connector is correctly aligned

Step 2: Hardware Warnings DANGER! Step 2: Hardware Warnings +5V Damage! Voltage and current can damage Rpi GPIOs are 3.3 volt and NOT protected from other voltages Applying 5 volts to a GPIO can cause permanent damage to the Rpi When wired correctly – no damage occurs Rpi GPIO max voltage = 3.3v Rpi GPIO max current = 16ma (0.016) Rpi all GPIOs max current = 50ma / /- Rpi Correct +3.3V Rpi GPIO

Pulse Width Modulator PWM used for controlling the servo motor

Servo Motors PID (Proportional Integral Differentiator)

Servo Motor Specs Parameter Tower Pro SG51r Tower Pro SG-5010 Stall Torque @4.8v, 8.3 oz-in1 @4.8v, 76.4 oz-in Speed @4.8v, 0.08sec/60°2 @4.8v, 0.19sec/60° Price $5 Availability good Surge current3 660ma @ 5.2v 2.2 amps @ 5.2v Voltage Droop4 3.9v 3.3v Voltage Droop5 4.8v 4.6v 1” away from center line 8.3 ounces of force. The closer to the shaft the more force is applied but the travel distance is less. Takes 80 milliseconds to move 60 degrees at 4.8v power source Amps required to move to a new position Long wires (>12”); small gauge (breadboard wires); no filter cap Short wires (6”); large gauge (USB charging cable); 1000uf filter cap

180 degree servo (aka. Standard Servo) Type A: Wire colors: Brown (GND), Orange (+5v power), Yellow (PWM signal) 500us -> 2500us = counter-clockwise rotation Type B: Wire colors: Black (GND), Red (+5v power), Yellow (PWM signal) 500us -> 2500us = clockwise rotation

Continuous Rotation servo Wire colors: Black (GND), Red (+5v power), White (PWM signal) 1000us = maximum speed clockwise rotation 1500us = stopped 2000us = maximum speed counter- clockwise rotation

Custom Servo Motor cable PWM signal connection 1000uf capacitor USB Charging cable Servo motor

Wiring up the servo Power off the Raspberry Pi Wire breadboard Connect servo Power on servo and Rpi

Three approaches to controlling the servo Direct from 3.3v GPIO Using the Adafruit I2C safe level shifter Using the Adafruit 8 channel level shifter 3.3V GPIO I2C Safe 8 Channel Advantage Simple Cheap No soldering Can be used for both servo and sensors Fits on GPIO breakout breadboard 8 channels No pullups needed Smaller footprint than two I2C safe devices Disadvantage Unreliable long term Does not protect the RPi output from higher voltages Only 4 channels Requires pull ups Does not support I2C interface Additional breadboard needed Cost $0.05 $4 $8

Servo Motor Schematic (I2C safe) Use a separate power source for the servo Reason: when the motor moves, it causes a spike on the +5v power line

Using 3.3 volt GPIO output Custom Servo cable Servo motor GPIO 18 Series resistor (3.9k approx) RPi GPIO Breakout breadboard

Using Adafruit 8 channel level shifter Servo motor Servo cable 3.3v to 5v Level shifter (8ch version) RPi GPIO Breakout breadboard

Verify Have someone else verify your wiring to make sure you don’t damage your Rpi when you turn it on

Turn On Rpi Connect monitor, mouse, and keyboard Turn on power and boot the Rpi Login and startx, open file mgr Create a projects directory Connect to internet or use thumb drive Hover over the “projects” directory and “open terminal window” Enter “git clone http://github.com/griffegg/servo_motors”

Run the program Enter “cd servo_motors” Enter “chmod +x servo-slider.py” to make it executable. Enter “sudo ./servo-slider.py” Use mouse to move slider, observe servo motor moving

DMA Controller Direct Memory Access (DMA) Hardware used to perform memory transfers to/from memory or peripherals independent from CPU operation Very fast data transfers which are not interrupted by the CPU 16 DMA channels

Using the DMA engine to control the servo joan2937 commented a day ago @Vijayenthiran servoblaster and pi-blaster (and my pigpio) have been updated to work on the Pi2. The servoblaster github repository has not been updated. You can find a link to the updated software by searching for servoblaster on the rasperrypi.org forums.

Using the DMA engine This program does not use the DMA engine Observe how the servo motor jitters Use Servoblaster, pi-blaster, or pigpio to implement the DMA servo controller

Switch to Continuous Rotation servo Unplug the 180 degree servo and plug in the continuous rotation servo Observe the different behavior

Questions ? Done!