OPAL-RT RT14: Running OPAL-RT's eHS solver on NI cRIO
1. The 7th International Conference
on Real-Time Simulation Technologies
Montreal | 9-12 June, 2014
1
Running OPAL-RT’s eHS on National Instruments cRIO:
Sub-microsecond power-electronic simulation
Ben Black
Market Development Manager, Real-Time Test & Power Systems
National Instruments
ben.black@ni.com
Pierre-Yves Robert
FPGA Specialist,
OPAL-RT TECHNOLOGIES Inc.
pierre-yves.robert@opal-rt.com
2. The 7th International Conference
on Real-Time Simulation Technologies
Montreal | 9-12 June, 2014
2
National Instruments | Our Mission
We equip engineers and scientists with tools that accelerate productivity,
innovation, and discovery.
3. The 7th International Conference
on Real-Time Simulation Technologies
Montreal | 9-12 June, 2014
3
Our Stability
Annual Revenue: $1.17 billion
Global Operations: Approximately 7,100 employees;
operations in almost 50 countries
Broad Customer Base: More than 35,000 companies
served annually
Diversity: No industry >15% of revenue
Culture: Ranked among the top 25 companies to work
worldwide by the Great Place to Work Institute
Strong Cash Position: Cash and short-term investments
of $393 million at December 31, 2013
R&D Investment: Roughly 16% of revenue invested
back in R&D
4. The 7th International Conference
on Real-Time Simulation Technologies
Montreal | 9-12 June, 2014
4
The Benefits of Off-the-Shelf Technology
With the Flexibility of Custom Design
Why compromise?
The NI approach delivers the benefits of custom design with quality off-the-shelf products
so you can focus on INNOVATION not IMPLEMENTATION
5. The 7th International Conference
on Real-Time Simulation Technologies
Montreal | 9-12 June, 2014
5
The Benefits of Off-the-Shelf Technology
With the Flexibility of Custom Design
Benefits
High-Level Software
Flexible Hardware
Integrated Hardware and Software Platform
6. The 7th International Conference
on Real-Time Simulation Technologies
Montreal | 9-12 June, 2014
6
Graphical System Design
A platform-based approach for measurement and control
Applications
Models of Computation, User Interface
Math and Analysis
Timing
Measurement and Control I/O
Connectivity With Third-Party I/O
Commercial Technology
Deployable Targets
7. The 7th International Conference
on Real-Time Simulation Technologies
Montreal | 9-12 June, 2014
7
Graphical System Design
A platform-based approach for measurement and control
Applications
8. The 7th International Conference
on Real-Time Simulation Technologies
Montreal | 9-12 June, 2014
8
LabVIEWSystem Design Software
Project Explorer
Manage and organize all
system resources, including I/O
and deployment targets
Front Panel
Create event-driven user
interfaces to control systems
and display measurements
Hardware Connectivity
Bring real-world signals into
LabVIEW from any I/O on any
instrument
Block Diagram
Define and customize the
behavior of your system using
graphical programming
Instant Compilation
See the state of
your application at
all times, instantly
Parallel Programming
Create independent loops that
automatically execute
in parallel
Analysis Libraries
Use high-performance analysis
libraries designed
for engineering and science
Timing
Define explicit execution order
and timing with sequential data
flow
Deployment Targets
Deploy LabVIEW code to the
leading desktop, real-time, and
FPGA hardware targets
Models of Computation
Combine and reuse .m files, C
code, and HDL with graphical
code
Accelerates Your Success
By abstracting low-level complexity and integrating all of the tools you need to build any measurement or control system
9. The 7th International Conference
on Real-Time Simulation Technologies
Montreal | 9-12 June, 2014
9
The NI Approach to Flexible Hardware
We call this the LabVIEW RIO Architecture.
Highly Productive LabVIEW Graphical Programming Environment for Programming
Host, FPGA, I/O, and Bus Interfaces
Commercial
Technology
Processor
Real-Time or
PC-Based
FPGA Modular I/O
for Any Signal
Processor
Real-time OS
Application software
Networking and
peripheral I/O drivers
DMA, interrupt, and
bus control drivers
FPGA
Application IP
Control IP
DSP IP
Specialized I/O drivers
and interface
DMA controller
Analog I/O
Digital I/O
Specialized I/O
Custom I/O
Bus Protocols
10. The 7th International Conference
on Real-Time Simulation Technologies
Montreal | 9-12 June, 2014
10
NI CompactRIO
FPGA
Processor Modular I/O
11. The 7th International Conference
on Real-Time Simulation Technologies
Montreal | 9-12 June, 2014
11
NI CompactRIO
FPGA
Processor Modular I/O
Extreme Ruggedness: -40 to 70 °C temperature range; 50 g shock, 5 g vibration
High Performance: Up to 1.33 GHz, dual-core i7 processor
Comprehensive I/O: Analog, digital, custom, specialty, bus communication
Highly Productive LabVIEW Graphical Programming Environment for Programming
Host, FPGA, I/O, and Bus Interfaces
12. The 7th International Conference
on Real-Time Simulation Technologies
Montreal | 9-12 June, 2014
12
667 MHz Dual-Core ARM Cortex-A9 processor
28K Logic Cells (Artix-7)
80 DSP slices, 16 DMA channels
92 Billion calculations per second
Xilinx
ZYNQ
13. The 7th International Conference
on Real-Time Simulation Technologies
Montreal | 9-12 June, 2014
13
NI myRIO – Control Platform
All programmable SoC
Express VIs for ease-of-use
Rich, Known I/O
Extensive Ecosystem
WiFi & Tablet Ready
LabVIEW unleashed
C/C++ Programmable
14. The 7th International Conference
on Real-Time Simulation Technologies
Montreal | 9-12 June, 2014
14
NI myRIO | Courseware
15. The 7th International Conference
on Real-Time Simulation Technologies
Montreal | 9-12 June, 2014
15
OPAL-RT IP + LabVIEW + CompactRIO for HIL
16. The 7th International Conference
on Real-Time Simulation Technologies
Montreal | 9-12 June, 2014
16
OPAL-RT + CompactRIO for HIL
17. The 7th International Conference
on Real-Time Simulation Technologies
Montreal | 9-12 June, 2014
17
Design “V” Teaching Platform
6 DIO Vabc PWM
myRIO for control paired with:
• Inverter research board (real plant)
• NI / Opal-RT HIL Trainer (simulated plant)
Inverter Research
Board
Feedback
NI / Opal-RT HIL Trainer
18. The 7th International Conference
on Real-Time Simulation Technologies
Montreal | 9-12 June, 2014
18
First demonstration: Diode-Bridge Rectifier
This circuit simulates a three-phase voltage rectifier with various loads.
Teaching objectives:
• To introduce the student with the
simulation tools
• To understand the operating principles of
a diode-bridge rectifier
• To highlight the effect of the load type
and value on the output voltage ripple
19. The 7th International Conference
on Real-Time Simulation Technologies
Montreal | 9-12 June, 2014
19
Second demonstration: Boost Converter
This circuit simulates a DC-DC Boost converter with various loads.
Teaching objectives:
• To understand the operating principles of a
boost converter
• To observe and understand the effect of the
load type and value on the boost output
voltage
• To find the S1 switching duty cycle marking the
delimitation between continuous and
discontinuous operation modes.
20. The 7th International Conference
on Real-Time Simulation Technologies
Montreal | 9-12 June, 2014
20
Third demo: Boost with external controller
We connect the Boost converter to an external controller.
Teaching objectives:
• To introduce the student with
closed-loop control, including wire
connections
• To design from scratch a PI controller
adapted for a boost converter
• To find the suited controller
parameters according to load
characteristics
Boost model
(cRIO)
Boost Controller
(myRIO)
VL_out
S1
NI9263 ch0
NI9401 ch0
C AI0
C PWM0
21. The 7th International Conference
on Real-Time Simulation Technologies
Montreal | 9-12 June, 2014
21
What is eHS ?
• This approach uses the modified nodal
analysis.
• It solves the conductance matrix of the
network to find the voltage at each node
and the current from each sources.
• The conductance matrix is loaded into the
solver when the model is deployed.
• The simulated model can be modified
without recompiling the bitfile.
Graphical circuit design
and offline simulation
Automatic analysis of the
circuit netlist and generation
of the conductance matrix
FPGA-based simulation on
circuit-independent
firmware
22. The 7th International Conference
on Real-Time Simulation Technologies
Montreal | 9-12 June, 2014
22
Integration of eHS into the LabVIEW environment
• The eHS tool will be included as a
module of LabVIEW.
• Exercises will be provided with pre-compiled
bitfiles for the FPGA
firmware.
• To accommodate different I/O
configurations, custom bitfiles can
be generated using LabVIEW FPGA.
23. The 7th International Conference
on Real-Time Simulation Technologies
Montreal | 9-12 June, 2014
23
Modifying the simulated circuit
To modify the component values in a circuit, the student generally chooses from a list of pre-defined
scenarios. eHS matrices are pre-generated to match these scenarios.
• In general, this is done in a LabVIEW control panel provided him by the teaching assistant.
24. The 7th International Conference
on Real-Time Simulation Technologies
Montreal | 9-12 June, 2014
24
Modifying the simulated circuit
Alternatively, the student could use a standard schematic editor, and re-compile the corresponding
conductance matrix.
• At the time being, this is done within the Matlab environment.
25. The 7th International Conference
on Real-Time Simulation Technologies
Montreal | 9-12 June, 2014
25
Creating new exercises
A professor may want to modify scenarios, create new ones, or even create exercises based on completely
different circuit topologies
• The new circuit can be designed with his favorite schematic editor
• LabVIEW provides full access to the control panel for scenario control.
26. The 7th International Conference
on Real-Time Simulation Technologies
Montreal | 9-12 June, 2014
26
eHS: Computation time
On the cRIO, the eHS feature uses a 160-MHz clock.
• This enables very small computation step sizes, in general between 125 ~ 500 ns.
• Computation step sizes depends on the circuit complexity and the number of scenarios implemented.
• Loop rate of the Boost Converter model is 3.33 MHz (300 ns).
• Loop rate of the Diode-Bridge Rectifier model is 2.16 MHz (460 ns).
• Loop rate of the Buck Converter model is 7.27 MHz (140 ns).
• Loop rate of the 3-Phase Inverter model is 2.38 MHz (420 ns).
S1
VDC
Iload
Vload
S1
S2
S3
S4
S5
S6
VDC
VDC
Iload, A
Iload, B
Iload, C
27. The 7th International Conference
on Real-Time Simulation Technologies
Montreal | 9-12 June, 2014
27
eHS: Hardware-in-the-Loop simulation timing
When eHS is connected to an external plant or controller, the total loop time must include I/O latency
eHS on
cRIO Zync
300 ns
Controller
(?? us)
VL_out
S1
NI9263 Analog Output
8 us
NI9401 Digital Input
100 ns
In this case, the loop time is not critical, but the Boost model and digital lines still need to run fast to
accommodate fast-switching PWM controls.
28. The 7th International Conference
on Real-Time Simulation Technologies
Montreal | 9-12 June, 2014
28
eHS: Supported Circuit editors
As of today, the eHS circuit can be described with one of the following tools:
• SimPowerSystem Toolbox for Simulink
• PLECS
• PSIM
Development is planned for the following tools:
• Multisim
• EMTP-RV
29. The 7th International Conference
on Real-Time Simulation Technologies
Montreal | 9-12 June, 2014
29
RUNNING OPAL-RT’S eHS ON NATIONAL INSTRUMENTS cRIO:
SUB-MICROSECOND POWER-ELECTRONIC SIMULATION
• By running Opal-RT’s eHS on a National Instruments cRIO platform, the simulation of power-electronic
circuits can be performed at sub-microsecond sample times.
• The low cost of the eHS-cRIO solution makes it suitable as a model-based test bench in an
undergraduate educational lab equipment.
• The flexibility of the eHS-cRIO solution enables a full hardware-in-the-loop solution with loop
times in the order of tens of microseconds.
• Opal-RT can provide a variety of models suited for educational purposes, such as DC-DC
converters, Inverters, Rectifiers, etc.
30. The 7th International Conference
on Real-Time Simulation Technologies
The 7th International Conference
on Real-Time Simulation Technologies
Montreal | 9-12 June, 2014
30
Montreal | 9-12 June, 2014
Appendices
31. The 7th International Conference
on Real-Time Simulation Technologies
Montreal | 9-12 June, 2014
The 7th International Conference
on Real-Time Simulation Technologies
Montreal | 9-12 June, 2014
31
eHS: PEJOVIC METHOD
• The Pejovic method models switches by either an
inductor when conducting or a capacitor when blocking
in the nodal matrix.
• This method is called the fix-Y because the conductance
matrix does not change when a switch changes state.
• When using the modified nodal analysis the main
difference between an inductance and a capacitor is in
their discretization and in their historical term. Once
discretized, the equivalent circuit is a current source with
a shunt resistance.
Editor's Notes
Since the founding of the company in 1976, we have sought to enable and empower engineers and scientists with tools that help them get their job done faster and help them realize their impact on our society. Our mission is to equip engineers and scientists with tools that accelerate productivity, innovation, and discovery in connecting to the physical world around us.
NI’s commitment stands on solid, stable ground because we are managed for the long term, focusing on sustainable growth and profitability. We believe the best way to serve our customers is to ensure a successful stable company customers can rely on for products that will be consistent in quality over time, and provide customer service for the decades our products will be used. This sustainable ethic is reflected in our growth, our breadth and our diversity. We also reflect it in our culture of being a consistently great place to work throughout our offices worldwide.
Engineering has never been about following the status quo. If it were, then many of the awesome products that are in the world today would never exist!
This is exactly the mentality we have here at NI.
We feel that domain experts should have access to tools that allow you to realize your goals and dreams. You should have a design platform where they get the benefits of off the shelf technology with the flexibility of custom design so that you can focus on innovation, and not the implementation.
Why should engineers have to choose? Why not have both. This is NI’s approach
Engineering has never been about following the status quo. If it were, then many of the awesome products that are in the world today would never exist!
This is exactly the mentality we have here at NI.
We feel that domain experts should have access to tools that allow you to realize your goals and dreams. You should have a design platform where they get the benefits of off the shelf technology with the flexibility of custom design so that you can focus on innovation, and not the implementation.
Why should engineers have to choose? Why not have both. This is NI’s approach
At National Instruments, we define the concept of a platform-based approach to building measurement and control systems as graphical system design. It’s a way to accelerate development of these systems by simplifying systems integration, providing a way to customize industry standard platforms, and supporting the overall approach with examples and users. This approach gives you reuse of a software-centered platform deploying to multiple hardware options that share a reconfigurable architecture, just as in the consumer space, the iOS scales across iMac, iPad, iPhone. The key is a platform that can define all the essential components of systems.
It starts with the solutions you need to automate measurements – test systems, control systems, systems to monitor and log data. In short, systems that connect people, I/O, computing, and data. When those systems autonomously interact with each other, this is sometimes referred to as cyber physical systems, intelligent systems, or smart machines. Each of these systems requires fundamental components to work.
First, to build these systems, you need to run them on something, the deployment target. While the PC, PXI, CompactRIO and single boards all serve different physical requirements, the hardware architecture is the same – modular, computing, processing, busses, all customizable by software. These open deployment targets need to connect with many kinds of instruments and controllers from other vendors, across many communications protocols to simplify system integration. In addition, it tightly integrates with the modular I/O designed for these platforms to provide better performance at lower costs than separate existing instrumentation.
Another component is using the latest commercial standard technology that can follow the price/performance curve of Moore’s Law for processors, DSPs, and FPGAs, ADCs, and bus technologies, as well as the features of the latest desktop and real-time operating systems like Linux, and data management and reporting tools from Excel to databases to the cloud. Rather than need to become an expert on all the technologies or pulling together teams of experts and specialists to do so – you can leverage the engineering and ecosystem that goes into the platform.
Other elements include the ability to describe systems with different models – C, graphical code, events, states, and objects, dynamic systems and simulation. You need the ability to interactively control, present and document data. You need math and signal processing ability and most importantly in real systems, the ability to describe timing. These fundamental elements of systems need to be encompassed in a platform. And once you’ve applied the platform to a single problem, you can use it to scale to multiple problems, including future requirements and technologies to meet new challenges.
Scalability and flexibility is key to reusing what you already have and what you already know to apply it to present and future problems. This ultimately saves time, resources, costs – and makes you successful.
At National Instruments, we define the concept of a platform-based approach to building measurement and control systems as graphical system design. It’s a way to accelerate development of these systems by simplifying systems integration, providing a way to customize industry standard platforms, and supporting the overall approach with examples and users. This approach gives you reuse of a software-centered platform deploying to multiple hardware options that share a reconfigurable architecture, just as in the consumer space, the iOS scales across iMac, iPad, iPhone. The key is a platform that can define all the essential components of systems.
It starts with the solutions you need to automate measurements – test systems, control systems, systems to monitor and log data. In short, systems that connect people, I/O, computing, and data. When those systems autonomously interact with each other, this is sometimes referred to as cyber physical systems, intelligent systems, or smart machines. Each of these systems requires fundamental components to work.
First, to build these systems, you need to run them on something, the deployment target. While the PC, PXI, CompactRIO and single boards all serve different physical requirements, the hardware architecture is the same – modular, computing, processing, busses, all customizable by software. These open deployment targets need to connect with many kinds of instruments and controllers from other vendors, across many communications protocols to simplify system integration. In addition, it tightly integrates with the modular I/O designed for these platforms to provide better performance at lower costs than separate existing instrumentation.
Another component is using the latest commercial standard technology that can follow the price/performance curve of Moore’s Law for processors, DSPs, and FPGAs, ADCs, and bus technologies, as well as the features of the latest desktop and real-time operating systems like Linux, and data management and reporting tools from Excel to databases to the cloud. Rather than need to become an expert on all the technologies or pulling together teams of experts and specialists to do so – you can leverage the engineering and ecosystem that goes into the platform.
Other elements include the ability to describe systems with different models – C, graphical code, events, states, and objects, dynamic systems and simulation. You need the ability to interactively control, present and document data. You need math and signal processing ability and most importantly in real systems, the ability to describe timing. These fundamental elements of systems need to be encompassed in a platform. And once you’ve applied the platform to a single problem, you can use it to scale to multiple problems, including future requirements and technologies to meet new challenges.
Scalability and flexibility is key to reusing what you already have and what you already know to apply it to present and future problems. This ultimately saves time, resources, costs – and makes you successful.
For over 26 years, LabVIEW has made engineers more productive by ensuring that they can take full advantage of hardware products, and that they are able to use them with all of the analysis and UI capabilities necessary for any measurement or control system. LabVIEW allows users to develop their application IP, build their user interface, and manage all of your hardware from a single location.
LabVIEW increases productivity by abstracting low-level complexity and integrating all of the technology engineers and scientists need into a single, unified development environment, unlike any other text-based alternative.
Each new version of LabVIEW is designed with features to further enhance and accelerate productivity.
High level description of LabVIEW.
Just call out the basics here, no need to go into deep detail. This will happen on the next slides.
The FPGA is the core of this approach as it gives the user a lot of power and flexibility.
<build>
The flexibility comes from the user being able to define how the hardware operates. The ability to implement custom IP directly on the FPGA such as high-speed closed loop control algorithms, custom timing and triggering, or in-line signal processing is extremely powerful.
However, only having an FPGA is not enough. While it gives your application a lot of flexibility you still need to connect to the outside world.
<build>
There are a number of I/O requirements that an application could have so having quality modular I/O that includes all of the signal processing built in is required. This allows you to connect your hardware to any sensor on any bus.
Finally the hardware will need to include some host processing.
<build>
This will allow you to run all of your application software as well as your user interface. A real-time operating system will offer deterministic operation for time critical applications, where a Windows based operating system offers the maximum flexibility. In addition, having a host processor will offer networking peripherals to allow you to connect to additional systems.
Still while having all of these components are great, and offer a lot of flexibility, they all still need to be programmed. In addition to programming the individual components, the interconnects need to be programmed as well. However, using LabVIEW
<build>
gives you the benefit of programming all of them from the same environment, including the interconnections between the components. This integration of highly productive software, and flexible hardware is what we call the LabVIEW RIO architecture or LabVIEW Reconfigurable I/O.
Call our the benefits of each component of the architecture.
You still need to program each element
This is where LabVIEW integrates, we call this the LabVIEW RIO Architecture
This architecture is manifested in several different ways, the first of which is our flagship embedded control and monitoring platform named CompactRIO. This platform is built upon the LabVIEW RIO architecture, which consists of
<build>
an embedded controller for communication and processing
<build>
a reconfigurable chassis housing the user-programmable FPGA,
<build>
and hot-swappable I/O modules that allow you to connect to any sensor on any bus.
CompactRIO systems are designed for extreme ruggedness, reliability, and I/O flexibility. With 50 g shock ratings and a wide -40 to 70 °C operating temperature on some models, CompactRIO systems and are ideal for automotive, industrial automation, and advanced control applications. CompactRIOs are also available with conformal coating options for an even higher level of ruggedness. CompactRIO also offers high levels of processing performance with up to a 1.33 GHz dual core Intel i7 processor at low power consumption levels, with a wealth of I/O availability. These flexible systems offer the processing power you need for advanced control applications, high-speed data transfer and logging, and processing-intensive applications such as rapid control prototyping and advanced motion.
<build>
Finally, LabVIEW allows you target the CompactRIO directly from the project, and allows you program the embedded processor, FPGA, and interface with the I/O all from the same environment.
CompactRIO leverages the LVRIO architecture, and offers high levels of ruggedness and performance
This product features the brand new Zynq chip from Xilinx. This allows us to take the latest industry technology and put it in the hands of students. In traditional NI embedded targets, the processor and FPGA have been separate chips. Now Zynq brings these two components together into one chip which lets us create smaller targets and provides a faster but for communication between processor and FPGA.
Additionally, this chip brings a new OS to National Instruments….Linux. myRIO users can take full advantage of the Linux community and can SSH into myRIO and install packages, etc. If Linux is not something that you want to interact with, myRIO runs LabVIEW on top of Linux and you can interact with this target just like any other RIO target.
Linux also gives us the ability to program the processor of myRIO completely in C or C++ using the Eclipse IDE.
To accompany these kits, we worked with Professor Ed Doering of the Rose-Hulman Institute of Technology to create a Project Essentials Guide to ensure that students can use the components in the kits. Dr Doering will teach students the theory behind a component, how to wire it and build the necessary circuitry, and how to program it. Each component is also accompanied by a video. This resources is available for free today on ni.com.