Download Embedded Systems Sensors and Odometry

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Opto-isolator wikipedia , lookup

Immunity-aware programming wikipedia , lookup

Computer science wikipedia , lookup

Transcript
Embedded Systems
Sensors and Odometry
Laboratory for Perceptual Robotics – Department of Computer Science
Sensing vs. Perception
 transducers - devices that convert some physical
phenomenon into electrical signals
 A/D conversion - the conversion from analog signal (0-5V)
into a fixed precision (typically 8-12 bits) digital
representation
 perception - the interpretation of signals derived from
transducers in order to estimate state information required
for control.
 observability - if state x(t0) can be determined given
measurements z(t) in the interval between t0 and t1, then
x(t0) is observable. If x(t) is observable for all t, x is
completely observable.
 controllability - a system is controllable at time t1>t0 if a
suitable control u(t) can be found to drive the system from
an arbitrary x(t0) to another arbitrary state x(t1).
Laboratory for Perceptual Robotics – Department of Computer Science
2
Reconstruction
Stimulus = f(World)
World = f-1(S)
• function, f(), is only partially known,
• in general, the inverse of f() is not well-conditioned
• time spent “perceiving” often renders world models obsolete
Laboratory for Perceptual Robotics – Department of Computer Science
3
Embodied Perceptual Systems




rich sensor feedback
interaction
time series feedback
knowledge can fill in
inaccessible detail
Laboratory for Perceptual Robotics – Department of Computer Science
4
Sensor Drivers and Interface Circuitry
photosensors, micro switches, microphones, pyroelectric,
near IR reflectance, sonar, strain gauges, gyroscopes,
accelerometers, force, compasses, vision,...
 sensitivity S - a property of the transducer and describes
the x (physical quantity) that is required to produce a r
(change in response)...
r/r = S (x/x)
 range, R - the range in the observable quantity x that
maps onto the 0-5 V transducer output
 resolution - the smallest x that can be observed, i.e.,
R/255 (linear transducer and 8-bit A/D).
Laboratory for Perceptual Robotics – Department of Computer Science
5
Light Sensors - Photoresistor
voltage divider Vsignal = (5V) RR/(R + RR)
• choose R=RR when ambient light is midrange
• Cadmium Sulfide (CdS)
• cheap
Laboratory for Perceptual Robotics – Department of Computer Science
6
Light Sensors - Phototransistor
greater sensitivity
Laboratory for Perceptual Robotics – Department of Computer Science
7
Light Sensors - Pyroelectric Sensors




lithium tantalate crystal is heated by thermal radiation
inducing charge
tuned to 8-10 m radiation - respond to human IR
signature
motion detecting burglar alarm
Eltec 442-3 sensor - two elements, Fresnel optics,
output proportional to the difference between the
charge on the left crystal and the charge on the right
crystal.
Laboratory for Perceptual Robotics – Department of Computer Science
8
Other Common Sensor Technologies
Force
•
•
•
•
•
strain gauges - foil, conductive ink
piezoelectric films
conductive rubber
capacitive force
rheostatic fluids
Sound
• microphones
• sonar
Position
•
•
•
•
microswitches
shaft encoders
gyros
tilt/compasses
Proprioceptive
• battery-level
• motor current - stall, external
force
• temperature
Laboratory for Perceptual Robotics – Department of Computer Science
9
Odometry photoreflectors
Laboratory for Perceptual Robotics – Department of Computer Science
10
Odometry - photoreflectors
Laboratory for Perceptual Robotics – Department of Computer Science
11
Odometry Project - 3 lab meetings
 Breadboard P5587, measure
output properties, monitor
output with HandyBoard
 Interrupt-based pulse counter,
build simple/quadrature
encoder
 Estimate (x,y,t), servo--rotate, translate scheme
sensor signal
+5V supply
ground
Laboratory for Perceptual Robotics – Department of Computer Science
12
Quadrature Encoder
Laboratory for Perceptual Robotics – Department of Computer Science
13
6811 System Interrupt Structure
Timer-counter hardware is connected to 6811 port A - IC3 register
associated with PA0 can generate interrupt every rising edge.
System interrupts - 1000 Hz, used for OS time keeping and other
periodic functions (LCD display)
Binary programs can install themselves into the system interrupt
structure
6811 interrupt vector points to run-time interrupt handlers
User can hijack the pointer and use it to point to a user defined
handler, and arrange it so that after the user handler completes, it
goes to the run-time interrupt code.
Laboratory for Perceptual Robotics – Department of Computer Science
14
6811 System Interrupt Structure
At end of every fetch-decode-execute cycle:
CPU checks enabled interrupts
iff interrupt
Save registers, flags, pgm counter
Load interrupt vector into pgm counter
Execute interrupt code
RTI - restore and resume
Masking - interrupts can interrupt interrupts
Laboratory for Perceptual Robotics – Department of Computer Science
15
6811 System Interrupt Structure
dedicated RAM
location
6811 interrupt
vector
before user installation
IC system
Software
interrupt
driver
RTI
Laboratory for Perceptual Robotics – Department of Computer Science
16
6811 System Interrupt Structure
dedicated RAM
location
6811 interrupt
vector
user asm
program
JMP
after user
installation
IC system
Software
interrupt
driver
RTI
Laboratory for Perceptual Robotics – Department of Computer Science
17
Example: Photoreflector
* 6811 registers
TOC4INT
equ
$BFE2
* digital input register
DIGIN
equ
$7000
org
Port
#include <6811regs.asm>
Compile time strings equated to all
6811 registers and interrupt vectors
MAIN_START
* Variables accessible from C
variable_dir
fdb
1
variable_count
0
* Interrupt code called at 1000 Hz
interrupt_code_start:
ldab
DIGIN
; accumulator B = (current value of DIGIN port)
andb
#1
; accumulator B = (accumulator B) & 1
* Internal variables (not accessible from C)
eorb
state
; accumulator B = (state changed) ? 1 : 0
state
beq
interrupt_code_exit ; branch if there is no change in state
* Install module into 1KHz IC system interrupt on TOC4
subroutine_initialize_module:
ldd
TOC4INT
; ptr to original vector
std
interrupt_code_exit+1 ; install for our exit
ldd
#interrupt_code_start ; ptr to our routine
std
TOC4INT
; install at TOC4 int
eorb
state
; accumulator B = (accumulator B) ^ state
stab
state
; save accumulator B to state
ldd
variable_dir
; load value to inc/dect from global variable
* Reset variables
addd
variable_count
; accumulator D = (accumulator D) + variable_dir
Laboratory
fdb
fdb
0
ldd
#0
std
variable_count
ldd
#1
std
for
ldab
variable_dir
Perceptual
DIGIN
subroutine initialize std
module variable_count
begins init. portion of user pgm
interrupt_code_exit:
jmp
; update variable count
$0000
Robotics – Department of Computer
Science
18
Creating Binaries (.icb files) from Assembly Code (.asm files)
The icb.sh script provided in the /as11 directory is used to create
executable binaries from your assembly code.
For example, to compile a binary version of the quadrature encoder:
> sh icb.sh qencdr_10_12
reads qencdr_10_12.asm and produces the binary output file
qencdr_10_12.icb.
Creating a .lis file
Multiple files can be loaded simultaneously by making a .lis file
that you can load from the IC command prompt. In this file, list each
filename you want loaded into the Handy Board. Load the .lis the
same way that single files are loaded onto the HandyBoard.
Laboratory for Perceptual Robotics – Department of Computer Science
19