Introduction to Robotics
Chapter 2
Objectives
Understand how robotics fits in to computer science
Understand some typical uses of robots today and
the types of problems addressed in robotics.
Understand the PropBot v2.0 robot that you will be
using in the lab
Understand the types of problems addressed in
robotics
2-2
Chapter 2 – Introduction to Robotics Fall 2012
What’s in Here ?
Introduction
– What is a robot ?
– Where are They Used ?
Programming Strategies
– Approaches
– Challenges
– Uncertainty
PropBot 2.0
– Original Boe-Bot Kit
– Its History and Changes
– Add-On Sensors
– Power Requirements
2-3
Chapter 2 – Introduction to Robotics Fall 2012
Introduction
What is a Robot ?
The definition of a robot can vary greatly.
Simply put, a robot is a device that can
move and react to sensory input.
Robotics is the science or study of the technology
associated with the design, fabrication, theory, and
application of robots.
Their design can involve many specialized areas:
– Mechanical Engineering - Cognitive Science (A.I.)
– Electrical Engineering - Chemistry (nanotechnology)
– Computer Science
2-5
Chapter 2 – Introduction to Robotics Fall 2012
Robot Components
Wireless Link
to central “Brain(s)”
station, other processor,
robots, GPS, algorithms,
etc… strategies, etc…
Sensors
vision, sound,
touch, gauges,
etc…
Body
appearance,
Actuators metal, plastic,
motors, "bells &
hydraulics, whistles“, etc…
pneumatics (air),
etc…
2-6
Chapter 2 – Introduction to Robotics Fall 2012
Robots – Mechanical Engineering
Typically studies:
– designing robot shape & its mechanics
– issues: efficiency, payload limit, materials
– walking, climbing, flexible bending
– biomimetics (mimicking real life design)
2-7
Chapter 2 – Introduction to Robotics Fall 2012
Robots – Electrical Engineering
Typically studies:
– efficiency issues (power/battery requirements)
– sensor and actuator (e.g., motor) design
– wireless communications
– board design and computer interfacing
2-8
Chapter 2 – Introduction to Robotics Fall 2012
Robots – Computer Science
Typically studies:
– deciding what to do with the robot
– navigation, motion planning, behaviors
– machine vision, 3D scene reconstruction
– cooperation and learning strategies
2-9
Chapter 2 – Introduction to Robotics Fall 2012
Robots – Cognitive Science
Typically studies:
– Artificial Intelligence
– humanoids
– connectionism (neural networks)
– language processing
– learning and Memory
2-10
Chapter 2 – Introduction to Robotics Fall 2012
Robots – Chemistry
Typically studies:
– nano-sized robots for nano-applications
– chemical engineering to produce motors
– etc…
2-11
Chapter 2 – Introduction to Robotics Fall 2012
Where are they used ?
Robots are now widely used in:
– factories to perform high-precision jobs
(e.g., welding, painting, riveting)
– dangerous locations for humans
(e.g., cleaning toxic wastes or defusing bombs)
– home applications
(e.g., vacuum cleaner, lawn mowing)
– entertainment
(e.g., AIBO)
– competitions
(e.g., robocup, F.I.R.S.T.)
2-12
Chapter 2 – Introduction to Robotics Fall 2012
The Robotics Market
There are different markets for robotics: For more information, see
[Link]
Articulated robot arms
(e.g., manufacturing, spot Robotics Mobile, interactive,
welding, painting, assembly) autonomous devices
Industrial Robotics Service Robotics
(e.g., industrial cleaning,
equipment maintenance /
servicing, data acquisition,
medical/healthcare, rehabilitation,
Professional Personal/Domestic/Consumer
prosthetic/orthotic devices, mars
exploration, inspection, security,
Service Robotics Service Robotics
construction, demolition, delivery,
unmanned ground / underwater /
aerial vehicles, rescue, fire Education/Hobbyist/Entertainment – LEGO mindstorms
fighting, de-mining, surveillance, Home Care – vacuum cleaners, lawn cutting, security
public safety etc..) Smart Toys – RobotSapien, Pleo, Aibo
Home Assistance – elderly assistance
2-13
Chapter 2 – Introduction to Robotics Fall 2012
The Robotics Market
Trends are showing that the robotics market is expanding
in many areas and projections indicate a dramatic
increase in both funding and interest:
Many robotics-related jobs will arise, in engineering,
computer science, sales & marketing, accounting &
operations, business development, public relations, etc..
2-14
Chapter 2 – Introduction to Robotics Fall 2012
Programming Strategies
Computer vs. Robotic Programs
Computer Programs:
– designed to compute an answer
– data usually valid when available
– predictable program flow
– foreseen errors easily handled
Robotic Programs:
– designed to react to achieve goals, not “an answer”
– sensors often produce invalid data (or data missing)
– unpredictable situations due to dynamic environment
(e.g., unforeseen obstacles, wrong or missing sensor data,
communication outages, hardware failure, etc..)
– program must degrade gracefully in difficult situations
2-16
Chapter 2 – Introduction to Robotics Fall 2012
Robot Programming - Approaches
There are two fundamental approaches:
– Top-down (Classical) approach:
- Central processing for overall robot actions.
- Start with high-level plan of action
- Hierarchical/sequential processing structure
- Well-defined functionality
– Bottom-up (Behavior-Based) approach:
- Independent low-level behaviors
- Learn basic functionality and build upon them
- Flat/parallel processing structure
- More complex tasks accomplished through emergent behavior
2-17
Chapter 2 – Introduction to Robotics Fall 2012
Robot Programming - Compare
Top-down approach: Bottom-up approach:
+ Easy to assess and re-plan + Quick response time
overall goal strategy + More robust
+ Simpler to code
- Usually complex and fragile
+ Easy to handle unforeseen
code problems
- Hard to handle unforeseen - Hard to achieve high-level
goals
problems
- Adding functionality requires
more computational power
- Slow response time.
2-18
Chapter 2 – Introduction to Robotics Fall 2012
Robot Processing
Here is the basic “flow of control” commonly used:
Perceive
environment Make changes to
environment
Sense Think React
perception / action data
World Environment
Model Control System
actions
2-19
Chapter 2 – Introduction to Robotics Fall 2012
Robot Processing
Classical vs. Behavior-Based processing:
Sensor Data Sensor Data
Perception Manipulate World
Memory
Memory
Build Map
Modeling
Explore
Planning Avoid Collisions
Task Execution Navigate
Motor Control Motor Control
CLASSICAL BEHAVIOR-BASED
2-20
Chapter 2 – Introduction to Robotics Fall 2012
Challenges
Physical/Mechanical/Electrical Issues:
– sensors are prone to errors and bad readings
– sensor input requires lots of processing power
– actuators drain batteries, not small/powerful enough
Knowledge Representation & Retrieval:
– difficult to represent real world in robot’s memory
– difficult to “sift though” mounds of data to pick out relevant
information
– real world changes, requires robots to be adaptive
2-21
Chapter 2 – Introduction to Robotics Fall 2012
Uncertainty
There is an enormous amount of uncertainty
in a robot’s environment.
Various physical factors contribute to uncertainty:
– Environment is unpredictable and highly dynamic
– Sensors are limited:
- range and resolution limited physically
- subject to noise
- can (and will) break
– Actuators can be unpredictable
- noise, wear-and-tear, mechanical failure
2-22
Chapter 2 – Introduction to Robotics Fall 2012
Uncertainty
Other factors contribute to uncertainty:
– Internal models of the environment are approximate.
– Algorithms are approximate in order to be real-time.
So what’s the big deal ?
Robots are sometimes forced to act possibly without
sufficient information from sensors and internal
models.
They cannot make the right decisions with absolute
certainty
2-23
Chapter 2 – Introduction to Robotics Fall 2012
Probabilistic Robotics
Probabilistic Robotics:
– is a relatively new approach in robotics
– addresses uncertainty in robot perception and action
– represents uncertainty explicitly using math:
Instead of maintaining a “best guess”, information is represented by
probability distributions over a whole space of guesses.
– degrades gracefully in the presence of uncertainty
– outperforms other techniques in many situations
2-24
Chapter 2 – Introduction to Robotics Fall 2012
Probabilistic Robotics
The internal models are integrated with sensor data
making it more robust.
Allows it to scale better to more complex
environments.
The only working solution for mapping
and localization in large environments.
Limitations:
– Computational complexity (can be less efficient)
– Need to approximate
2-25
Chapter 2 – Introduction to Robotics Fall 2012
What will WE do ?
We will learn how to:
– Write small, condensed programs in SPIN
– Program simple behaviors in a robot
– Estimate a robot’s position as it moves
– Use various sensors and cope with their inefficiencies
– Extract map features and create maps
– Analyze and merge sensor data
– Understand simple 3D vision
– Navigate in a 2D environment
– Understand the pain (yet joy) of working with a real robot
2-26
Chapter 2 – Introduction to Robotics Fall 2012
What we will NOT do ?
We will not learn:
– How to design and build robots
– How to program different types of robots
– Artificial Intelligence
– Team robotics strategies
– Complicated machine vision and 3D reconstruction
– Genetic Algorithms and other forms of learning
– How to perform particular tasks.
There is a lot that we are not doing … but it is
important to know the basics.
You can always do an honours project if you have an interesting idea.
2-27
Chapter 2 – Introduction to Robotics Fall 2012
The PropBot v2.0
The Board of Education
Robots for this course were initially
based on the Boe-Bot kit:
Servos (motors)
Application Modules connect here
(e.g., bluetooth) go here
Power supply or
batteries Power for
components:
• Vdd = +5v
USB connector to • Vss = Gnd
PC • Vin (we won’t use)
• upload code
• debug
Breadboard for
Microprocessor connecting
goes here circuits
(e.g., sensors)
Power switch:
0 = off Connections to
1 = on without servos
2 = on with servos microprocessor
2-29
Chapter 2 – Introduction to Robotics Fall 2012
Stamp Microprocessors
Various “Stamp” microprocessors fit onto BOE:
– vary in terms of speed, memory, current usage etc…
BS2 BS2e BS2sx BS2p BS2pe BS2px Javelin BasicX-24P
Stamp
Microprocessor
Operating Speed 20Mhz 20Mhz 50Mhz 20Mhz 8Mhz 32Mhz 25Mhz ? Mhz
Execution Speed ~4k ~4k ~10k ~12k ~6k ~19k ~8.5k 83k
(instructions per sec.)
RAM (bytes) 32 32 32 38 38 38 32k 400
ScratchPad RAM (bytes) N/A 64 64 128 128 128 N/A N/A
EEPROM (Program Size) 2k 8 x 2k 8 x 2k 8 x 2k 16 x 2k 8 x 2k 32k 32k
bytes bytes bytes bytes bytes bytes bytes bytes
Current (run) 3mA 25mA 60mA 40mA 15mA 55mA 80mA ~80mA
Current (sleep) 50uA 200uA 500uA 350uA 36uA 450uA N/A N/A
PBASIC commands 42 45 45 61 61 63 JAVA BasicX
2-30
Chapter 2 – Introduction to Robotics Fall 2012
Our Robot’s History
The robot for this course has been improved over the
years …
5
1
6
3 7
2
8
4
2006 2007 2008 2010
1. Removed user-defined sensor setup … now hardwired to avoid mistakes
2. Switched to battery packs … less battery waste
3. Thicker wheels with real tires … less prone to wear
4. Block guide thicker and wider … hold blocks better when turning
5. Pan/Tilt head, smaller body
6. Smaller/improved tracking tags
7. More IR sensors and other improvements
8. Grippers!
2-31
Chapter 2 – Introduction to Robotics Fall 2012
The Changes
New to 2011, completely re-designed main board
running Parallax Propeller Processor:
2-32
Chapter 2 – Introduction to Robotics Fall 2012
Why Change Microprocessors ?
The Good The Bad
Basic Stamp 2 + simple to use - slow
+ very nice IDE - no floating point numbers
+ came with BOE kit (no extra cost) - only 16 I/O lines
- only 2k of program space
- only 24 bytes for variables
BasicX + faster than BS2 - very poor IDE
+ has full floating point math - difficulties with Serial I/O
+ 32k of program space - still only 16 I/O lines
+ 400 bytes for variables
Propeller + true multi-tasking with 8 processors - weird floating point math
+ has floating point - serial I/O in assembly code
+ 64k of program/variable space
+ nice IDE with Spin language
+ 32 I/O lines (i.e., more sensors)
2-33
Chapter 2 – Introduction to Robotics Fall 2012
Additional Components
We also added the following to our robot:
– WheelWatcher1 Encoders
– Continuous Rotation Servos
– Wheels with encoder stickers
– QTR-1RC Reflectance Sensor
– 8 GP2Y0D810(05)Z0F IR Sensors
– Ping))) Ultrasonic Range Finder
– DIRRS+ IR Ranging System
– CMUcam1 Camera Module
– Micro Pan Tilt System
– 2 Pico Servos
– Parallax EasyBluetooth Module
2-34
Chapter 2 – Introduction to Robotics Fall 2012
The Completed PropBot 2.0
The completed robot as will be used in the labs:
DIRRS+
Sonar sensor Infrared
sensor
Camera
Bluetooth board
(at back)
3 Front IR sensors Head Pan/Tilt
System
Back-facing IR Sensor
Reflectance sensor Side IR Sensors
to detect block
Wheel encoders
Dual Front Grippers
2-35
Chapter 2 – Introduction to Robotics Fall 2012
PropBot Options
Optional Accelerometer, Compass and IR Beacons
may be installed: Pololu
IR Beacon
Transceiver
HMC6352
Compass
Module
LIS302DL
3-axis
Accelerometer
2-36
Chapter 2 – Introduction to Robotics Fall 2012
The Sensor Switches Switches are hard to
Robot has an 8-position dip-switch on
flip. Use the tip of a
pen to flip them up or
down.
the top board and a 2-position switch ON = down, OFF = up
at the back of the bottom board:
– enables/disables power to various sensors
– always turn off power to sensors not being used
ON
1 2
to save battery power
1. Block Detector
2. Wheel Encoders
ON
1 2 3 4 5 6 7 8
1. Front & Back IR
2. Side IR Sensors
3. Bluetooth
4. Accelerometer &
Compass
5. Camera
6. Sonar
7. DIRRS+
8. Beacon
2-37
Chapter 2 – Introduction to Robotics Fall 2012
Robot Power
The back of the robot contains important Plug in battery
connections: pack or AC
adapter here.
Reset button (use this if you just
want to restart your program)
Main on/off
switch
Plug in USB cable here (with the propeller
hat facing up). Use this to get your code onto
the robot and to send data to the PC during
sensor/servo configuration.
2-38
Chapter 2 – Introduction to Robotics Fall 2012
The Battery Packs
Robot uses 7.2v rechargeable battery packs
– There are also power adapters available for
testing the robot while beside you at the desk.
Plug in battery packs and slide under frame
The cables will
stick out a bit.
The battery monitor is no
longer being used.
2-39
Chapter 2 – Introduction to Robotics Fall 2012
Battery Pack Charging
To recharge a battery pack …
– remove and unplug it from the robot
– plug it into the charger
– press the Start button
on the charger
– wait for 3 beeps, then
remove the battery pack
Note:
Sometimes, a battery pack won’t
fully charge (i.e., the bars don’t
make it all the way to the left on
the display). When this happens, let the pack cool off and then charge it
again.
2-40
Chapter 2 – Introduction to Robotics Fall 2012
The PropBot Tags
The PropBots have a circular disk at the top with a
unique tracking tag:
– Over time, tag may rotate a little and need to be adjusted.
– Largest triangular wedge portion of tag must face forward
Robot Front black wedge
faces this indicates front of
direction. robot.
3 gray areas are
colored either black
or white as they
represent bits that
allow 8 unique
combinations.
2-41
Chapter 2 – Introduction to Robotics Fall 2012
Summary
You should now understand:
– The areas of study involved with robotics and how we, as
computer scientists, fit-in.
– Some of the main uses and issues in robotics
– The difference between behavior-based programming and the
classical approach
– The components of the PropBot that will be used in the lab as
well as some available options.
2-42
Chapter 2 – Introduction to Robotics Fall 2012