![Page 1: MathWorks Technology Session for GE Model Based … · MathWorks Technology Session for GE Model Based Design for Real-Time Testing ... Rational software, IBM Software Group, Moshe](https://reader030.vdocuments.net/reader030/viewer/2022021705/5b5a9e417f8b9a01748c4755/html5/thumbnails/1.jpg)
1 © 2013 The MathWorks, Inc.
MathWorks Technology Session for GE
Model Based Design for Real-
Time Testing
November 20, 2013
Abhishek Bhat
Ethan Woodruff
Tom Priestley
Marc Semma
![Page 3: MathWorks Technology Session for GE Model Based … · MathWorks Technology Session for GE Model Based Design for Real-Time Testing ... Rational software, IBM Software Group, Moshe](https://reader030.vdocuments.net/reader030/viewer/2022021705/5b5a9e417f8b9a01748c4755/html5/thumbnails/3.jpg)
3
Real-Time Execution Options
Real-Time
Execution
Hardware in the Loop Rapid Prototyping
![Page 4: MathWorks Technology Session for GE Model Based … · MathWorks Technology Session for GE Model Based Design for Real-Time Testing ... Rational software, IBM Software Group, Moshe](https://reader030.vdocuments.net/reader030/viewer/2022021705/5b5a9e417f8b9a01748c4755/html5/thumbnails/4.jpg)
4
Real-Time Execution Target HW
.c
S-function
Desktop
Rapid
Prototyping
Embedded
Target
RTOS Task
.v
.xml
![Page 5: MathWorks Technology Session for GE Model Based … · MathWorks Technology Session for GE Model Based Design for Real-Time Testing ... Rational software, IBM Software Group, Moshe](https://reader030.vdocuments.net/reader030/viewer/2022021705/5b5a9e417f8b9a01748c4755/html5/thumbnails/5.jpg)
5
A Word About ‘Real-Time’
1
Number of Blocks
Normalized
Simulation
Time
(tSIM/tCLOCK)
![Page 6: MathWorks Technology Session for GE Model Based … · MathWorks Technology Session for GE Model Based Design for Real-Time Testing ... Rational software, IBM Software Group, Moshe](https://reader030.vdocuments.net/reader030/viewer/2022021705/5b5a9e417f8b9a01748c4755/html5/thumbnails/6.jpg)
6
What’s Next
Introduction and overview
What is real-time testing?
How can I use it to build better products?
– How good is your design?
– Does it work with real hardware?
– Does it work with real software?
Where can I learn more?
![Page 7: MathWorks Technology Session for GE Model Based … · MathWorks Technology Session for GE Model Based Design for Real-Time Testing ... Rational software, IBM Software Group, Moshe](https://reader030.vdocuments.net/reader030/viewer/2022021705/5b5a9e417f8b9a01748c4755/html5/thumbnails/7.jpg)
7
Build better products using
Real-Time Testing
![Page 8: MathWorks Technology Session for GE Model Based … · MathWorks Technology Session for GE Model Based Design for Real-Time Testing ... Rational software, IBM Software Group, Moshe](https://reader030.vdocuments.net/reader030/viewer/2022021705/5b5a9e417f8b9a01748c4755/html5/thumbnails/8.jpg)
8
Question : How do you think this
is useful to your application?
![Page 9: MathWorks Technology Session for GE Model Based … · MathWorks Technology Session for GE Model Based Design for Real-Time Testing ... Rational software, IBM Software Group, Moshe](https://reader030.vdocuments.net/reader030/viewer/2022021705/5b5a9e417f8b9a01748c4755/html5/thumbnails/9.jpg)
9
Motor Controls using Real Time Testing
![Page 10: MathWorks Technology Session for GE Model Based … · MathWorks Technology Session for GE Model Based Design for Real-Time Testing ... Rational software, IBM Software Group, Moshe](https://reader030.vdocuments.net/reader030/viewer/2022021705/5b5a9e417f8b9a01748c4755/html5/thumbnails/10.jpg)
10
So what is Real -Time Testing?
![Page 11: MathWorks Technology Session for GE Model Based … · MathWorks Technology Session for GE Model Based Design for Real-Time Testing ... Rational software, IBM Software Group, Moshe](https://reader030.vdocuments.net/reader030/viewer/2022021705/5b5a9e417f8b9a01748c4755/html5/thumbnails/11.jpg)
11
Real-Time Testing
Real-Time in Engineering –
1 Second in
Simulation
Real-Time Testing is the process of running, proving, and validating
software/hardware system designs in “normal” modes of operation.
1 Second in
Real world =
![Page 12: MathWorks Technology Session for GE Model Based … · MathWorks Technology Session for GE Model Based Design for Real-Time Testing ... Rational software, IBM Software Group, Moshe](https://reader030.vdocuments.net/reader030/viewer/2022021705/5b5a9e417f8b9a01748c4755/html5/thumbnails/12.jpg)
12
Define
Requirements
Full
Integration Hardware-
in-the-Loop
Simulation
Modeling
&
Simulation
Rapid
Prototyping
On Target
Rapid
Prototyping
Software-
in-the-Loop
Simulation
Model-Based Design Continuous verification and validation during system design/testing
System-Level
Specification
Subsystem
Design
Subsystem
Implementation
Subsystem
Integration
System-Level
Integration
![Page 13: MathWorks Technology Session for GE Model Based … · MathWorks Technology Session for GE Model Based Design for Real-Time Testing ... Rational software, IBM Software Group, Moshe](https://reader030.vdocuments.net/reader030/viewer/2022021705/5b5a9e417f8b9a01748c4755/html5/thumbnails/13.jpg)
13
But why bother about this? …
![Page 14: MathWorks Technology Session for GE Model Based … · MathWorks Technology Session for GE Model Based Design for Real-Time Testing ... Rational software, IBM Software Group, Moshe](https://reader030.vdocuments.net/reader030/viewer/2022021705/5b5a9e417f8b9a01748c4755/html5/thumbnails/14.jpg)
14
Why do Model-Based Design (MBD)
Real-Time Simulation & Testing?
It enables you to:
Test, verify, validate, and prove your algorithmic and
system 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-time
software/hardware execution
![Page 15: MathWorks Technology Session for GE Model Based … · MathWorks Technology Session for GE Model Based Design for Real-Time Testing ... Rational software, IBM Software Group, Moshe](https://reader030.vdocuments.net/reader030/viewer/2022021705/5b5a9e417f8b9a01748c4755/html5/thumbnails/15.jpg)
15
Why Model-Based Design?
Software quality optimization: balancing business transformation and risk, Michael
Lundblad, program manager, Rational software, IBM Software Group, Moshe Cohen, offering
manager, Rational software, IBM Software Group
80% of development
costs are spent
identifying and correcting
defects
0%
10%
20%
30%
40%
50%
60%
RQMT DSGN CODE/UT V&V
Pe
rce
nt
of
Bu
gs F
ou
nd
Number of bugs found shifts to earlier in development phase
MBD
SEI - industry average
![Page 16: MathWorks Technology Session for GE Model Based … · MathWorks Technology Session for GE Model Based Design for Real-Time Testing ... Rational software, IBM Software Group, Moshe](https://reader030.vdocuments.net/reader030/viewer/2022021705/5b5a9e417f8b9a01748c4755/html5/thumbnails/16.jpg)
16
What’s Next
Introduction and overview
What is real-time testing?
How can I use it to build better products?
– Characterizing a model
– Rapid Prototyping
– Hardware-In-the-Loop
Where can I learn more?
![Page 17: MathWorks Technology Session for GE Model Based … · MathWorks Technology Session for GE Model Based Design for Real-Time Testing ... Rational software, IBM Software Group, Moshe](https://reader030.vdocuments.net/reader030/viewer/2022021705/5b5a9e417f8b9a01748c4755/html5/thumbnails/17.jpg)
17
I/O Output I/O Input I/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
![Page 18: MathWorks Technology Session for GE Model Based … · MathWorks Technology Session for GE Model Based Design for Real-Time Testing ... Rational software, IBM Software Group, Moshe](https://reader030.vdocuments.net/reader030/viewer/2022021705/5b5a9e417f8b9a01748c4755/html5/thumbnails/18.jpg)
19
AC (electrical grid, inverter, combustion) or DC (battery) powered motors
Multi-rate models – 1 – 20 kHz (outer position and/or velocity control loops)
– 10 – 200 kHz (inner current control loops)
– 1-100 MHz (PWM generation)
Reconfigurable FPGA-based I/O modules – Pulse generation and capture, synchronization, quadrature decoding, digital I/O
High-speed A/D for current measurement
Additional I/O for supervisory control (CAN, EtherCAT, Ethernet/IP)
Real-Time Testing Applications Motor Controls prototyping example
![Page 19: MathWorks Technology Session for GE Model Based … · MathWorks Technology Session for GE Model Based Design for Real-Time Testing ... Rational software, IBM Software Group, Moshe](https://reader030.vdocuments.net/reader030/viewer/2022021705/5b5a9e417f8b9a01748c4755/html5/thumbnails/19.jpg)
20
Wiring and
Signal Conditioning
Embedded Hardware Real-Time Target Computer
Real-Time Simulation & Testing Tasks: Hardware-in-the-loop (HIL) Simulation
![Page 20: MathWorks Technology Session for GE Model Based … · MathWorks Technology Session for GE Model Based Design for Real-Time Testing ... Rational software, IBM Software Group, Moshe](https://reader030.vdocuments.net/reader030/viewer/2022021705/5b5a9e417f8b9a01748c4755/html5/thumbnails/20.jpg)
21
Hardware-in-the-loop Simulation/Testing
Hardware Under Test – Aircraft Engine Controller
Simulation – A/C Engines
Real-Time Testing Applications Aerospace 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)
![Page 21: MathWorks Technology Session for GE Model Based … · MathWorks Technology Session for GE Model Based Design for Real-Time Testing ... Rational software, IBM Software Group, Moshe](https://reader030.vdocuments.net/reader030/viewer/2022021705/5b5a9e417f8b9a01748c4755/html5/thumbnails/21.jpg)
24
Host Computer
with MATLAB
& Simulink
Real-Time Target
Machine
What is xPC Target? Workflow
Ethernet Link
1
2
3
A software environment that allows for real-time execution of Simulink
models on a separate x86, PCI-based target machine. Automatically:
1) Generate code, 2) Compile & Link, 3) Run executable 1 2 3
![Page 22: MathWorks Technology Session for GE Model Based … · MathWorks Technology Session for GE Model Based Design for Real-Time Testing ... Rational software, IBM Software Group, Moshe](https://reader030.vdocuments.net/reader030/viewer/2022021705/5b5a9e417f8b9a01748c4755/html5/thumbnails/22.jpg)
25
Ethernet Link
3
1
2
4
2
1) live parameter tuning, signal monitoring, and control from the
Simulink model, 2) real-time data logging for offline or post-test
analysis in MATLAB, 3) GUI/HMI support, 4) 3-D visualization.
Host Computer
with MATLAB
& Simulink
Real-Time Target
Machine
What is xPC Target? Interactive control and access to the real-time application while it runs
1
2
3 4
![Page 23: MathWorks Technology Session for GE Model Based … · MathWorks Technology Session for GE Model Based Design for Real-Time Testing ... Rational software, IBM Software Group, Moshe](https://reader030.vdocuments.net/reader030/viewer/2022021705/5b5a9e417f8b9a01748c4755/html5/thumbnails/23.jpg)
26
Real-Time Target
Machine
What is xPC Target? I/O support to communicate with your hardware under test
Includes Simulink blocks and software drivers supporting a
broad suite of I/O devices and communication protocols.
Blocks are easily configurable within the Simulink model
and communicate with the I/O hardware in real-time.
![Page 24: MathWorks Technology Session for GE Model Based … · MathWorks Technology Session for GE Model Based Design for Real-Time Testing ... Rational software, IBM Software Group, Moshe](https://reader030.vdocuments.net/reader030/viewer/2022021705/5b5a9e417f8b9a01748c4755/html5/thumbnails/24.jpg)
28
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 Modules Powerful “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)
![Page 25: MathWorks Technology Session for GE Model Based … · MathWorks Technology Session for GE Model Based Design for Real-Time Testing ... Rational software, IBM Software Group, Moshe](https://reader030.vdocuments.net/reader030/viewer/2022021705/5b5a9e417f8b9a01748c4755/html5/thumbnails/25.jpg)
29
Multi-Function I/O Modules Reconfigurable to support your application
Execute high-speed algorithms on an FPGA connected to a model running in real time with xPC Target.
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
![Page 26: MathWorks Technology Session for GE Model Based … · MathWorks Technology Session for GE Model Based Design for Real-Time Testing ... Rational software, IBM Software Group, Moshe](https://reader030.vdocuments.net/reader030/viewer/2022021705/5b5a9e417f8b9a01748c4755/html5/thumbnails/26.jpg)
30
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.
xPC Target Turnkey
Official fully assembled, real-time testing MathWorks
solution for Simulink
Combines xPC Target (software) with a real-time
target machine and IO modules (hardware)
xPC Target Turnkey
“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
![Page 27: MathWorks Technology Session for GE Model Based … · MathWorks Technology Session for GE Model Based Design for Real-Time Testing ... Rational software, IBM Software Group, Moshe](https://reader030.vdocuments.net/reader030/viewer/2022021705/5b5a9e417f8b9a01748c4755/html5/thumbnails/27.jpg)
31
Hardware Test Setup at MathWorks
![Page 28: MathWorks Technology Session for GE Model Based … · MathWorks Technology Session for GE Model Based Design for Real-Time Testing ... Rational software, IBM Software Group, Moshe](https://reader030.vdocuments.net/reader030/viewer/2022021705/5b5a9e417f8b9a01748c4755/html5/thumbnails/28.jpg)
32
Real-Time Control System
Motor
Hardware
Controller
C Code
System Model
Workflow Model your system, design your controller, and test in real-time
Controller
C/HDL Code
Controller
Model
Motor
Model
Motor
Hardware
![Page 29: MathWorks Technology Session for GE Model Based … · MathWorks Technology Session for GE Model Based Design for Real-Time Testing ... Rational software, IBM Software Group, Moshe](https://reader030.vdocuments.net/reader030/viewer/2022021705/5b5a9e417f8b9a01748c4755/html5/thumbnails/29.jpg)
33
What’s Next
Introduction and overview
What is real-time testing?
How can I use it to build better products?
– Characterizing a model
– Rapid Prototyping
– Hardware-In-the-Loop
Where can I learn more?
![Page 30: MathWorks Technology Session for GE Model Based … · MathWorks Technology Session for GE Model Based Design for Real-Time Testing ... Rational software, IBM Software Group, Moshe](https://reader030.vdocuments.net/reader030/viewer/2022021705/5b5a9e417f8b9a01748c4755/html5/thumbnails/30.jpg)
34
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 Machine This 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
![Page 31: MathWorks Technology Session for GE Model Based … · MathWorks Technology Session for GE Model Based Design for Real-Time Testing ... Rational software, IBM Software Group, Moshe](https://reader030.vdocuments.net/reader030/viewer/2022021705/5b5a9e417f8b9a01748c4755/html5/thumbnails/31.jpg)
35
Questions
![Page 32: MathWorks Technology Session for GE Model Based … · MathWorks Technology Session for GE Model Based Design for Real-Time Testing ... Rational software, IBM Software Group, Moshe](https://reader030.vdocuments.net/reader030/viewer/2022021705/5b5a9e417f8b9a01748c4755/html5/thumbnails/32.jpg)
36
End
![Page 33: MathWorks Technology Session for GE Model Based … · MathWorks Technology Session for GE Model Based Design for Real-Time Testing ... Rational software, IBM Software Group, Moshe](https://reader030.vdocuments.net/reader030/viewer/2022021705/5b5a9e417f8b9a01748c4755/html5/thumbnails/33.jpg)
37
Backup slides
![Page 34: MathWorks Technology Session for GE Model Based … · MathWorks Technology Session for GE Model Based Design for Real-Time Testing ... Rational software, IBM Software Group, Moshe](https://reader030.vdocuments.net/reader030/viewer/2022021705/5b5a9e417f8b9a01748c4755/html5/thumbnails/34.jpg)
38
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.
![Page 35: MathWorks Technology Session for GE Model Based … · MathWorks Technology Session for GE Model Based Design for Real-Time Testing ... Rational software, IBM Software Group, Moshe](https://reader030.vdocuments.net/reader030/viewer/2022021705/5b5a9e417f8b9a01748c4755/html5/thumbnails/35.jpg)
39
Have questions? Want to know more about xPC Target or xPC Target Turnkey?
Contact your MathWorks Account Manager or Speedgoat.
Product Details & Contact Information
xPC Target Turnkey www.mathworks.com/products/xpctarget/supported-hardware/index.html
xPC Target www.mathworks.com/products/xpctarget
Speedgoat www.speedgoat.ch
![Page 36: MathWorks Technology Session for GE Model Based … · MathWorks Technology Session for GE Model Based Design for Real-Time Testing ... Rational software, IBM Software Group, Moshe](https://reader030.vdocuments.net/reader030/viewer/2022021705/5b5a9e417f8b9a01748c4755/html5/thumbnails/36.jpg)
40
Key Point
Create accurate plant models by executing tests,
identify parameter values and verifying against real-
world data
Test Identify
Parameters Verify
![Page 37: MathWorks Technology Session for GE Model Based … · MathWorks Technology Session for GE Model Based Design for Real-Time Testing ... Rational software, IBM Software Group, Moshe](https://reader030.vdocuments.net/reader030/viewer/2022021705/5b5a9e417f8b9a01748c4755/html5/thumbnails/37.jpg)
41
Real-Time Control System
Motor
Hardware
System Model
Model your system using MATLAB and Simulink
Controller
C Code
Controller
Model
Controller
C/HDL Code
Motor
Model
Motor
Hardware
![Page 38: MathWorks Technology Session for GE Model Based … · MathWorks Technology Session for GE Model Based Design for Real-Time Testing ... Rational software, IBM Software Group, Moshe](https://reader030.vdocuments.net/reader030/viewer/2022021705/5b5a9e417f8b9a01748c4755/html5/thumbnails/38.jpg)
42
Surface Mount PMSM Equations
Mechanical Model
Electrical Model
𝑣𝑑 = 𝑅𝑖𝑑 − 𝐿𝑞𝑝𝜔𝑟 𝑖𝑞 + 𝐿𝑑
𝑑
𝑑𝑡𝑖𝑑
𝑣𝑞 = 𝑅𝑖𝑞 + 𝑝𝜔𝑟 𝐿𝑑 𝑖𝑑 + 𝜆 + 𝐿𝑞
𝑑
𝑑𝑡𝑖𝑞
𝜔𝑒 = 𝑝𝜔𝑟
𝑇𝑒 = 1.5𝑝 𝜆𝑖𝑞 + 𝐿𝑑 − 𝐿𝑞 𝑖𝑑 𝑖𝑞
𝑇𝑒 = 𝐾𝑡𝑖𝑞 𝑎𝑠𝑠𝑢𝑚𝑒𝑠 𝑟𝑜𝑢𝑛𝑑 𝑟𝑜𝑡𝑜𝑟, 𝐿𝑑 = 𝐿𝑞
𝑑
𝑑𝑡𝜔𝑟 =
1
𝐻 𝑇𝑒 − 𝑠𝑔𝑛 𝜔𝑟 𝐽0 − 𝑏𝜔𝑟 − 𝑇𝑙𝑜𝑎𝑑
![Page 39: MathWorks Technology Session for GE Model Based … · MathWorks Technology Session for GE Model Based Design for Real-Time Testing ... Rational software, IBM Software Group, Moshe](https://reader030.vdocuments.net/reader030/viewer/2022021705/5b5a9e417f8b9a01748c4755/html5/thumbnails/39.jpg)
43
Required Parameters
Electrical Model
Mechanical Model
𝑣𝑑 = 𝑅𝑖𝑑 − 𝐿𝑞𝑝𝜔𝑟 𝑖𝑞 + 𝐿𝑑
𝑑
𝑑𝑡𝑖𝑑
𝑣𝑞 = 𝑅𝑖𝑞 + 𝑝𝜔𝑟 𝐿𝑑 𝑖𝑑 + 𝜆 + 𝐿𝑞
𝑑
𝑑𝑡𝑖𝑞
𝜔𝑒 = 𝑝𝜔𝑟
𝑇𝑒 = 1.5𝑝 𝜆𝑖𝑞 + 𝐿𝑑 − 𝐿𝑞 𝑖𝑑 𝑖𝑞
𝑇𝑒 = 𝐾𝑡𝑖𝑞 𝑎𝑠𝑠𝑢𝑚𝑒𝑠 𝑟𝑜𝑢𝑛𝑑 𝑟𝑜𝑡𝑜𝑟, 𝐿𝑑 = 𝐿𝑞
𝑑
𝑑𝑡𝜔𝑟 =
1
𝐻 𝑇𝑒 − 𝑠𝑔𝑛 𝜔𝑟 𝐽0 − 𝑏𝜔𝑟 − 𝑇𝑙𝑜𝑎𝑑
![Page 40: MathWorks Technology Session for GE Model Based … · MathWorks Technology Session for GE Model Based Design for Real-Time Testing ... Rational software, IBM Software Group, Moshe](https://reader030.vdocuments.net/reader030/viewer/2022021705/5b5a9e417f8b9a01748c4755/html5/thumbnails/40.jpg)
44
Mapping parameters to PMSM model
𝑅
𝐿𝑑 , 𝐿𝑞
𝜆
𝐾𝑡
𝐻
𝑏
𝑝
𝐽0
![Page 41: MathWorks Technology Session for GE Model Based … · MathWorks Technology Session for GE Model Based Design for Real-Time Testing ... Rational software, IBM Software Group, Moshe](https://reader030.vdocuments.net/reader030/viewer/2022021705/5b5a9e417f8b9a01748c4755/html5/thumbnails/41.jpg)
45
Tests to Characterize Motor and Load
Motor Tests Parameters Identified Identification method
Back EMF Test
Number of Pole Pairs (p)
Flux Linkage Constant (λ)
Torque Constant (Kt)
Calculation
Friction Test
Viscous Damping Coefficient (b)
Coulomb Friction (J0)
Curve fitting
Coast Down Test
Rotor Inertia (H) Curve fitting
DC Voltage Step Test Resistance (R)
Inductance (L)
Parameter estimation
![Page 42: MathWorks Technology Session for GE Model Based … · MathWorks Technology Session for GE Model Based Design for Real-Time Testing ... Rational software, IBM Software Group, Moshe](https://reader030.vdocuments.net/reader030/viewer/2022021705/5b5a9e417f8b9a01748c4755/html5/thumbnails/42.jpg)
46
Tests to Characterize Motor and Load
Motor Tests Parameters Identified Identification method
Back EMF Test
Number of Pole Pairs (p)
Flux Linkage Constant (λ)
Torque Constant (Kt)
Calculation
Friction Test
Viscous Damping Coefficient (b)
Coulomb Friction (J0)
Curve fitting
Coast Down Test
Rotor Inertia (H) Curve fitting
DC Voltage Step
Test
Resistance (R)
Inductance (L)
Parameter estimation
![Page 43: MathWorks Technology Session for GE Model Based … · MathWorks Technology Session for GE Model Based Design for Real-Time Testing ... Rational software, IBM Software Group, Moshe](https://reader030.vdocuments.net/reader030/viewer/2022021705/5b5a9e417f8b9a01748c4755/html5/thumbnails/43.jpg)
47
Tests to Characterize Motor and Load
Motor Tests Parameters Identified Identification method
Back EMF Test
Number of Pole Pairs (p)
Flux Linkage Constant (λ)
Torque Constant (Kt)
Calculation
Friction Test
Viscous Damping Coefficient (b)
Coulomb Friction (J0)
Curve fitting
Coast Down Test
Rotor Inertia (H) Curve fitting
DC Voltage Step Test Resistance (R)
Inductance (L)
Parameter estimation
![Page 44: MathWorks Technology Session for GE Model Based … · MathWorks Technology Session for GE Model Based Design for Real-Time Testing ... Rational software, IBM Software Group, Moshe](https://reader030.vdocuments.net/reader030/viewer/2022021705/5b5a9e417f8b9a01748c4755/html5/thumbnails/44.jpg)
48
Coast Down Test
Coast down test used to identify:
Rotor inertia (H)
Test Extract
Parameters Verify
![Page 45: MathWorks Technology Session for GE Model Based … · MathWorks Technology Session for GE Model Based Design for Real-Time Testing ... Rational software, IBM Software Group, Moshe](https://reader030.vdocuments.net/reader030/viewer/2022021705/5b5a9e417f8b9a01748c4755/html5/thumbnails/45.jpg)
49
Identify Rotor Inertia (H)
NRMSD = Normalized Root Mean Square Deviation
Note: J0 and b are known from friction
test. Curve fit equation for ωr to find H.
𝑑𝜔𝑟
𝑑𝑡=
1
𝐻 𝑇𝑒𝑚 − 𝑏𝜔𝑟 − 𝐽0 − 𝑇𝑙𝑜𝑎𝑑
𝐼𝑓
𝑇𝑙𝑜𝑎𝑑 = 0
𝑇𝑒𝑚 = 0
𝑇ℎ𝑒𝑛
𝜔𝑟 = 𝜔𝑟0 + 𝐽0
𝑏 𝑒−
𝑏𝐻𝑡 −
𝐽0
𝑏
Test Extract
Parameters Verify
![Page 46: MathWorks Technology Session for GE Model Based … · MathWorks Technology Session for GE Model Based Design for Real-Time Testing ... Rational software, IBM Software Group, Moshe](https://reader030.vdocuments.net/reader030/viewer/2022021705/5b5a9e417f8b9a01748c4755/html5/thumbnails/46.jpg)
50
Using xPC Target as a real time testing
platform:
Review model
Build code
Run model
That’s it!
Demo: Run Coast Down Test
![Page 47: MathWorks Technology Session for GE Model Based … · MathWorks Technology Session for GE Model Based Design for Real-Time Testing ... Rational software, IBM Software Group, Moshe](https://reader030.vdocuments.net/reader030/viewer/2022021705/5b5a9e417f8b9a01748c4755/html5/thumbnails/47.jpg)
51
Validate Coast Down Test
NRMSD = Normalized Root Mean Square Deviation
Test Extract
Parameters Verify
![Page 48: MathWorks Technology Session for GE Model Based … · MathWorks Technology Session for GE Model Based Design for Real-Time Testing ... Rational software, IBM Software Group, Moshe](https://reader030.vdocuments.net/reader030/viewer/2022021705/5b5a9e417f8b9a01748c4755/html5/thumbnails/48.jpg)
52
Tests to Characterize Motor and Load
Motor Tests Parameters Identified Identification method
Back EMF Test
Number of Pole Pairs (p)
Flux Linkage Constant (λ)
Torque Constant (Kt)
Calculation
Friction Test
Viscous Damping Coefficient (b)
Coulomb Friction (J0)
Curve fitting
Coast Down Test
Rotor Inertia (H) Curve fitting
DC Voltage Step
Test
Resistance (R)
Inductance (L)
Parameter estimation
![Page 49: MathWorks Technology Session for GE Model Based … · MathWorks Technology Session for GE Model Based Design for Real-Time Testing ... Rational software, IBM Software Group, Moshe](https://reader030.vdocuments.net/reader030/viewer/2022021705/5b5a9e417f8b9a01748c4755/html5/thumbnails/49.jpg)
53
Identify Phase Resistance (R)
𝑣𝐼𝑛 𝑡 = 𝑅𝐿𝑖𝑚𝑖𝑡𝑖 𝑡 + 𝑅 𝑖 𝑡 + 𝐿 𝑑𝑖
𝑑𝑡
𝑣𝐼𝑛 𝑡 = 𝑅𝑇𝑖 𝑡 + 𝐿 𝑑𝑖
𝑑𝑡
𝑖 𝑡 = 𝑉𝐼𝑛
𝑅𝑇 1 − 𝑒
−𝑅𝑇𝐿
𝑡
𝑤ℎ𝑒𝑟𝑒: 𝑅𝑇 = 𝑅𝐿𝑖𝑚𝑖𝑡 + 𝑅
𝑅 = lim𝑡→∞
𝑣𝐼𝑛 𝑡
𝑖 𝑡
𝑅 = 𝑅
2
𝐿 = 𝐿
2
Test Extract
Parameters Verify
![Page 50: MathWorks Technology Session for GE Model Based … · MathWorks Technology Session for GE Model Based Design for Real-Time Testing ... Rational software, IBM Software Group, Moshe](https://reader030.vdocuments.net/reader030/viewer/2022021705/5b5a9e417f8b9a01748c4755/html5/thumbnails/50.jpg)
54
Identify Inductance (L) using
Parameter Estimation
Test Extract
Parameters Verify
![Page 51: MathWorks Technology Session for GE Model Based … · MathWorks Technology Session for GE Model Based Design for Real-Time Testing ... Rational software, IBM Software Group, Moshe](https://reader030.vdocuments.net/reader030/viewer/2022021705/5b5a9e417f8b9a01748c4755/html5/thumbnails/51.jpg)
55
Validate DC Voltage Step Test
NRMSD = Normalized Root Mean Square Deviation
Test Extract
Parameters Verify
![Page 52: MathWorks Technology Session for GE Model Based … · MathWorks Technology Session for GE Model Based Design for Real-Time Testing ... Rational software, IBM Software Group, Moshe](https://reader030.vdocuments.net/reader030/viewer/2022021705/5b5a9e417f8b9a01748c4755/html5/thumbnails/52.jpg)
56
Key Point
Create accurate plant models by executing tests,
identify parameter values and verifying against real-
world data
Test Identify
Parameters Verify
![Page 53: MathWorks Technology Session for GE Model Based … · MathWorks Technology Session for GE Model Based Design for Real-Time Testing ... Rational software, IBM Software Group, Moshe](https://reader030.vdocuments.net/reader030/viewer/2022021705/5b5a9e417f8b9a01748c4755/html5/thumbnails/53.jpg)
57
Agenda
What we’ll cover today
MathWorks Overview
What is real-time testing?
How can I use it to build a better model?
– Characterize a plant
– Optimize a controller
– Verify a system design
Where can I learn more?
![Page 54: MathWorks Technology Session for GE Model Based … · MathWorks Technology Session for GE Model Based Design for Real-Time Testing ... Rational software, IBM Software Group, Moshe](https://reader030.vdocuments.net/reader030/viewer/2022021705/5b5a9e417f8b9a01748c4755/html5/thumbnails/54.jpg)
58
Real-Time Control System
System Model
Design your controller through simulation
Controller
C Code
Motor
Hardware
Motor
Model
Controller
Model
Controller
C/HDL Code
Motor
Hardware
![Page 55: MathWorks Technology Session for GE Model Based … · MathWorks Technology Session for GE Model Based Design for Real-Time Testing ... Rational software, IBM Software Group, Moshe](https://reader030.vdocuments.net/reader030/viewer/2022021705/5b5a9e417f8b9a01748c4755/html5/thumbnails/55.jpg)
59
Design Controller through Simulation
Select model architecture
Optimize closed-loop performance
Test failure modes
![Page 56: MathWorks Technology Session for GE Model Based … · MathWorks Technology Session for GE Model Based Design for Real-Time Testing ... Rational software, IBM Software Group, Moshe](https://reader030.vdocuments.net/reader030/viewer/2022021705/5b5a9e417f8b9a01748c4755/html5/thumbnails/56.jpg)
60
Demo: check control response against
requirements
![Page 57: MathWorks Technology Session for GE Model Based … · MathWorks Technology Session for GE Model Based Design for Real-Time Testing ... Rational software, IBM Software Group, Moshe](https://reader030.vdocuments.net/reader030/viewer/2022021705/5b5a9e417f8b9a01748c4755/html5/thumbnails/57.jpg)
61
Demo: Tune Controller using Optimization
![Page 58: MathWorks Technology Session for GE Model Based … · MathWorks Technology Session for GE Model Based Design for Real-Time Testing ... Rational software, IBM Software Group, Moshe](https://reader030.vdocuments.net/reader030/viewer/2022021705/5b5a9e417f8b9a01748c4755/html5/thumbnails/58.jpg)
62
Demo: check optimized controller response
![Page 59: MathWorks Technology Session for GE Model Based … · MathWorks Technology Session for GE Model Based Design for Real-Time Testing ... Rational software, IBM Software Group, Moshe](https://reader030.vdocuments.net/reader030/viewer/2022021705/5b5a9e417f8b9a01748c4755/html5/thumbnails/59.jpg)
64
Design Controller through Simulation
Select model architecture
Optimize closed-loop performance
Test failure modes
![Page 60: MathWorks Technology Session for GE Model Based … · MathWorks Technology Session for GE Model Based Design for Real-Time Testing ... Rational software, IBM Software Group, Moshe](https://reader030.vdocuments.net/reader030/viewer/2022021705/5b5a9e417f8b9a01748c4755/html5/thumbnails/60.jpg)
65
Agenda
What we’ll cover today
MathWorks Overview
What is real-time testing?
How can I use it to build a better model?
– Characterize a plant
– Optimize a controller
– Verify a system design
Where can I learn more?
![Page 61: MathWorks Technology Session for GE Model Based … · MathWorks Technology Session for GE Model Based Design for Real-Time Testing ... Rational software, IBM Software Group, Moshe](https://reader030.vdocuments.net/reader030/viewer/2022021705/5b5a9e417f8b9a01748c4755/html5/thumbnails/61.jpg)
66
Real-Time Control System
Controller
C Code
System Model
Test your controller model with actual motor
Motor
Hardware
Motor
Model
Controller
C/HDL Code
Motor
Hardware
Controller
Model
![Page 62: MathWorks Technology Session for GE Model Based … · MathWorks Technology Session for GE Model Based Design for Real-Time Testing ... Rational software, IBM Software Group, Moshe](https://reader030.vdocuments.net/reader030/viewer/2022021705/5b5a9e417f8b9a01748c4755/html5/thumbnails/62.jpg)
67
Real-Time Control System
Motor
Hardware
Controller
C Code
System Model
Test and Verify your design
Motor
Hardware
Motor
Model
Controller
Model
Controller
C/HDL Code
![Page 63: MathWorks Technology Session for GE Model Based … · MathWorks Technology Session for GE Model Based Design for Real-Time Testing ... Rational software, IBM Software Group, Moshe](https://reader030.vdocuments.net/reader030/viewer/2022021705/5b5a9e417f8b9a01748c4755/html5/thumbnails/63.jpg)
68
Demo: Comparison of Simulation and Hardware Results
![Page 64: MathWorks Technology Session for GE Model Based … · MathWorks Technology Session for GE Model Based Design for Real-Time Testing ... Rational software, IBM Software Group, Moshe](https://reader030.vdocuments.net/reader030/viewer/2022021705/5b5a9e417f8b9a01748c4755/html5/thumbnails/64.jpg)
69
Agenda
What we’ll cover today
MathWorks Overview
What is real-time testing?
How can I use it to build a better model?
– Characterize a plant
– Optimize a controller
– Verify a system design
Where can I learn more?
![Page 65: MathWorks Technology Session for GE Model Based … · MathWorks Technology Session for GE Model Based Design for Real-Time Testing ... Rational software, IBM Software Group, Moshe](https://reader030.vdocuments.net/reader030/viewer/2022021705/5b5a9e417f8b9a01748c4755/html5/thumbnails/65.jpg)
70
Have questions? Want to know more about xPC Target or xPC Target Turnkey?
Contact your MathWorks Account Manager or Speedgoat.
Product Details & Contact Information
xPC Target Turnkey www.mathworks.com/products/xpctarget/supported-hardware/index.html
xPC Target www.mathworks.com/products/xpctarget
Speedgoat www.speedgoat.ch
![Page 66: MathWorks Technology Session for GE Model Based … · MathWorks Technology Session for GE Model Based Design for Real-Time Testing ... Rational software, IBM Software Group, Moshe](https://reader030.vdocuments.net/reader030/viewer/2022021705/5b5a9e417f8b9a01748c4755/html5/thumbnails/66.jpg)
71
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 Machine This 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
![Page 67: MathWorks Technology Session for GE Model Based … · MathWorks Technology Session for GE Model Based Design for Real-Time Testing ... Rational software, IBM Software Group, Moshe](https://reader030.vdocuments.net/reader030/viewer/2022021705/5b5a9e417f8b9a01748c4755/html5/thumbnails/67.jpg)
72
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.