Embedded Deployment Hardware Connectivity With Matlab Simulink
Embedded Deployment Hardware Connectivity With Matlab Simulink
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
C/C++ VHDL ST
Verilog
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
27
Arduino Shields
Simulink Blocks
28
Arduino
29
Raspberry Pi
17a – New blocks: I2C, SPI, UART, TCP/IP, IMU, Pressure, Humidity, etc
16a – Pi 3 support
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 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
39
IoT Analytics Solutions
Data Aggregation
& Analytics Deploy analytics
Communications
to server/cloud
Network
40
What Is ThingSpeak?
Web Site For People Web Service for Devices
41
ThingSpeak
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
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 …
49
Q&A
Déploiement embarqué et connectivité hardware
avec MATLAB et Simulink
50