Vous êtes sur la page 1sur 15

MATLAB meets Mindstorms

How to control Lego NXT robots using Matlab for educational purposes

Dorian Schneider
Institute of Image Processing & Computer Vision
RWTH Aachen
MATLAB/SIMULINK SUPPORT FOR LOW-COST HARDWARE

Controls Image & Robotics


Video Processing

Signal Processing Instrumentation

2 MATLAB meets Mindstorms


How to control Lego NXT robots using Matlab for educational purposes
3 MATLAB meets Mindstorms
How to control Lego NXT robots using Matlab for educational purposes
MATLAB MEETS MINDSTORMS 1/2

Each NXT
can control 3 servo motors
interact with 4 sensors

4 MATLAB meets Mindstorms


How to control Lego NXT robots using Matlab for educational purposes
MATLAB MEETS MINDSTORMS 2/2

Each NXT
can control 3 servo motors
interact with 4 sensors

5 MATLAB meets Mindstorms


How to control Lego NXT robots using Matlab for educational purposes
MATLAB MEETS MINDSTORMS 2/2
pressure

Each NXT light


can control 3 servo motors
interact with 4 sensors sound

Variety of sensors
ultrasonic

gyro compass IR

RGB
acceleration distance

6 MATLAB meets Mindstorms


How to control Lego NXT robots using Matlab for educational purposes
MATLAB MEETS MINDSTORMS MEETS EE FRESHMEN 1/2

500 EE freshmen students each year @ RWTH Aachen University

First semester syllabus is packed with prosaic content


Higher Mathematics
Electrical Engineering I
Physics I
Computer Science I
Discrete Signal Processing I

How to keep students motivated?


Need for motivation of syllabus content
Need for good delivery of programming skills
Need for hands-on real-world experiences
Need for team-work and soft skills

7 MATLAB meets Mindstorms


How to control Lego NXT robots using Matlab for educational purposes
MATLAB MEETS MINDSTORMS MEETS EE FRESHMEN 2/2

RWTH EE freshmen project


9 days full-time programming and experimenting
500 students at the same time, distributed among all institutes
RWTH Lego Mindstorms NXT Toolbox for Matlab

Behrens et. al., MATLAB Meets LEGO Mindstorms - A Freshman Introduction Course
Into Practical Engineering, IEEE Transactions on Education, Vol. 53, Issue 2, 2010

8 MATLAB meets Mindstorms


How to control Lego NXT robots using Matlab for educational purposes
Mindstorms NXT Toolbox
Lets get started!
What we are going to do
Toolbox installation
Establishing a connection
Read sensors
Control motors
Robot application
LIVE IN-MATLAB (4 Min)

Demonstrate how to download the Toolbox (TB)


Installation of the TB into the Matlab path
First USB connection to NXT
First Bluetooth connection to NXT
Hello World: Play_Tone

10 MATLAB meets Mindstorms


How to control Lego NXT robots using Matlab for educational purposes
Live IN-MATLAB (5 Min)

Handle the pressure sensor


Handle the light sensor
Handle the sound sensor
Handle the ultrasonic sensor

11 MATLAB meets Mindstorms


How to control Lego NXT robots using Matlab for educational purposes
Mindstorms NXT Toolbox
Reading the Sensors
What we are going to do
Check if the pressure sensor is pushed
Record sound from the sound sensor
Get in touch with the light sensor
Measure distances using the Ultrasonic sensor
Mindstorms NXT Toolbox
Controlling the Motors
What we are going to do
How to create a new motor object
How to control speed, distance and actions when stoping
How to synchronize motors
Live IN-MATLAB (6 Min)

Introduction to the motor class


Explication of different operator modes and options
Short annotations to motorControl

14 MATLAB meets Mindstorms


How to control Lego NXT robots using Matlab for educational purposes
Live IN-MATLAB (5 Min)

Put it all together: our first useful robot


Robot who is trapped in box with only one exit
Robot scans environment
Finds exit using basic signal processing
Rotates towards exit
Drives forward to exit the box

15 MATLAB meets Mindstorms


How to control Lego NXT robots using Matlab for educational purposes

Vous aimerez peut-être aussi