Simulink Real-Time workshop at Apple Inc. - MathWorks · PDF fileSimulink Real-Time workshop...
Transcript of Simulink Real-Time workshop at Apple Inc. - MathWorks · PDF fileSimulink Real-Time workshop...
1© 2014 The MathWorks, Inc.
Simulink Real-Time workshop at
Apple Inc.
Abhishek Bhat
Application Engineer – MathWorks
12th July 2016
2
What’s Next
Important Links
What is real-time testing?
Workflow of using Simulink Real-Time
Where can I learn more?
3
Additional Links
Simulink Real-Time Product page and user stories:– http://www.mathworks.com/products/simulink-real-time/
Videos for quick overview of capabilities:– http://www.mathworks.com/products/simulink-real-time/videos.html
Speedgoat website for hardware capabilities:– https://www.speedgoat.ch/
4
What’s Next
Important Links
What is real-time testing?
Workflow of using Simulink Real-Time
Where can I learn more?
5
Build better products using
Real-Time Testing
6
Question : How do you think this
is useful to your application?
7
Why do Model-Based Design (MBD)
Real-Time Simulation & Testing?
It enables you to:
Test, verify, validate, and prove your algorithmic andsystem designs earlier
Evaluate new ideas using a flexible, scalable,production independent development platform
Minimize risk, reduce costs, shorten time-to-market
Achieve determinism through system modeling,automatic code generation and real-timesoftware/hardware execution
8
I/O Output I/O InputI/O Output I/O Input
Real-Time Simulation & Testing Tasks: Rapid Prototyping
Physical Plant Hardware
Wiring and
Signal Conditioning
0
0
Real-Time Target Computer
9
ChallengeDesign and develop an unmanned aerial camera
motion system for close-range aerial filming
SolutionUse Model-Based Design with MATLAB and Simulink
to accelerate the design, debugging, and
implementation of the vehicle’s fly-by-wire and flight
management system software
Results Time-to-market shortened by up to an order of
magnitude
Test flight anomalies quickly resolved
Debugging time reduced from weeks to hours
Airnamics Develops Unmanned Aerial
System for Close-Range Filming with
Model-Based Design
Airnamics co-founders Marko Thaler and
Zoran Bjelić with the R5 MSN1 prototype
after its first flight.
Link to user story
“With Model-Based Design our three-
engineer team found more than 95%
of control software bugs before the
first flight. We used the test flights to
increase our Simulink models’
fidelity and isolate remaining bugs
with high precision. The result is a
safer, more reliable, and higher-
quality product.”
Marko Thaler
Airnamics
10
Sonova Shortens Product Development
Time for Hearing Aids and Implants with
Model-Based Design
ChallengeShorten development time for new hearing
instruments and implants
SolutionUse Model-Based Design with MATLAB and Simulink to
develop a reusable library of digital signal processing
components, and use Simulink Real-Time for rapid real-
time prototyping and testing of design ideas
Results Real-time prototypes updated in minutes, not days
80% of software libraries reused in platform
Software quality improved
“Across Sonova, engineers from
a variety of backgrounds use
MATLAB and Simulink as a
shared language for designing
innovative signal processing
systems. Model-Based Design
and rapid real-time prototyping
enable us to maintain the
product development pace that
our business demands.”
Raoul Glatt
SonovaLink to user story
Sonova’s hearing aid and cochlear
implant solutions.
11
Cochlear Ltd. Streamlines Development
of Cochlear Implant Sound Processing
Algorithms
ChallengeEvaluate innovative noise-reduction algorithms for
cochlear implants
SolutionUse Simulink to model and simulate candidate
algorithms, and use Simulink Coder with xPC Target to
conduct real-time tests of the most promising candidates
Results Algorithm development overhead reduced by 60%
Six times as many new algorithms tested
Platform integration problems eliminated
“MATLAB, Simulink, and Simulink
Real-Time provide a robust, flexible,
and efficient means of integrating the
many different technologies that
cochlear implants require. We identify
the best ideas faster, and our
recipients experience the
improvements in real-time tests, which
are essential to our research.”
Dr. John Heasman
Cochlear Limited
Link to user story
A Cochlear engineer conducting tests
with a research cochlear implant
recipient.
12
OHB Develops Satellite Guidance,
Navigation, and Control Software for
Autonomous Formation Flying
ChallengeDevelop low-cost satellite GNC systems to enable
autonomous formation flying, rendezvous, and close-
proximity operations with a small team
SolutionUse MathWorks tools for Model-Based Design to model
GNC algorithms, perform real-time simulations, and
generate production flight code
Results Development time cut by 50%
Early verification and test reuse enabled
Interagency collaboration simplified
“Traditionally, control engineers
specify requirements using text and
diagrams and someone else codes
the software. With Model-Based
Design, we have eliminated that step.
We work with models from concept
to implementation, and we have the
automatically generated code flying
in space."
Ron Noteborn
OHB
Link to user story
Prisma’s Mango and Tango satellites in
the sunbeam of the space simulator.
13
Wiring and
Signal Conditioning
Embedded Hardware Real-Time Target Computer
Real-Time Simulation & Testing Tasks: Hardware-in-the-loop (HIL) Simulation
14
Application
ECU test bench for all-electric,
zero emission transit bus
The bus rapidly recharges at
on-route charging stations
2-3 hour range
Use Case – Proterra, USA
User Story
15
Hardware-in-the-loop Simulation/Testing
Hardware Under Test– Aircraft Engine Controller
Simulation– A/C Engines
Real-Time Testing ApplicationsAerospace systems example
Host-Target Network Switch
6 LVDT Simulation channels (IO422)
Shared/Reflective Memory (IO902 )
FPGA 16 Encoder Emulation channels (IO312)
32 24V digital input channels (IO206)
32 24V/0.5A digital output channels (IO205)
16 DIFF 16-bit analog output channels (IO107)
32 SE/16 DIFF 16-bit analog input, 4 SE analog
output, 8 TTL digital input, 8 TTL digital
output channels (IO102)
RTD simulation (IO926)
16
Real-Time Testing Scenarios: Parametric Evaluation and Performance Assessment
System robustness
– Monte Carlo analysis
– Operational envelope testing
Human factors
– Human-in-the-loop simulation
– Virtual reality simulators
Calibration
– Tune algorithmic coefficients
– Optimize performance
17
What’s Next
Important Links
What is real-time testing?
Workflow of using Simulink Real-Time
Where can I learn more?
18
What is Simulink Real-Time?From desktop simulation to real-time
Ethernet link
1
2
3
Creation of real-time applications from Simulink models and loading them
onto dedicated target computer hardware in 3 automated steps:
Compiler
Automatic Code
Generation
.dlm
Development Computer with MATLAB & Simulink
Target Computer Hardware
1 Code Generation 2 Compile & Link 3 Download & Ready to Run
19
What is Simulink Real-Time?Connect to your physical system
• Support for a broad range of I/O types and communication protocols
• Easy drag & drop and configuration within a Simulink model
Target Computer Hardware
.dlm
20
2
4
2
What is Simulink Real-Time?Extendable, integrated, and interactive
Live parameter tuning,
signal monitoring, and
execution control
1 Data logging for offline
analysis in MATLAB
2
UI/HMI connectivity3
Extensibility with
other software tools
(e.g. virtual reality)
4
Ethernet link
Target Computer Hardware
.dlm
3
Development Computer with MATLAB & Simulink
1
21
Ethernet link
Target Computer Hardware
.dlm
Development Computer with MATLAB & Simulink
Development Computer with MATLAB & Simulink
& Simulink Real-Time
Target Computer Hardware
from Speedgoat
What Hardware is used with Simulink Real-Time?Real-time software environment + real-time target computer
22
SolutionsSpeedgoat Provides Real-Time Target ComputersMade for use with Simulink Real-Time
Simulink drivers Simulink test modelsTerminal boardI/O Cable
Real-time target machine I/O modules installed in target machine
Speedgoat develops and sells Real-Time Machines consisting of
An industrial PC (Real-time target machine)
I/O modules
Software drivers, cables and tools to connect with a prototype
Simulink Real-Time and Speedgoat target computer hardware are expressly
designed to work together
23
Performance real-time target machine
State-of-the-art Intel Core i7 3.5 GHz quad core
Intel CPU and optional Xilinx FPGA technology
Concurrent multicore, multi target, and FPGA
real-time application execution
Flexible expansion concept:
install 50+ I/O modules
Flexible mounting
and I/O access
Turnkey Real-Time Target Machines for
office, lab, field, and in-vehicle use
24
Turnkey Real-Time Target Machines for
office, lab, field, and in-vehicle use
Mobile real-time target machine
Up to Intel Core i7 2.53 GHz
dual core CPU
Very robust and fanless design,
extended temperature support
Stack up: 1-4 layers with 3
PMC/XMC modules each
Two additional I/O slots for I/O modules in the mPCIe form factor
Over 200 I/O modules offering a very broad range of connectivity
Gigabit link for data exchange between FPGA-based I/O modules
Built-in support for EtherCAT Master, real-time UDP, and serial I/O
25
Speedgoat Real-Time Target MachinesAssembled based on your technical requirements
Form factors available for office,
lab, field, and classroom use
Optimized for highest real-time
performance (Multicore CPUs
and FPGAs)
Fully tested and works
out-of-the-box
Flexible, expandable
architecture supporting a wide
range I/O connectivity
* Custom engineering and I/O module development available
26
IO Type Functionality
Analog High-resolution, high-speed, simultaneous sampling, BNC and XLR panels, …
Digital TTL/LVCMOS, RS422/RS485/LVDS, 06-48V, low/high side, opto-coupled, …
Serial RS232, RS422, RS485, SDLC, HDLC
Ethernet-based EtherCAT, EtherNet/IP, Modbus TCP, POWERLINK, real-time UDP, …
Protocols CAN, SAE J1939, LIN, Profibus, Modbus, SPI, I2C, SSI, ARINC-429, MIL-STD-
1553, FlexRay, ...
Video CameraLink, USB WebCam
Audio/Speech Audio/Speech optimized analog IO modules
Shared Memory Reflective Memory for high speed data transfer in multi-processor systems
Various LVDT/RVDT, Synchro/Resolver, reed relays, programmable resistors, external
signal conditioning modules (current to voltage, voltage to current,
temperature, …)
Fixed-Function I/O ModulesPowerful “as is” functionality
Delivery includes I/O cables, terminal boards, test models, and Simulink driver blocks
3 years of warranty, and long-term availability (7+ years for most I/O modules)
27
Multi-Function I/O ModulesReconfigurable to support your application
Execute high-speed algorithms on an FPGA connected to a model running in real time with Simulink Real-Time.
Automatically program the FPGA without needing to know HDL code
Quick reconfiguration of FPGA I/O promotes a flexible real-time testing environment.
Three different use cases supported
– Pre-configured FPGA Code Module functionality
– Execute Simulink Applications on FPGA using automatic HDL Code Generation
– Write and implement your own HDL Code using Speedgoat FPGA Engineering Kits
28
Run Simulink in Real-time
You want to run, test, and prove your Simulink design
with your hardware under test at its normal operating
frequency, speed, or timing.
Simulink Real-Time
Official fully assembled, real-time testing MathWorks
solution for Simulink
Combines xPC Target (software) with a real-time
target machine and IO modules (Speedgoat)
Simulink Real-Time
“We received
Speedgoat’s real-time
target machine in the
morning, and in the
evening our system under
test was already up and
running.
That’s how rapid
prototyping should be,
shouldn’t it?”
M. Feriencik, RUAG
Space AG, Switzerland
29
What’s Next
Introduction and overview
What is real-time testing?
Workflow of using Simulink Real-Time
Where can I learn more?
30
Recorded Webinars & Examples
Watch a recorded webinar:
A Simulink Real-Time Testing Solution for Power Electronics & Motor Control
http://www.mathworks.com/company/events/webinars/wbnr68656.html
Prove Your Simulink Designs with Real-Time Hardware Testing
https://www.mathworks.com/company/events/webinars/wbnr73147.html
Explore example models:
Field-Oriented Control of a Permanent Magnet Synchronous MachineThis example shows the basic workflow and key APIs for generating C code from a motor control algorithm, and for verifying its compiled behavior and execution time.
http://mathworks.com/products/demos/shipping/rtw/rtwdemo_pmsmfoc_script.html
xPC Target Examples demonstrating features of xPC Target.
(real-time parameter tuning, signal monitoring, data logging, and more)
http://www.mathworks.com/products/xpctarget/examples.html
31
Need help getting started?
Product-focused training classes
Public or customized on-site training
Jump start services get you up and running quickly
Custom, project-based, application support
Work with your Account Manager to identify topics of
interest and customize services to meet your needs.