0% found this document useful (0 votes)
32 views50 pages

Embedded Deployment Hardware Connectivity With Matlab Simulink

This presentation discusses deploying algorithms from MATLAB and Simulink to hardware using code generation. It covers hardware support packages, processor-in-the-loop execution, code generation for internet of things applications, and concludes by taking questions. Examples of code generation applications like noise monitoring networks and drone control are provided.

Uploaded by

Thạch Lê
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views50 pages

Embedded Deployment Hardware Connectivity With Matlab Simulink

This presentation discusses deploying algorithms from MATLAB and Simulink to hardware using code generation. It covers hardware support packages, processor-in-the-loop execution, code generation for internet of things applications, and concludes by taking questions. Examples of code generation applications like noise monitoring networks and drone control are provided.

Uploaded by

Thạch Lê
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 50

Déploiement embarqué et

connectivité hardware avec


MATLAB et Simulink
Paul Cox, MathWorks

© 2015 The MathWorks, Inc.


1
Agenda

 Introduction
 Hardware Support Packages for MATLAB and Simulink
 Processor-in-the-Loop Execution
 Code Generation within the Internet of Things (IoT)
 Conclusion
 Questions

2
From algorithm to hardware: why and how?

3
From MATLAB and Simulink to Hardware

Automatic Code Generation

C/C++ VHDL ST
Verilog

CPU ASIC PLC


DSP FPGA 4
Code Generation in Industry

5
Code Generation in Academia

6
Code Generation Case Study : Bruitparif Medusa
Noise monitoring distributed network

7
Code Generation Case Study : Bruitparif Medusa

- Requirements
- Monitor noise levels and directions
- Send live data to a central server
- Low-power consumption device (< 5 W)
- Minimal network traffic (< 5 kbps)

- Solution
- Low-power microcontroller (STM32F4)
- UDP communication over cellular network
- Algorithm development with MATLAB/Simulink
- Design and feasibility/performance analysis
- Preparation for embedded deployment
- Automatic Production Code Generation with Embedded Coder
- Low memory and CPU utilization

8
Bruitparif - Software

9
Bruitparif – Software (continued)

10
Automatic code generation in IoT network nodes

Source: Le Parisien 11
Bruitparif – Pilot Project Results

12
Before Code Generation: Modeling and Simulation

13
Code Generation for UAV Team MAVerix at student competition

14
http://www.dpdhl.com/en/media_relations/specials/parcelcopter.html
Video source: Deutsche Post AG 15
Agenda

 Introduction
 Hardware Support Packages for MATLAB and Simulink
 Processor-in-the-Loop Execution
 Code Generation within the Internet of Things (IoT)
 Conclusion
 Questions

16
How do I connect MATLAB to hardware?
Since 2012: Hardware Support Packages!

17
C Code Generation-based Hardware Support Packages
 Texas Instruments C2000
 STmicroelectronics STM32F407 and STM32F746 Discovery boards
 Beaglebone Black
 Raspberry Pi 1, 2, 3
 Arduino (Uno, Due, Nano, Mini, Mega, too many to list!)
 NXP FRDM, STM32 Nucleo boards
 Android, iOS, and more!
 Includes: Simulink-based HSP Includes: MATLAB-based HSP
– Compiler Toolchain - Connectivity API
– Peripheral configuration I/O Blocks - Coming Soon: Code Generation
– External mode
– Processor-In-the-Loop PIL framework
– Example models and documentation
18
Open Hardware Revolution

19
Parrot AR Drone

20
Parrot AR Drone Hardware Support in Simulink

21
Deploying Simulink Model to Parrot AR Drone

22
Parrot Mini Drone Support in Simulink

http://fast.scripts.mit.edu/dronecontrol/

23
Using the Support Package Installer is Easy!

24
Raspberry PI
Arduino
Lego

MATLAB
Android

Raspberry PI
Arduino

Simulink
Lego
Apple iOS

Android

Beaglebone
Black
STM32 Disco
STM32 Nucleo
T I C2000
MATLAB Coder
Simulink Coder
Embedded Coder

Xilinx Zync
Altrera SoC

Xilinx Zync
Altrera SoC
HDL Coder
MathWorks Hardware Support Packages

25
iPhone iPad and Android Support

26
Arduino board support from MATLAB and Simulink

UNO MEGA NANO DUE

