26
1 © 2014 The MathWorks, Inc. MathWorks and the Freescale Cup Working with MATLAB & Simulink Christoph Hahn Dr. Joachim Schlosser

MathWorks and Freescale Cup - Working with MATLAB & Simulink

Embed Size (px)

DESCRIPTION

You have an algorithm idea.How long does it take you to find out whether it will work in at all and on the car? Outline + What are MATLAB & Simulink? + How to benefit from MathWorks supporting FreescaleCup? + What about all the code I have already written?

Citation preview

Page 1: MathWorks and Freescale Cup - Working with MATLAB & Simulink

1© 2014 The MathWorks, Inc.

MathWorks and the Freescale Cup

Working with MATLAB & Simulink

Christoph Hahn

Dr. Joachim Schlosser

Page 2: MathWorks and Freescale Cup - Working with MATLAB & Simulink

2

You have an algorithm idea.

How long does it take you to find out whether it will

work in at all and on the car?

Page 3: MathWorks and Freescale Cup - Working with MATLAB & Simulink

3

Outline

What are MATLAB & Simulink?

How to benefit from MathWorks supporting Freescale Cup?

What about all the code I have already written?

Page 4: MathWorks and Freescale Cup - Working with MATLAB & Simulink

5

What are MATLAB & Simulink?

Page 5: MathWorks and Freescale Cup - Working with MATLAB & Simulink

6

What is the Freescale Cup?

World wide collegiate competition

Students compete to design the fastest autonomous line-following car.

Currently Students can write their car’s code by hand using:

– Text Editor

– Codewarrior

– mbed

Page 6: MathWorks and Freescale Cup - Working with MATLAB & Simulink

7

MathWorks Core Products

Numeric Computation

Data Analysis & Visualization

Programming & Algorithm Development

Application Development & Deployment

Dynamic Simulation

Multi-Domain Modeling

Real-Time Testing

Automatic Code Generation

Page 7: MathWorks and Freescale Cup - Working with MATLAB & Simulink

8

MathWorks Learning Hardware Solutions

Connect to / generate code for

Arduino, Raspberry Pi, ROS, Lego Mindstorms, Kinect, Webcams, Nao Robot,

Analog Discovery, iPhone, Android, BeagleBoard, myDAQ, ARM Cortex A/M, …

mathworks.com/hardware-support/

Page 8: MathWorks and Freescale Cup - Working with MATLAB & Simulink

9

MATLAB Example(from MathWorks Lego Robot Competition)

Page 9: MathWorks and Freescale Cup - Working with MATLAB & Simulink

11

Simulink Example

Page 10: MathWorks and Freescale Cup - Working with MATLAB & Simulink

13

Automatic Code Generation

• C/C++, VHDL and PLC-Code Generation

from one model

• Support for Fixed Point Data Format • Automatic scaling

• Supported in Simulation and Code-Generation

• Easy integration of legacy C/C++-Code

• System development independent

of the target

DSP FPGA ASIC

Embedded Software

Digital Electronics

C, C++ VHDL, Verilog

MCU

Embedded Coder

(C, C++)

DSP & µC FPGA & ASIC

HDL Coder

(VHDL, Verilog)

PLC

PLC Coder

(Structured Text)

Page 11: MathWorks and Freescale Cup - Working with MATLAB & Simulink

14

Supporting Freescale Cup Teams

Complimentary Software: 25 products

Complimentary Learning Resources

Freescale FRDM-KL25Z Board target

Page 12: MathWorks and Freescale Cup - Working with MATLAB & Simulink

15

Complimentary Software

Page 13: MathWorks and Freescale Cup - Working with MATLAB & Simulink

16

Complimentary Software from the MathWorks

MathWorks sponsors the Freescale Cup

• MATLAB

• Simulink

• Stateflow

• Control System Toolbox

• DSP System Toolbox

• Embedded Coder

• Filter Design HDL Coder

• Fixed-Point Designer

• Global Optimization Toolbox

• MATLAB Coder

• Neural Network Toolbox

• Optimization Toolbox

• Signal Processing Toolbox

• SimDriveline

• SimElectronics

• SimMechanics

• SimPowerSystems

• Simscape

• Simulink Coder

• Simulink Control Design

• Simulink Design Optimization

• Simulink Design Verifier

• HDL Coder

• Simulink PLC Coder

• Simulink Verification and Validation

Page 14: MathWorks and Freescale Cup - Working with MATLAB & Simulink

17

Complimentary Learning Resources & Support

Page 15: MathWorks and Freescale Cup - Working with MATLAB & Simulink

18

Getting Started Page

mathworks.com/academia/getting-started.html

Discover resources for Freescale Cup

Learn how MATLAB and Simulink are

used in academia

Get software for your team

mathworks.com/freescale-software

mathworks.com/academia/

[email protected]

Page 16: MathWorks and Freescale Cup - Working with MATLAB & Simulink

19

Learning Resources: Interactive Video Tutorials

Self-guided tutorials

provided by MathWorks.

– MATLAB

– Simulink

– Signal Processing

– Control Systems

– Computational Mathematics

mathworks.com/academia/student_center/tutorials

Page 17: MathWorks and Freescale Cup - Working with MATLAB & Simulink

20

Getting started and help on MATLAB and Simulink

1. Online Getting Started

2. Do

3. MATLAB Answers

4. Technical Support in your country

(in that exact sequence)

Page 18: MathWorks and Freescale Cup - Working with MATLAB & Simulink

21

Freedom Board Automatic Code Generation Target

Page 19: MathWorks and Freescale Cup - Working with MATLAB & Simulink

22

Embedded Coder Support Package

for Freescale FRDM-KL25Z Board

Integration of the GNU-ARM Toolchain

Automatically:

1. Generates C code

2. Compiles code

3. Loads binary to hardware

Now: Beta Phase.

Get via [email protected]

July: available as Target Support Package

Page 20: MathWorks and Freescale Cup - Working with MATLAB & Simulink

23

Demo – Getting Started

Blink an LED

Create a New Model

Set it up for the Freescale Target

Add Blocks

Generate code

Deploy to the hardware

Page 21: MathWorks and Freescale Cup - Working with MATLAB & Simulink

24

Freescale Cup Blocks

Page 22: MathWorks and Freescale Cup - Working with MATLAB & Simulink

25

Demo – Simulation to Deployment

Analyze a simple Proportional Controller

Test the algorithm without the hardware

Generate and Compile C code

Upload resulting binary onto the hardware

Page 23: MathWorks and Freescale Cup - Working with MATLAB & Simulink

26

What about the code I have already written?

Class

Definitions

FunctionsMATLAB

Code

Simulink

Block

Page 24: MathWorks and Freescale Cup - Working with MATLAB & Simulink

27

Do you speak MATLAB?

Page 25: MathWorks and Freescale Cup - Working with MATLAB & Simulink

28

For student teams

1. Check your university for campus license.

2. Request complimentary Freescale Cup

license.

Page 26: MathWorks and Freescale Cup - Working with MATLAB & Simulink

29

Professors and Teachers

1. Which part of your teaching do you

like to give a hands-on twist with

MATLAB & Simulink?

2. Find resources on

mathworks.com/academia