Upload
others
View
11
Download
0
Embed Size (px)
Citation preview
Infineon XMC DeveloperDayMatlab®Simulink® on XMC
October 21th, 2015Achim Schuette Infineon Hannover
Infineon
2
Achim SchütteInfineon Technologies AGSenior Field Application & Concept Engineer
IFAG PMM IMC ACE FAE
Tel.: +49 (0)89 234 43502Fax: +49 (0)89 234 15 43502Cell: +49 (0)151 649 [email protected] Plaza 1130539 Hannover
1995: Studium der Automatisierungstechnik FH Hannover & WRTC (Irland)
1995...2013: Lenze, Entwicklung Antriebs- und Automatisierungssysteme
seit Mai 2013: Infineon
Agenda
Introduction to Simulink 10min
XMC Embedded Coder Library 5min
How to get best performance – CMSIS DSP-Lib 5min
Dryrun Embedded Coder Library 15min
Discussions 5min
1
2
3
4
5
3
Agenda
Introduction to Simulink
XMC Embedded Coder Library
How to get best performance – CMSIS DSP-Lib
Dryrun Embedded Coder Library
Discussions
1
2
3
4
5
4
Introduction to Simulink
› Graphical modelling of dynamic systems by signal flow graphs
› Simulink is an addition to MATLAB (Toolbox)
› Simulink Additions: Blocksets, SimPower-Systems, SimMechanics, Embedded Coder
› Embedded Coder allows Code generation for a real applicagtion target system i.e. XMC4500
5
Introduction to Simulink Blocksets
6
Sources Signal Routing Continuous User defined
Introduction to SimulinkSimulation of a PMSM Motor
7
Simulink Model of a PMSM Motor
Math-Model of a PMSM Motor
Introduction to Simulink XMC Simulink support
Typical Matlab environment Typical Matlab workflow
Target HardwareDAVE
Include generatedC-Code into project
(DAVE, Keil,…)*.c*.h
8
3rd Parties
Introduction to Simulink XMC Simulink support
Typical Matlab environment Typical Matlab workflow
Target HardwareDAVE
Include generatedC-Code into project
(DAVE, Keil,…)*.c*.h
ADCPWM Timer
…
9
Embedded Coder Library 3rd Parties
Introduction to Simulink XMC Simulink support
Typical Matlab environment Typical Matlab workflow
Target Hardware
DAVE
Include generatedC-Code into project
(DAVE, Keil,…)
If using DAVEyou can addApps to theMatlab output
*.c*.h
ADCPWM Timer
…
10
Embedded Coder Library
Agenda
Introduction to Simulink
XMC Embedded Coder Library
How to get best performance – CMSIS DSP-Lib
Dryrun Embedded Coder Library
Discussions
1
2
3
4
5
11
XMC Embedded Coder Library
12
Device lib
Peripherals lib
CORDIC lib
Advancedconfigurations
Advancedconfigurations
Workflow for
Model-Based DesignMotor Control applications
Power Conversion applicationsReal-time applications
› Automatic Code Generation
› Automatic objectGeneration
› Easy code portingfor DAVE
XMC Embedded Coder Library
13
XMC Embedded Coder Library V1.1
14Set date Copyright © Infineon Technologies AG 2015. All rights reserved.
Devices Matlab versions
Simulink library blocks Code generation
› XMC4500, XMC4400, XMC4200, XMC4100
› XMC1300, XMC1200, XMC1100
› Supported in Matlab r2013b, r2014a, r2014b and r2015a
› Generic C/C++ and ARM Cortex optimized
› Object generation with GNU
› GPIO config, read, write
› CCU4, CCU8, POSIF
› VADC, BCCU
› HW interrupt
› MATH coprocessor Version 1.1
XMC Embedded Coder LibraryRoadmap for V 2.0
15Set date Copyright © Infineon Technologies AG 2015. All rights reserved.
Agenda
Introduction to Simulink
XMC Embedded Coder Library
How to get best performance – CMSIS DSP-Lib
Dryrun Embedded Coder Library
Discussions
1
2
3
4
5
16
17
How to get best performance – CMSIS DSP-Lib
FIR–Filter Standard C-Code for ARM Cortex-M4
18
How to get best performance – CMSIS DSP-Lib
19
How to get best performance – CMSIS DSP-Lib
ARM Cortex-M4 inner loop of FIR-Filter
20
How to get best performance – CMSIS DSP-Lib
FIR–Filter optimized C-Code for ARM Cortex-M4
21
How to get best performance – CMSIS DSP-Lib
22
Simulink Coder supports CMSIS DSP-Lib
Agenda
Introduction to Simulink
XMC Embedded Coder Library
How to get best performance – CMSIS DSP-Lib
Dryrun Embedded Coder Library
Discussions
1
2
3
4
5
23
Dryrun Embedded Coder Library
24
Sine and Noise
Sine with Noise
Filter Out
Filtered Sine is Duty Cycle Input for PWM
Task:
A real world analog input signal with noise needs to be filtered and converted into a feed signal for a PWM pulse generator in order to supply a PWM “power output” to a load.
Dryrun Embedded Coder Library
25
Simulink Subsystem running on XMC4500
ADC-Input
PWM-Output
Filter
Dryrun Embedded Coder Library
26
Simulink Subsystem running on XMC4500
ADC (P14.1)
CCU4 (P3.9)
C-CodePOTI
LED
Agenda
Introduction to Simulink
XMC Embedded Coder Library
How to get best performance – CMSIS DSP-Lib
Dryrun Embedded Coder Library
Discussions
1
2
3
4
5
27