You are on page 1of 29

Low-Cost hardware connectivity

with Simulink

MATLAB-Day RWTH Aachen


Sebastian Gro
October 24th, 2013

2013 The MathWorks, Inc.1

LEGO Mindstorms NXT: a first demo

EDUCON 2013, Berlin, Germany


2

A first demo: the behind the scenes


45 lines of
MATLAB
code, only

Contents
What is

low-cost hardware?

Hardware and Simulink: a


Install, simulate, and
Let

great combo

enjoy: work-flow

us help you get started

What is low-cost hardware?

Simulink supported low-cost hardware


50

15

BeagleBoard

40
ArduinoBoard
Raspberry Pi

R2011b

2012a

2012b

2013a

2013b

Gumstix Overo
PandaBoard
LEGO Mindstorms
NXT

135
185

370

Hardware capabilities and features


Microcontroller

AT91SAM7S256 (ARM)

Flash Memory

256 KB

SRAM

64 KB

Operating freq.

55 MHz

Actuators:
servo motor {display, speaker}

Inputs:
analog, digital,
serial, servo

Sensors:
light, color,
ultrasonic, sound,
accelerometer, gyro, etc.

Outputs:
PWM, digital,
serial, servo

Microcontroller

ATmega328 (AVR)

Flash Memory

32 KB

SRAM

2 KB

EEPROM

1 KB

Clock Speed

16 MHz

Why low-cost hardware?

1. Learn hands-on
[retain knowledge]

Engaging Students in Hands-On


Control System Design:
University of Arizona
Challenge
Provide students with hands-on control system design
experience while keeping down costs

Dr. Enikov and students experimenting with the


aeropendulum in the lab.

Solution
Introduce a low-cost, portable laboratory module
based on MATLAB, Simulink, and an aeropendulum

Results
Equipment costs lowered
Technical concepts better illustrated
Transferable control design skills acquired

These experiences do not require


expensive lab equipment. In fact, we
have found that MATLAB, Simulink,
and a simple low-cost device are all
that is needed.
Dr. Eniko T. Enikov
University of Arizona

Link to article

10

2. Get a taste of the


real world
[do it like the pros]
11

Model-Based Design: first steps


Collect and
understand
requirements

Model

Simulate

Test on
hardware

Generate code
12

Reconfigurable Robots at
University of Toronto
Challenge
Provide engineering students with a low-cost learning
environment for studying the design and control of a variety of
industrial robot manipulators

The University of Toronto Institute for


Aerospace Studies reconfigurable robot
manipulator.

Solution
Use MATLAB and Simulink to develop an integrated
environment for simulating, visualizing, and optimizing
designs using a reconfigurable robot

Results

Students prepared for work in industry


Complex optimizations automated
Months of development time eliminated

With MATLAB and Simulink we


developed a low-cost design and
simulation environment that enables
students to apply theoretical aspects
of kinematics, dynamics, and controls
of robot manipulators in a realistic
way, optimize their designs, and see
those designs in action.
Dr. Reza Emami
University of Toronto

Link to user story

13

3. Foster success
[by motivation]

14

LEGO Mindstorms NXT at


RWTH Aachen: a success story
Challenge
Enabling 1st year students to apply theoretical concepts in math
and signal processing in a hands-on experimental lab. Fostering
soft skills by working in a team environment.

Solution
Use MATLAB and LEGO Mindstorm NXT to build and program
robots.

Results

MATLAB programming skills rated high by students after course


Motivation rated excellent to good by almost 90% of students
Ability to link theoretical foundations to practical applications

RWTH Aachen students working with a


Mindstorms NXT robot.

This high level of motivation is


reflected in the number of extra
hours the students devoted to their
projects. We knew we had achieved
our objectives when students
demanded that we set up a
workshop so that they could
continue working with the robots in
their free time.

Link to user story

Univ.-Professor Dr.-Ing. Til Aach


RWTH Aachen University
15

How-to? The work flow

16

What do you need to get it done, the bare essentials


1 Get
2 Get

Low-cost H/W (+ peripherals)


MATLAB and Simulink (+ toolboxes)

4 Run

targetinstaller
targetupdater

5 Code

Model, simulate, test, and enjoy

3 Run

17

Setting-up target hardware: quick and easy

>> targetinstaller
Installs all requirements

>> targetupdater
Updates firmware on target hardware

DONE
18

LEGO Mindstorms NXT Simulink Support Package

Inputs, sensors

Examples

Outputs, actuators

19

Raspberry Pi Simulink Support Package (13a)

Inputs, sensors

Outputs, actuators

Examples

20

Arduino Support Package

Inputs, sensors
Outputs, actuators
Examples

21

Arduino Ball-tracking demo

Control logic
implemented in
StateFlow
22

Arduino Ball-tracking demo: on-target code (controller)


PI controller running on
Arduino board

Input

Output
23

Ressources and support to


get started

24

Academia web page

25

Hardware Support ressources

26

MATLAB Central, File Exchange and other goodies

27

Support is available right next door

: MATLAB/Simulink in education

Sebastian Gross:

sebastian.gross@mathworks.de

: specific technical questions

Tech support:

+49-89-45235-6700 + press 4

: and for everything else

Customer service: +49-89-45235-6700 + press 3

28

low-cost H/W

Get
today and start enjoying
with

Simulink
29

You might also like