Leonardo Mega ADK Mini Fio Pro Micro Esplora

27
Arduino Shields

Wifi Shield Motor Shield


Ethernet Shield

Simulink Blocks

28
Arduino

 17a – print/println support

 16b – Thingspeak read, PIL, enhanced external mode

 15a – Support from Linux

 New IO Block support:


– I2C, SPI
– UDP/TCP to LEGO, Raspberry Pi, and Android/iPhone

 New boards: Yun

29
Raspberry Pi
 17a – New blocks: I2C, SPI, UART, TCP/IP, IMU, Pressure, Humidity, etc

 16b - Support from Linux PC

 16a – Pi 3 support

 15b – Support from Mac

 15a – Pi 2 support

30
Linux Boards supported by MATLAB and Simulink
Raspberry Pi 1, 2, and 3 BeagleBone Black

31
STM32 Board Support

 STM32 Discovery : F407 & F746

 STM32 Nucleo :
– STM32F746
– STM32F411
– STM32F401
– STM32F302
– STM32F103
– STM32F031
– STM32L476
– STM32L053

32
Agenda

 Introduction
 Hardware Support Packages for MATLAB and Simulink
 Processor-in-the-Loop Execution
 Code Generation within the Internet of Things (IoT)
 Conclusion
 Questions

33
How SIL and PIL Work
On-Target Simulation

Communication
Gateway

Non-Real-Time
Synchronization
with Host at Each Time Step
Execution History
• Equivalence comparison
• Code coverage
• Execution timing (profiling)

34
Processor-in-the-Loop (PIL) profiling

35
Processor Benchmarks on various ARM Cortex CPUs
256
Execution Time (us Avg/Max)

128

64
40 uS Limit
32

16

4
AM335X ATSAM3X8E STM32F302 STM32F302 STM32F407 STM32F407 STM32F746 STM32F746
CMSIS CMSIS CMSIS
Processor
Function: Task0 of rwdemo_pmsmfoc 36
Deploy Simulink Model to Beaglebone Black

37
Agenda

 Introduction
 Hardware Support Packages for MATLAB and Simulink
 Processor-in-the-Loop Execution
 Code Generation within the Internet of Things (IoT)
 Conclusion
 Questions

38
IoT Analytics Challenges

Analytic IoT Platform


• Storage
• On-Line analytics
• Visualization & reporting

Smart Connected Devices


• Communication
• Embedded Sensor Analytics
• Data Reduction

39
IoT Analytics Solutions

Data Aggregation
& Analytics Deploy analytics
Communications
to server/cloud
Network

Hardware Deploy algorithms to nodes/devices


Support
Packages Smart Connected Algorithm Development
Devices Sensor Analytics

40
What Is ThingSpeak?
Web Site For People Web Service for Devices

41
ThingSpeak

 New MathWorks web service https://thingspeak.com


hosted on AWS
 Lets you collect, analyze and act
on data from “things”
 Over 130,000 users worldwide
 It has MATLAB for IoT Analytics
 It’s free to get started

42
Car-counting camera IoT example

43
Custom Visualizations with ThingSpeak- Weather Station Example

44
Predictive Analytics Example with ThingSpeak

45
ThingSpeak for Small Scale Deployment

External Data & Business


Systems

Deploy analytics
Ingest Store Compute To cloud

Smart
Connected Devices Algorithm Development
Sensor Analytics

46
Integrating MATLAB with Third Party
IoT Cloud Platforms
External Data & Business
Systems
IoT
Platform

Deploy analytics
Ingest Store Compute To cloud
MATLAB
Production
Server

Gateway
Smart Connected Algorithm Development
Algorithm Development
Devices
Sensor Analytics

47
Agenda

 Introduction
 Hardware Support Packages for MATLAB and Simulink
 Processor-in-the-Loop Execution
 Code Generation within the Internet of Things (IoT)
 Conclusion
 Questions

48
Key takeaways
Hardware support in MATLAB and Simulink …

- Code generation for prototype or production workflows

- Hardware Support Packages make it easy to install and configure


the necessary software

- Supports many Open Hardware Revolution boards


and mobile devices (iOS, Android)

- Enables smart sensors for the Internet of Things

49
Q&A
Déploiement embarqué et connectivité hardware
avec MATLAB et Simulink

50

You might also like