matlab meets mindstorms · matlab meets mindstorms how to control lego nxt robots using matlab for...

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

Upload: others

Post on 09-Aug-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: MATLAB meets Mindstorms · MATLAB meets Mindstorms How to control Lego NXT robots using Matlab for educational purposes 8 MATLAB MEETS MINDSTORMS MEETS EE FRESHMEN 2/2 RWTH EE freshmen

MATLAB meets Mindstorms How to control Lego NXT robots using Matlab for educational purposes

Dorian Schneider

Institute of Image Processing & Computer Vision

RWTH Aachen

Page 2: MATLAB meets Mindstorms · MATLAB meets Mindstorms How to control Lego NXT robots using Matlab for educational purposes 8 MATLAB MEETS MINDSTORMS MEETS EE FRESHMEN 2/2 RWTH EE freshmen

MATLAB meets Mindstorms

How to control Lego NXT robots using Matlab for educational purposes 2

Controls Image &

Video Processing Robotics

Signal Processing Instrumentation

MATLAB/SIMULINK SUPPORT FOR LOW-COST HARDWARE

Page 3: MATLAB meets Mindstorms · MATLAB meets Mindstorms How to control Lego NXT robots using Matlab for educational purposes 8 MATLAB MEETS MINDSTORMS MEETS EE FRESHMEN 2/2 RWTH EE freshmen

MATLAB meets Mindstorms

How to control Lego NXT robots using Matlab for educational purposes 3

Page 4: MATLAB meets Mindstorms · MATLAB meets Mindstorms How to control Lego NXT robots using Matlab for educational purposes 8 MATLAB MEETS MINDSTORMS MEETS EE FRESHMEN 2/2 RWTH EE freshmen

MATLAB meets Mindstorms

How to control Lego NXT robots using Matlab for educational purposes 4

MATLAB MEETS MINDSTORMS 1/2

Each NXT can control 3 servo motors

interact with 4 sensors

Page 5: MATLAB meets Mindstorms · MATLAB meets Mindstorms How to control Lego NXT robots using Matlab for educational purposes 8 MATLAB MEETS MINDSTORMS MEETS EE FRESHMEN 2/2 RWTH EE freshmen

MATLAB meets Mindstorms

How to control Lego NXT robots using Matlab for educational purposes 5

MATLAB MEETS MINDSTORMS 2/2

Each NXT can control 3 servo motors

interact with 4 sensors

Page 6: MATLAB meets Mindstorms · MATLAB meets Mindstorms How to control Lego NXT robots using Matlab for educational purposes 8 MATLAB MEETS MINDSTORMS MEETS EE FRESHMEN 2/2 RWTH EE freshmen

MATLAB meets Mindstorms

How to control Lego NXT robots using Matlab for educational purposes 6

MATLAB MEETS MINDSTORMS 2/2

Each NXT can control 3 servo motors

interact with 4 sensors

Variety of sensors

pressure

light

sound

ultrasonic

gyro compass IR

RGB acceleration distance

Page 7: MATLAB meets Mindstorms · MATLAB meets Mindstorms How to control Lego NXT robots using Matlab for educational purposes 8 MATLAB MEETS MINDSTORMS MEETS EE FRESHMEN 2/2 RWTH EE freshmen

MATLAB meets Mindstorms

How to control Lego NXT robots using Matlab for educational purposes 7

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

Page 8: MATLAB meets Mindstorms · MATLAB meets Mindstorms How to control Lego NXT robots using Matlab for educational purposes 8 MATLAB MEETS MINDSTORMS MEETS EE FRESHMEN 2/2 RWTH EE freshmen

MATLAB meets Mindstorms

How to control Lego NXT robots using Matlab for educational purposes 8

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

Page 9: MATLAB meets Mindstorms · MATLAB meets Mindstorms How to control Lego NXT robots using Matlab for educational purposes 8 MATLAB MEETS MINDSTORMS MEETS EE FRESHMEN 2/2 RWTH EE freshmen

Mindstorms NXT Toolbox Let‘s get started!

• Toolbox installation

• Establishing a connection

• Read sensors

• Control motors

• Robot application

What we are going to do

Page 10: MATLAB meets Mindstorms · MATLAB meets Mindstorms How to control Lego NXT robots using Matlab for educational purposes 8 MATLAB MEETS MINDSTORMS MEETS EE FRESHMEN 2/2 RWTH EE freshmen

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

MATLAB meets Mindstorms

How to control Lego NXT robots using Matlab for educational purposes 10

Page 11: MATLAB meets Mindstorms · MATLAB meets Mindstorms How to control Lego NXT robots using Matlab for educational purposes 8 MATLAB MEETS MINDSTORMS MEETS EE FRESHMEN 2/2 RWTH EE freshmen

Live IN-MATLAB (5 Min)

Handle the pressure sensor

Handle the light sensor

Handle the sound sensor

Handle the ultrasonic sensor

MATLAB meets Mindstorms

How to control Lego NXT robots using Matlab for educational purposes 11

Page 12: MATLAB meets Mindstorms · MATLAB meets Mindstorms How to control Lego NXT robots using Matlab for educational purposes 8 MATLAB MEETS MINDSTORMS MEETS EE FRESHMEN 2/2 RWTH EE freshmen

Mindstorms NXT Toolbox Reading the Sensors

• 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

What we are going to do

Page 13: MATLAB meets Mindstorms · MATLAB meets Mindstorms How to control Lego NXT robots using Matlab for educational purposes 8 MATLAB MEETS MINDSTORMS MEETS EE FRESHMEN 2/2 RWTH EE freshmen

Mindstorms NXT Toolbox Controlling the Motors

• How to create a new motor object

• How to control speed, distance and actions when stoping

• How to synchronize motors

What we are going to do

Page 14: MATLAB meets Mindstorms · MATLAB meets Mindstorms How to control Lego NXT robots using Matlab for educational purposes 8 MATLAB MEETS MINDSTORMS MEETS EE FRESHMEN 2/2 RWTH EE freshmen

Live IN-MATLAB (6 Min)

Introduction to the motor class

Explication of different operator modes and options

Short annotations to „motorControl“

MATLAB meets Mindstorms

How to control Lego NXT robots using Matlab for educational purposes 14

Page 15: MATLAB meets Mindstorms · MATLAB meets Mindstorms How to control Lego NXT robots using Matlab for educational purposes 8 MATLAB MEETS MINDSTORMS MEETS EE FRESHMEN 2/2 RWTH EE freshmen

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

MATLAB meets Mindstorms

How to control Lego NXT robots using Matlab for educational purposes 15