Anda di halaman 1dari 26

MathWorks and the Freescale Cup

Working with MATLAB & Simulink

Christoph Hahn
Dr. Joachim Schlosser

© 2014 The MathWorks, Inc.


1
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?

2
Outline

 What are MATLAB & Simulink?

 How to benefit from MathWorks supporting Freescale Cup?

 What about all the code I have already written?

3
What are MATLAB & Simulink?

5
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

6
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
7
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/ 8
MATLAB Example
(from MathWorks Lego Robot Competition)

9
Simulink Example

11
Automatic Code Generation

Embedded Digital
Software Electronics
• C/C++, VHDL and PLC-Code Generation
from one model C, C++ VHDL, Verilog

MCU DSP FPGA ASIC


• Support for Fixed Point Data Format
• Automatic scaling
• Supported in Simulation and Code-Generation
PLC Coder
(Structured Text)
• Easy integration of legacy C/C++-Code PLC

Embedded Coder HDL Coder


• System development independent (C, C++) (VHDL, Verilog)
of the target

DSP & µC FPGA & ASIC

13
Supporting Freescale Cup Teams

 Complimentary Software: 25 products

 Complimentary Learning Resources

 Freescale FRDM-KL25Z Board target

14
Complimentary Software

15
Complimentary Software from the MathWorks

 MathWorks sponsors the Freescale Cup

• MATLAB • SimDriveline
• Simulink • SimElectronics
• Stateflow • SimMechanics
• Control System Toolbox • SimPowerSystems
• DSP System Toolbox • Simscape
• Embedded Coder • Simulink Coder
• Filter Design HDL Coder • Simulink Control Design
• Fixed-Point Designer • Simulink Design Optimization
• Global Optimization Toolbox • Simulink Design Verifier
• MATLAB Coder • HDL Coder
• Neural Network Toolbox • Simulink PLC Coder
• Optimization Toolbox • Simulink Verification and Validation
• Signal Processing Toolbox
16
Complimentary Learning Resources & Support

17
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

freescalecup@mathworks.com
mathworks.com/academia/ 18
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 19
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)
20
Freedom Board Automatic Code Generation Target

21
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 freescalecup@mathworks.com
 July: available as Target Support Package

22
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

23
Freescale Cup Blocks

24
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

25
What about the code I have already written?

Simulink MATLAB Functions Class


Block Code Definitions

26
Do you speak MATLAB?

27
For student teams

1. Check your university for campus license.


2. Request complimentary Freescale Cup
license.

28
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

29

Anda mungkin juga menyukai