Schnell und effizient durch Automatische

Transcription

Schnell und effizient durch Automatische
Schnell und effizient durch
Automatische Codegenerierung
Andreas Uschold
MathWorks
© 2015 The MathWorks, Inc.
1
ITK Engineering Develops IEC 62304 –
Compliant Controller for Dental Drill Motor
with Model-Based Design
Challenge
Develop and implement field-oriented controller software for
sensorless brushless DC motors for use in dental drills
Dental drills featuring ITK Engineering’s
sensorless brushless motor control.
Solution
Use Model-Based Design with Simulink, Stateflow, and Embedded
Coder to model the controller and plant, run closed-loop simulations,
generate production code, and streamline unit testing
“Model-Based Design with
Results
through early verification,
§  Development time halved
§  Hardware problems discovered early
§  Contract won, client confidence established
Simulink enabled us to
reduce costs and project risk
shorten time to market on an
IEC 62304–certified system,
and deliver high-quality
production code that was
first-time right.”
Michael Schwarz
ITK Engineering
2
Model-Based Design
Verification and Validation
Development Process
Requirements
System Design
Environment
Physical Components
Algorithms
System-Level
Specification
Component Design
Subsystem
Design
User Acceptance
Testing
Complete
Integration
& Test
Integration
testing
System-Level
Integration & Test
Code
Verification and
Validation
Embedded
Software
Digital
Electronics
C, C++
MCU
Subsystem
Integration & Test
VHDL, Verilog
DSP
FPGA
ASIC
Integration
Implementation
Subsystem
Implementation
3
Model-Based Design
Automatic Code Generation
Requirements
•  C/C++, VHDL and PLC-Code Generation
from one model
VHDL, Verilog
C, C++
System Design
MCU
•  Support for Fixed Point Data Format
User Acceptance
Testing
DSP
FPGA
Structured Text
ASIC
PLC
Environment
•  Automatic scaling
•  Supported in Simulation and Code-Generation
Physical Components
Integration
testing
PLC Coder
(Structured Text)
•  Easy integration of legacy C/C++-Code
Algorithms
development
Componentindependent
Design
of the target
Embedded Coder
(C, C++)
EmbeddedDSP & µC
Digital
Software
Electronics
C, C++
MCU
PLC
System-Level
Integration & Test
System-Level
Specification
•  System
Subsystem
Design
Complete
Integration
& Test
HDL Coder
Code (VHDL, Verilog)
Verification and
Validation
Subsystem
Integration & Test
FPGA & ASIC
VHDL, Verilog
DSP
FPGA
ASIC
Integration
Implementation
Subsystem
Implementation
4
Model-Based Design
Code Generation Workflow
Controller
5
Model-Based Design
C/C++ - Code Generation Products and Hardware Support Packages
Embedded
Coder
Simulink
Coder
http://de.mathworks.com/hardware-support/
MATLAB Coder
6
Model-Based Design
Verification and Validation
Development Process
Requirements
System Design
Environment
Physical Components
Algorithms
System-Level
Specification
Component Design
Subsystem
Design
User Acceptance
Testing
Complete
Integration
& Test
Integration
testing
System-Level
Integration & Test
Code
Verification and
Validation
Embedded
Software
Digital
Electronics
C, C++
MCU
Subsystem
Integration & Test
VHDL, Verilog
DSP
FPGA
ASIC
Integration
Implementation
Subsystem
Implementation
7
Model-Based Design
Verification and Validation
Controller
?
*.c / *.h
*.cpp / *.hpp
Communication
Interfaces
Comm
Drivers
Generated
Algorithm
Code
Input
Drivers
Included
Target
Optimized
Code
Sensors
A
B
M
Output
Drivers
Actuators
?
C
Special
Device
Drivers
Scheduler/Operating System
and Support Utilities
®
BLACK BOX
V
RGBSplit-4
®
RCS
I PUT
N
BL
UE
GR E N
RED
P O WE
R
Tuning
Special
Interfaces
®
8
Model-Based Design
Verification and Validation
Prove Equivalency and Check Efficiency
with
Processor-in-the-Loop (PIL)
9
Model-Based Design
Use Processor-in-the-Loop to Prove Equivalency
§ 
§ 
Use Simulation Data
Inspector to prove
functional
equivalence
Visualize single runs
or compare multiple
runs to each other
!
10
Model-Based Design
Check Efficiency using Processor-in-the-Loop Profiling
§ 
§ 
Use PIL profiling to
check the efficiency
of generated code
on the target
Analyse bottlenecks
11
3 Things to Remember
§ 
Model-Based Design helps to detect design bugs early
§ 
Model-Based Design speeds up the development process
§ 
One tool chain for Model Based Design and Code Generation
12