Artificial Life lecture 10 - PowerPoint PPT Presentation

1 / 36
About This Presentation
Title:

Artificial Life lecture 10

Description:

... if you want a motor to go forwards and backwards, easiest thing is to have one ... Reminder Lewes Bonfire! - 6am: Rouser. Around 5pm: Streets closed to traffic ... – PowerPoint PPT presentation

Number of Views:28
Avg rating:3.0/5.0
Slides: 37
Provided by: InmanH
Category:

less

Transcript and Presenter's Notes

Title: Artificial Life lecture 10


1
Artificial Life lecture 10
(A) Braitenberg vehicles as an introduction to
(B) ... Programming simple basic robots in the
Robot Lab. Rationale- everyone should have some
very basic hands-on experience of the problems
involved in building a robot that interacts
sensibly with its world. Difference between
reality and simulation. Then facilities available
for those who want to carry on in their own time,
or for course projects.
2
Alife projects
Next week (Mon 12th Nov) I shall give a lecture
on how to plan an Alife project. and by the
Monday after that (19th Nov) you should be
submitting your proposal for your own project,
for feedback. One strongly recommended approach
is to take some existing piece of published work
(paper, textbook, on web ) and replicate it
then adjust it, tweak it, play with it, extend it.
3
Plagiarism
This of course (like most other work in
science) requires you to distinguish carefully
in your report between ideas/code/text that you
learnt from others and new (or new tweaks to)
ideas/code/text that you brought to this
yourself. Any piece of work contains both. The
Academic Development Course should have covered
this issue, but you will also see among my FAQs a
FAQ page of my own on this. Go to http//www.infor
matics.susx.ac.uk/users/inmanh/FAQ/FAQ.html And
follow link to Local access only FAQs
4
Braitenberg Vehicles
Braitenberg (1984), Vehicles Experiments in
Synthetic Psychology, MIT Press. R. Pfeifer C.
Scheier (1999),"Understanding intelligence" MIT
Press Arkin (1998), Behavior-Based Robotics, MIT
Press.
5
BV
Simplest vehicle has just one sensor and one motor
It can only change its speed according to the
stimulus The sign means positive excitation
6
BV
Crossed positive connections mean that it will
turn towards the side with the greater
stimulus -- an aggressor Contra-lateral
excitation
7
BV
If the connections are not crossed, then it turns
away from excitation coward Ipsilateral
excitation
8
BV
Uncrossed inhibitory connections (note the sign)
give ipsilateral inhibition Turns towards the
light and slows down as it gets close
Note there will need to be some constant
positive signal to the motors as well, that gets
inhibited by the effects of the stimulus
9
BV
Contralateral inhibition Slows down on seeing
light, but then turns away and speeds up
again. Again, some constant positive signal to
motors needed also.
10
Simulation -- PopBugs
For a simulation that allows you to play with
Braitenberg-vehicle-like creatures, see Chris
Thorntons PopBugs. http//www.cogs.susx.ac.uk/us
ers/christ/popbugs/intro.html Or you could
build these for real and a lot more interesting
issues will crop up.
11
Theory and Practice
These sets of conceptual wires could be
implemented in real wires and capacitors and
resistors and
or you can emulate all this with a computer
12
Basics
sensors
Body nervous system
environment
motors
Many choices, but in this case body Lego and
Nervous system C program running on a
mini-computer, hooked up to various sensors and
motors
13
Program is a cheat
The computer program here is a bit of a cheat
it is emulating a nervous system of components
passing real values around in real
time. Actually real values to/from
motors/sensors are translated into digital
signals, and real time is handled by going round
a program loop indefinitely ( caution
needed) SEE my new FAQ !! Relates also to
GACTRNN exercise http//www.informatics.susx.ac.u
k/users/inmanh/easy/alife07/TimeSteps.html
14
Sensors and Motors
You can incorporate the EM brick in a Lego
structure, plug in sensors and motors
appropriately, and write a program to load onto
it. All the necessary library files for the
robot-specific functions have been written for
you, and should be available to you on all the
PCs in the Autonomous Systems Lab Use the header
file OS.h
15
EM the EASy Mind
Put together by Bill Bigge, based around the MRM
robot control board. Lego box with a 32bit
Motorola 68332 micro- processor, 512k RAM and
512k Flash ROM
16
Programming the EM
You will be writing the program in a C file on
the PC, include-ing a header file OS.h which
knows all about the particular translations
needed for the EM. Then you will compile the
code on the PC, but in a special format suitable
for use on the EM, ready to download to it. Then
you send it down a wire from PC to EM
17
Create a Programs directory on PC
Back on the PC- Open My Documents, from File
menu choose New gt Folder, and name it as Programs
18
Cygwin
Open a Cygwin window. This is a Unix-like window
on the PC you are sitting at.
19
Edit a file
You can use xemacs orNotepad or Wordpad or
cd WindowsProfile/My\ Documents/Programs
Notepad test.c
20
An example program .
Include header file and initialise
variables include ltOS.hgt int main() int
motor1, motor2 motor1 addMotorOnPort(
MOTOR_PORT_01 ) motor2 addMotorOnPort(
MOTOR_PORT_23 ) then the main loop
21
continued
for ( ) setMotorPower( motor1,
readAnaloguePort( 0 ) ) setMotorPower(
motor2, readAnaloguePort( 1 ) )
return 0 The for-loop goes round as fast as
poss for ever
22
What does it do?
Every time round the loop, it reads sensor values
of whatever you have plugged into AnaloguePorts 0
and 1 (suitably scaled), and sets the equivalent
power levels (suitably scaled) to whatever you
have plugged into MOTOR_PORTs 01 and 23 All sorts
of stuff is done in the background, hidden from
you A/D conversion, scaling factors, how fast
round the loop?
23
Compile the program on the PC
Having saved the program as a file with a .c
suffix, e.g. test.c, then in the Cygwin window
compile it with- compileCode -o output.s19 There
is a h flag that lists possible options, but the
o flag used here gives the output file the name
output.s19. This .s19 format is a special format
suitable for sending down the line to the EM
you can have a look at it if you like.
24
The EM brick
25
Send from PC to EM
Connect the lead from com port 2 to the RS 232
(serial) port on the robot. Then turn the robot
on. Find out where the RESET switch is physically
on the computer. Then you will use the program
P-Term to transfer the program down the wire.
Start Menu gt All Programs gt Comms Security
gt P-Term Exact details of settings etc available
on http//www.informatics.susx.ac.uk/easy/aslab/re
sources/lego_bots/software/compile_upload.html
26
After Downloading
The screen tells you when downloading has
finished (last picture) THEN you need to press
the RESET button on the EM Brick After a 2 or
3 second pause, the program that you downloaded
will start running.
27
Motor Ports
There are 16 output ports for motors, typically
used in pairs.
Signals sent with pulse width modulation
So if you want a motor to go forwards and
backwards, easiest thing is to have one signal
(one port) for each direction.
28
H-Bridge
The motors need a higher voltage than the robot
controller, and the low-level signals from the EM
need to be converted into power output. This is
done with the H-Bridge. 4 wires in, from a pair
of output port on the EM 2 wires out to the motor
29
Sensor inputs
Light-sensor with approx 180-degree field of
view. NB behaviour will vary greatly according
to how open or shielded it is.
These produce Analogue signals, and need to go to
the EM via an A/D converter. There are 8 such A/D
input ports
30
Binary ports versus Analogue ports
Some sensors, and indeed some outputs, can be
binary On/Off. Eg. Tactile sensors
A binary output could be eg. Switching a light
On/Off
There are 16 Binary I/O ports for this. Actually,
14 plus 2 already used for a couple of switches.
BUT you probably wont be using whiskers, more
likely to use
31
Infrared Rangefinder
A device that uses reflected Infra Red light to
measure distance. The rangefinders have an
effective range of between 10 cm and 80 cm.
These devices produce an output voltage that is
(v. roughly) inversely proportional to the
distance being sensed, in other words a short
distance produces a high voltage and a long
distance produces a low voltage. Roughly
non-linear see approx pic
32
Ports Summary
16 Motor output ports, typically 2 per motor 7
Input ports for Analogue signals. And 14
available binary ports for Input or Output And
you can plug in an LCD screen for debugging and
scope for further expansion
33
Warnings about sensors/motors
In simulations, magic sensors deliver reliable
information about eg distances. Magic motors move
the vehicle precise distances. In the real world,
it is nothing like that. Real sensors are noisy,
and react to far more than you might
guess. Calibration of sensors Wheels slip on the
floor, get jammed on bumps.
34
Worries about cheating
Sometimes people forget they are using a program
to emulate a nervous system, and sometimes this
breaks down. for ( ) How long does
this loop take? Does the time vary according to
circumstances? If you want something to happen at
a particular rate, how do you ensure that?
35
Robot lab classes
Tues 9am in PEV3-4C16 -- as normal Tue 9am
seminar Wed 2pm same place people as normal Tue
10am seminar (with one swap Philip ??
Stephen) See http//www.informatics.susx.ac.uk/lab
/adapt/aslab/index.html For comprehensive
information on robots, and http//www.informatics
.sussex.ac.uk/users/inmanh/easy/alife07/robotlab.h
tml For this weeks robot lab classes follow
link to Braitenberg Vehicle page
36
Reminder Lewes Bonfire! -
6am Rouser Around 5pm Streets closed to
traffic Around 7-9pm main processions in High
Street Around 930 1015 starts of 5 different
bonfires around town Around 130 am last trains
leave Around 200 am bonfires in streets
Final processions
Write a Comment
User Comments (0)
About PowerShow.com