Introduction to Lego Mindstorms LMICSE Workshop June 14 - 17, 2005 Alma College.
-
date post
20-Dec-2015 -
Category
Documents
-
view
219 -
download
2
Transcript of Introduction to Lego Mindstorms LMICSE Workshop June 14 - 17, 2005 Alma College.
Introduction to Lego Mindstorms
LMICSE Workshop
June 14 - 17, 2005
Alma College
The Lego Mindstorms Kit
• The RCX (the brains)• Two Geared Motors• Two Touch Sensors• One Light Sensor• A USB IR Tower• A CD-ROM• The Constructopedia• Lots of Lego Pieces!
RCX Brick and StandardSensors and Motors
A Basic Robot Design
• The Constructopedia is a building guide.
• Shown at left is the basic Roverbot from the Constructopedia• A robust design• Allows attachment of any of
• double bumper (shown)• wheel sets (shown)• single bumper• light sensor• tank like treads
• A recommended design starting point
Basic Roverbot Configuration
The RCX Itself (1)
• Hitachi H8 series microcontroller• 8 bit CPU at 16 MHz• 32 KByte RAM• 16 KByte ROM for the BIOS• Serial I/O (input/output)• ADC (analog digital converter)• Built-in timers
RCX Brick
The RCX Itself (2)
• Liquid crystal display (LCD)• Four push buttons• One small internal speaker• Three sensor inputs• Three motor outputs• One infrared (IR) interface with a
proprietary protocol• Requires 6 AA batteries
RCX Brick
Actuators
• With Kit• Geared Motors
• Available From Lego• High-speed Motors• Mini-motor• Light Brick
• Available third party• Servo Motor/Servo Controller
Servo Controller w/ 2 Servo Motors
Ungeared andGeared Motors
Sensors Basics
• Mindstorms sensors come in two types
• Active: RCX supplies power• Example: Light sensor (supplied with kit)
• Passive: RCX just detects changes in resistance• Example: Touch sensor (supplied with kit)
Sensors Available from Lego
• Touch• Passive• Supplied with Kit
• Light• Active• Supplied with Kit
• Rotation (Angle)• Active• Add-on
Touch, Light and Rotation Sensors
Third Party Sensors (1)
• The sensor interface is well documented• Many sets of building instructions for sensors exist, for example
see Michael Gasperi’s website • http://www.plazaearth.com/usr/gasperi/lego.htm
• Two commercial suppliers we know of:• http://www.mindsensors.com• http://www.hitechnic.com
Third Party Sensors (2)
• Sonar (Ultrasonic range)• Available both from
Mindsensors and Hitechnic• Magnetic Compass Sensor
• Available from Hitechnic• Active and Passive Multiplexor
• Available from Mindsensors• And many others
Hitechnic Sonar
Mindsensors Active Multiplexor Hitechnic Compass
Software Architecture
Typical Software Architecture Levels
Software Architecture
• System ROM Layer
• Low Level Control Software
• Allows a second piece of software - the firmware
• Can be bypassed for direct control of the hardware
Lego Firmware
• The Lego firmware provides an environment for the execution of programs on the RCX.
• Must be downloaded (just once) before programming the RCX.• Other firmware solutions are available.• Lego Firmware v. 2.0 permits
• 5 separate programs• 10 threads• 32 global variables• 16 local variables per thread• Broadcast IR protocol
Alternative Firmware
• Firmware replacements further push the limits of the RCX• Popular replacements are tied to alternative programming
environments• Examples
• LejOS (Java)• see http://lejos.sourceforge.net/
• BrickOS (C/C++)• see http://brickos.sourceforge.net
• RCXLisp (Lisp)• Part of the LMICSE project• See http://robotics.csc.villanova.edu/
Programming the RCX
• Mindstorms ships with its own iconic programming language, but this is a very limited language.
• So others have developed for the RCX almost all the usual programming languages, including:• C• C++• Java• Ada• Lisp• Forth• Smalltalk
So What Now?
Let’s play
with
some Legos!