0% found this document useful (0 votes)
18 views98 pages

Hardware in The Loop Simulation and Testing

hardware in the loop

Uploaded by

OUSSAMA ZEMZI
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views98 pages

Hardware in The Loop Simulation and Testing

hardware in the loop

Uploaded by

OUSSAMA ZEMZI
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 98

h/ps://www.halvorsen.

blog

Hardware in the Loop


Simulation and Testing
Hans-Petter Halvorsen
Background
• You work as a System Engineer for a System Engineering Company.
• An Industrial Production Company has announced a competition between several selected System
Engineering companies to perform a preliminary Project.
• Your Assignment is to develop a Control System Prototype/PoC where Hardware in the Loop
Simulation is an essential part of the Development and Testing.
• In the PoC, a Fuji PXG5 PID will be used to demonstrate the principles. The Fuji PXG5 PID shall be
used to control an industrial small-scale process.
• The HIL System should be implemented in LabVIEW.
• To create proper and user-friendly GUI/HMI is an important part of the Prototype.
• The delivery is a Technical Report where you shall give an overview of the entire system made,
including the Methods used and the Results archived.
• The PoC and the Report will be an important foundation for decision making within the company
when it comes to the final implementation of the system sometime in the future. Note! Multiple
System Engineering companies have been given this opportunity, so it is important that you “Add
Value” and stand out compared to the others in order to be selected as the final Contractor.
System Requirements
1. Perform Control and Simulations in LabVIEW using built-in PID Controller
(Software only)
– Create, Simulate and Control a Mathematical model of an Air Heater (Software only).
– Mathematical Model of Air Heater is provided, but proper Model Parameters need to be found
– Find Proper PI(D) Parameters. Data should be saved to a Text File.
2. Perform HIL Simulation using Fuji PXG5 PID (HW + SW)
– Control Mathematical Model using Fuji PXG5 PID
– Test Auto-tuning with Fuji PXG5 PID
3. Implement and Test Fuji PID PXG5 on Real Process (Hardware only)
4. Make sure to properly Test and Document the Performance of the Control System

These are the complete requirements for the assignment. The rest of this document
contains resources like additional information, code examples, tips and tricks, step-by
step instructions, etc. that you can use at your own discretion.
https://www.halvorsen.blog

Resources
Hans-Petter Halvorsen Table of Contents
Table of Contents
1. Introduction
2. Introduction to HIL
3. Simulated Control System
• Air Heater Model
• LabVIEW PID Controller
• Lowpass Filter
4. HIL + Fuji PXG5 PID Controller
5. Real Control System: Fuji PXG5 + Air Heater
6. Digital Twins
https://www.halvorsen.blog

Introduction
Hans-Petter Halvorsen Table of Contents
Fuji PXG5 PID Controller
• We will create a Simulator (Mathematical
model) that shall be controlled by the PID
controller
• The main Hardware in this Lab is an
industrial PID controller
• The PID controller device will be the
“Hardware in the Loop”
• The aim is to test the the device before
you put it into production. This is referred
to as “Hardware in the Loop Simulation
and Testing
General HIL Concept Sketch
Hardware (HW) Software (SW)
Input Model of Output
HIL Unit
the System

Feedback
Learning Goals
• Learn key concepts within Hardware in the loop (HIL) simulations and
testing
• Learn practical skills and implementation of HIL applications
• Learn practical skills in Modelling, Control and Simulation
• Learn practical implementation of Industrial Control Systems
• Learn more LabVIEW Programming
• Learn about Hardware-Software Interactions
• Learn Practical Skills and Implementations in general
• Learn Software Installation in general, which can be cumbersome with
many pitfalls
• Learn to use and create Software in general in a professional manner
HIL Simulation - Step-by-step
1
Step 1: Ordinary Software Simulation: Mathematical Model

Purpose: Create, Simulate, Control and


Test the MathemaRcal Model

2
Step 2: HIL Simulation and Testing:
Mathematical Model
Purpose: Test your Hardware device
before you apply it on your real system.
Also useful for Training purposes.

3
Step 3: Running the Real System:
Purpose: Apply your Hardware in
the Production System
Step 1: SimulaIon
Control and Simulation in LabVIEW using built-in PID Controller and
Mathematical Model of the Process (Software only)

Computer (with LabVIEW)


Step 2: Use PXG5 with Model
PXG5 Industrial
PID Controller Analog Out Model of Process (Air Heater)
(Process Value) USB
1-5V
AO0
GND Mathematical Model
Note!!
AI0+
AI0- Computer (with LabVIEW)
Analog In I/O Module
(Control Signal) (USB-6008)
PID Controller 0-5V
Step 3: Use PXG5 with Real System
PXG5 PID Controller Process (Air Heater)
+
Process Value
- 1-5V

- Control Signal
0-5V
Industrial PID Controller
Software
• LabVIEW
• LabVIEW Control & SimulaBon Module
• DAQmx Driver SoIware

Make sure to install the


necessary Software before
you go to the laboratory!
Hardware
USB-6008 Air Heater
Fuji PXG5/PXR5 PID Controller
Multimeter

Your Personal
Computer

We have limited numbers of PID Controllers, so, 2-3 students may need to share a PID Controller
The teacher have not done Very often it works on one computer but
not on another. You may have other
all the Tasks in detail, so he
versions of the software, you may have
may not have all the installed it in the wrong order, etc...
answers! That's how it is in In these cases Google is your best friend!
real life also!

The Teacher dont have all the answers (very few actually L)!! Sometimes you just need to “Google” in
order to solve your problems, Collaborate with other Students, etc. Thats how you Learn!
Troubleshooting & Debugging
Use the Debugging Tools in your Use available Resources
Programming IDE. such as User Guides,
Visual Studio, LabVIEW, etc. have great Datasheets, Textbooks,
Tutorials, Examples,
Debugging Tools! Use them!!
My System Tips & Tricks, etc.

is not Mu
ltim
Working?? eter
, etc
“Google It”! Use
.
You probably will find the Microsoft
answer on the Internet Teams

Check your electric circuit, electrical cables, DAQ device, etc. Check if
Another person in the world probably the wires from/to the DAQ device is correct. Are you using the same
had a similar problem I/O Channel in your SoFware as the wiring suggest? etc.
Lab Assignment Guidelines
• Make sure to read the whole assignment before you start to
solve any of the problems.
• If you miss assump:ons for solving some of the problems, you
may define proper assump:ons yourself.
• The Tasks described in the Assignment are somewhat loosely
defined and more like guidelines, so feel free to interpret the
Tasks in your own way with a personalized touch.
• Feel free to Explore! Make sure to Add Value and Crea/vity to
your Applica:ons!
• Try to add some extra value and be crea:ve compared to the
simplified examples given by me, in that way you learn so
much more.
Lab Assignment Guidelines
• Think about the Lab Assignment as a small real-life industrial
Project, and not a set of tasks or exercises.
• What does the company that hire you expect from you when
you deliver this project? What kind of Quality is expected?
• Try to see your work in a larger context than just a Lab
Assignment or a set of exercises.
• Try to see the big picture. The tasks within the assignment
are just just small building blocks that ends up with a fully
working system.
• It is recommended that you make a Work Plan and a System
Sketch that gives you an overview of what YOU should do
Lab Work Requirements
• Make sure to see the “Big picture” – you don’t need to document every single step you
have made. Focus on what’s important (your final system).
• Your GUIs is important! - make sure to make them user friendly and intuitive. You create
this on behalf of someone that are going to use your applications.
• Make sure to always add Units in your GUI, charts, documentation, etc.
• Presenting values with 4+ decimals makes no sense! E.g., a temperature sensor is not
that accurate. You can easily change number of decimals that you present in your GUI in
LabVIEW, C#, etc.
• The Quality of the LabVIEW code is important. Make sure to use "straight lines" in your
LabVIEW code, etc. The code should also flow from left to right, not opposite direction.
You create this on behalf of someone that are going to use your applications. Neat code
makes it easier to develop, maintain, find code errors, etc.
• In general, make sure that you take some pride in your applications and the work that
you do. It's not about getting finished as soon as possible. The mission is to learn as
much as possible within a given timeframe. Try to change the mindset.
• To improve the LabVIEW code, please see this video: LabVIEW Applications using State
Machine: https://youtu.be/-b9St8wNhpQ
https://www.halvorsen.blog

Introduction to HIL
Hans-Petter Halvorsen Table of Contents
What is HIL Simulation?
The main purpose with the HIL Simulation is to Test the Hardware-in-the-loop (HIL) simulation and testing is a
Hardware device on a Simulator before we implement it
technique that is used in the development and test of
on the real process.
complex process systems. HIL simulation provides an
effective platform by adding the complexity of the plant
under control to the test platform.
The complexity of the plant under control
is included in test and development by
adding a mathematical representation of
all related dynamic systems. These
mathematical representations are referred
to as the “plant simulation.”

Hardware-In-the-Loop is a form of real-time simulation. Hardware-In-the-Loop differs from real-


time simulation by the addition of a real component in the loop. This component may be an
“Electronic Control Unit” (ECU). [Wikipedia]
Example of PC-based Control System
(We shall not do like this in this Assignment!) Process (Air Heater)

USB Analog In
(Process Value)
AI0+
Computer (with LabVIEW) 1-5V
AI0-

AO0 0-5V
GND
Analog Out
(Control Signal)
I/O Module (USB-6008)

PID Control and Monitoring


Example of HIL Simulation
Model of Process (Air Heater)
Analog Out
(Process Value) USB
1-5V
AO0
GND
Mathematical Model
Note!!
AI0+
AI0- Computer (with LabVIEW)
Analog In I/O Module
PID Control (Control Signal) (USB-6008)
0-5V
Example of Industrial Single Loop PID Control
(This is our final goal in this Assignment)
Process (Air Heater)
+
Process Value
- 1-5V

- Control Signal
0-5V
Industrial PID Controller
Examples of Industrial Control Systems (ICS)
Industrial Control Systems are computer-controlled systems that monitor and control industrial processes that exist in the physical world

National
Instruments
cRIO
Programmable LabVIEW
PC based Control
Automation Industrial PID System/SCADA System
Controller Controller (Supervisory Control And Data
(PAC) Acquisition) I/O Module
Distributed Control Systems (DCS) PLC (Programmable Logic Controller)

Controller I/O Modules

DeltaV
from Emerson
Siemens PLC
HIL Background
• Typically, a simulator communicates with an “ECU” (“Electronic Control
Unit”) via ordinary I/O. Such a system - where the real controller is
controlling a simulated process is denoted Hardware-in-the-loop (HIL)
simulaMon.
• The main purpose with HIL is to test the hardware device on a
simulator before we implement it on the real process.
• If the mathemaMcal model used in the simulator is an accurate
representaMon of the real process, you may even tune the controller
parameters (e.g., the PID parameters) using the simulator.
• We will test the Fuji PGX5 PID controller on a model, and if everything
is OK, we will implement the controller on the real system.
HIL Simulation
Traditional Process Control using Software for Implementing the Control System
SoJware Hardware
u y y AI
PID Process
u
DAQ
AO

HIL Simulation
Hardware SoJware
u y AI
u
PID Process
Mathematical Model y
DAQ
AO
HIL Simulation
• Hardware-in-the-loop (HIL) simulation is a technique that is used in the
development and test of complex process systems
• The HIL simulation includes a mathematical model of the process and a
hardware device/ECU you want to test, e.g. an industrial PID controller we will
use in our example. The hardware device is normally an embedded system
• The main purpose with the HIL Simulation is to test the hardware device on a
simulator before we implement it on the real process
• It is also very useful for training purposes, i.e., the process operator may learn
how the system works and operate by using the hardware-in-the-loop
simulation
• Another benefit of Hardware-In-the-Loop is that testing can be done without
damaging equipment or endangering lives.
HIL Simulation using PXG5 PID
Control Signal
𝑢 [0 − 5𝑉] 𝑦 [20℃ − 50℃]
𝑢 [0 − 5𝑉]
PXG5 𝑢 Simulated
Scaling? USB-6008
PID Controller It depends on
Process Measurement
Analog In (AI0)
your settings

Analog Out (AO0)


USB-6008 Scaling
[1 − 5𝑉] [1 − 5𝑉] 𝑦 [20℃ − 50℃]
𝑓(𝑥) = 𝑎𝑥 + 𝑏
https://www.halvorsen.blog
Step 1: Ordinary Software Simulation

Simulated Control
System
Hans-Petter Halvorsen Table of Contents
Simulated Control System
Purpose: Create, Simulate, Control and Test the Mathematical Model.
Find Proper PID Parameters.

Software Software
u y
PID Process
DAQ
https://www.halvorsen.blog

Air Heater System


Small-scale Laboratory Process

Hans-Petter Halvorsen Table of Contents


Air Heater
Air Heater Overview
𝜃# Aim: Control the Temperature
𝑇%&' 𝜃( on the outlet (𝑇!"# )

𝐾$
Heater

Control
Unit
𝑇!"# Temperature
Sensor on the 20 − 50℃
Fan outlet

Air In 𝑢 𝑦 (𝑇!"# ) Air Out


Control Signal
to the Heater
1 − 5𝑉
0 − 5𝑉
Air Heater Overview
• Heater: The air is heated by an electrical heater. The supplied
power is controlled by an external voltage signal in the range 0 - 5
V (min power, max power).
• Temperature sensors: A Pt100 temperature sensor. The range is 1
- 5V (Air Heater #1-17)/0-5V (Air Heater #18-32), and this voltage
range corresponds with a linear relation to the temperature range
20 - 50oC (Air Heater #1-17) or 0 - 50oC (Air Heater #18-32).
• Example of Mathematical model for the Air Heater process:
1
̇𝑇/01 = −𝑇/01 + 𝐾2 𝑢 𝑡 − 𝜃3 + 𝑇456
𝜃1
Air Heater Mathematical Model
1
𝑇̇/01 = −𝑇/01 + 𝐾2 𝑢 𝑡 − 𝜃3 + 𝑇456
𝜃1
Where: Use, e.g., these
values in the
Simulations:

Students: Implement and Simulate a Mathematical Model of the Air Heater using LabVIEW.
Air Heater in LabVIEW
Heater: The air is heated by an electrical heater. The supplied power is controlled by an external
voltage signal in the range 0 - 5 V (min power, max power).
Temperature sensors: Two Pt100 temperature elements are available. The range is 1 - 5 V, and this
voltage range corresponds to the temperature range 20 - 50oC (with a linear relation).
Example of Mathematical Model of Air Heater implemented in LabVIEW:

Note! This model is implemented in a so-called “SimulaRon Subsystem” (which is recommended!!!)


Simulation Subsystem
A Way to structure your code, similar to SubVIs
This is the recommended way to do it! – You can easily reuse your
Subsystems in different VIs and your code becomes more structured!

Select File -> New ..., Then choose “Simulation


Subsystem”.
Create your Model within the Simulation Subsystem
Basic Application Example
Note! This is just an Example! – You should create your own personal Application

Clear the Charts, etc. Step Response


using “Property Nodes”

Manual
Control

Simulation SubSystem

Inimalizamon
Finding Model Parameters using “Trial and Error”
You may use, e.g., the following Parameters as a starting point, but since every
Air Heater is unique, you may want to adjust these parameters. The “Trial and
Error Method” may be an easy way to find the Parameters for your Process.
These values can be a good starting point:

Step Respone

Equal?

Procedure: You run the Model and the Real Process in Parallel. Adjust the Model Parameters
until the output of the Model and the Real Process is “equal”.
“Trial and Error” Example in LabVIEW
Ex
SubVI that take care of input am
from DAQ device, Scaling, etc. pl
e

Real Process or Black Box Model

Compare Model
with Real Process

Initialization using
Property Nodes Replace this with your
model of the Air Heater
“Air Heater Black Box Model”
• The Real Air Heater is only available in the
Laboratory
• A “Real” Air Heater will we provided for
download as a “black box”. Actually, it is a
LabVIEW SubVI where the Block Diagram and
the Process Parameters are hidden.
• Useful for Online Students and when you are
working with the Assignment outside the
Laboratory
For Online Students • You can use it to find Model Parameters, etc.
when you are not in the Laboratory
https://www.halvorsen.blog

LabVIEW PID
Controller
Hans-Petter Halvorsen Table of Contents
PID Control of Model in LabVIEW
The Simulation Loop has some drawbacks/is more complicated to use than an ordinary While Loop. If we
use Simulatation Subsystems, we can use them inside a While Loop instead! - which becomes very handy!

For real applications that


involves more than just
simulations (such as DAQ, File
Logging, PID control of the
real process, etc.), I
recommend to use a While
Loop instead of a Simulation
Loop.
A State Machine approach is
Feedback Node also recommended.

Students: Implement a Control System in LabVIEW where you use the built-in PID
Controller and the Mathematical Model of the Air Heater
LabVIEW PID Controller
Front Panel
Normally we use seconds as unit for Ti and Td (which is
recommended!)
But the built-in PID algorithm in LabVIEW uses minutes
as unit!

Cluster

Block Diagram:
Trick:
Divide by 60
You could also put this code
into a new SubVI
PID Parameters
• Find Proper PID Parameters for the system
• We will primarily focus on PI, but you may try PID
as well
• E.g., use one or more of the following methods:
– “Trial and Error” method
You may try these values
– Skogestad’s method as a starting point:
– Ziegler Nichols method 𝐾) = 0.8
𝑇* = 20𝑠
– etc. 𝑇( = 0𝑠
PID Tuning with Skogestad

[Figures: F. Haugen, Advanced Dynamics and Control: TechTeach, 2010]

We can set, e.g., Tc=10 sec. and


c=1.5.
You may use other values if
these values give a poor result.
https://www.halvorsen.blog

Lowpass Filter
Hans-Petter Halvorsen Table of Contents
Lowpass Filter
• You should consider using a Lowpass Filter in order to
reduce Noise
• You can use a built-in Filter in LabVIEW
• Or you can create your own Lowpass Filter from scratch
• Or download a Lowpass Filter (LabVIEW SubVI) from the
Web site of this Lab Assignment
• You should first Test it on the MathemaGcal model before
you apply it on the real system (next Task)
See next slides for examples
Built-in Lowpass Filter to reduce Noise
Functions palette: Express -> Signal Analysis -> Simulate Signal

Functions palette: Express -> Signal Analysis -> Filter


Properties
Lowpass Filter created from Scratch
You may download this Lowpass
Filter (LabVIEW SubVI) from the
Web page of this Lab Assignment
- or create your own from scratch

A golden rule is:


Discrete Lowpass Filter Example
Lowpass Filter Transfer function: We define:

Inverse Laplace the differential Equation:


This gives:

We use the Euler Backward method:

Filter output Noisy input signal


This gives:

This algorithm can be easily implemented in


a Programming language such as LabVIEW
Testing the Filter
In this example we add noise to a Sine
function. We then use the Measurement
Filter to see if we can remove the noise
afterwards.

As you can see this gives good


results.
The filter removes the noise
from the signal.
Creating and Using SubVIs
SubVI for Scaling
SubVI for Lowpass Filtering

SubVI that handles


the I/O between
LabVIEW and the
Real Process

Convert from Dynamic Data


Ex

SubVIs
am
pl
e
https://www.halvorsen.blog
Step 2: HIL Simulation and Testing

HIL with Fuji PXG5


PID
Hans-Petter Halvorsen Table of Contents
HIL with Fuji PXG5 PID
Purpose: Test your Hardware device before you apply it on your real system.
Both to avoid damages, accidents, but also to tune the PID controller. It us
also useful for Training purposes.

Hardware Software
u y
PID Process
DAQ
Fuji PXG5 PID Controller
No Food and Drink allowed when
you use the Fuji PXG5 hardware,
Make sure to disconnect the power cable when wiring because of risk of electric shock!
HIL with Fuji PXG5/PXR5 PID Theory

• It may be very useful to test a controller function


with a simulated process before the controller is
applied to the real (physical) process.
• If the mathematical model used in the simulator
is an accurate representation of the real process,
you may even tune the controller parameters
(e.g. the PID parameters) using the simulator.
HIL Simulation Setup
Model of Process (Air Heater)
Analog Out
(Process Value) USB
1-5V
AO0

GND Mathematical Model


Note!!
AI0+
AI0- Computer (with LabVIEW)
Analog In I/O Module
(Control Signal) (USB-6008)
0-5V
PID Control
USB-6008 DAQ
Always test your DAQ device before you use it in your application
Loopback Test:
1. Create the simple test program as shown below. If you get the same value in the Analog Out and in the
2. Wire the AO0 and AI0 cables together. Analog In – you know your device is working properly

Numeric Control

Should be equal

Numeric Indicator

Students: Make sure your DAQ device works as expected


Fuji PXG5 PID Simulator
❗ The Fuji PXG5 PID is only available in the Laboratory. If you work at home, you may want
to use a “Fuji PXG5 PID Simulator”. You can create your own “Simulator” or download this
Example from the Web Page of this Lab Work.

Change SV (Set Value)


and PID Parameters
Ex
am
pl
e

For Online Students


HIL Example with Fuji PXG5 PID Simulator
For Online Students

In this example you can easily switch between


the Real Fuji PID Controller and a “Simulator”
PXG5 PID Controller

Students: It is crucial that you


read the Instruction Manual
carefully before you start
using the Fuji PID Controller!
Otherwise you may destroy
it!

You can find the The PXG5 PID Instrucmon Manual googling it or on the lab assignment web page
Hardware
PXG5 PID Controller
Wiring Diagram
We use a 250Ω resistor to convert
the signal from 0-20mA to 0-5V

Note! 230V – Be careful!! 68


PXG5 PID Controller Wiring Diagram
How it works (Main Features):

For more details, please read the PXG5 InstrucOon Manual!


PXG5 - Configuration
How-To Change Setpoint:

How-To Change Parameters:

Channel 1: Auto-tuning
Channel 2: PID Parameters
PXG5 - Configuration
Some recommended Channel Settings:
Closed-loop Control
Channel 6:
Channel 1: Channel 2: Pvb = 20 (Lower PV Limit)
MAn = oFF SvL = 20 (Lower SV Limit) PvF = 50 (Upper PV Limit)
rEM = LoCl Svh = 50 (Upper SV Limit) Pvd = 0 (or 1) #digits after
AT = oFF You set SV locally in the Fuji PID
decimal point

C1r = 0-20mA (Control output


Note! The Temperature Range for most of the range, a 250ohm resistor is used to
Air Heaters is 20 − 50℃ 1 − 5𝑉 - but some convert to 0-5V)
has 0 − 50℃ (0 − 5𝑉)
Test Communication between PXG5 and DAQ Device
Note! Set Parameter C1r in Ch6: 0-20mA.
You should test the communication before you start working on the task
A 250 Ω resistor converts the signal to 0-5V

You can
choose to
show
voltage or
Engineering
0 − 100% → 0 − 5𝑉 units

Run the PXG5 in “Manual


Mode” (hold down the A/M We manually adjust the
setpoint between 0-100%
bueon for å few seconds)

Students: It is recommended that you create such


a VI in order to test the communication between
LabVIEW and PXG5 PID
HIL Simulation in LabVIEW - Example
E xa
m
pl
e
You can use a
Simulation
Loop or a
While Loop. A
While loop is
recommended.
SubVI: Note! This is opposite of what you normally do
In Range and Coerce

Students: Perform a HIL simulation using PXG5 and LabVIEW


Setting PID Parameters on the PXG5
Note! PXG5 uses
Proportional Band

Example:

Students: Find proper PID parameters using, e.g., Skogestad, Ziegler Nichols, etc.
PID Tuning with Skogestad

[Figures: F. Haugen, Advanced Dynamics and Control: TechTeach, 2010]

We can set, e.g., Tc=10 sec. and


c=1.5.
You may use other values if
these values give a poor result.
PXG5 – Auto-tuning
A lamp is blinking when the
auto-tuning is running

Students: Test the Auto-tuning functionality built-


into the PXG5 PID. Do you get the same results?
PXG5 – Auto-tuning
Students:
• Execute auto-tuning: What is the resulMng P-, I- and D-values? What is the
value of the controller gain (Kp) that corresponds to the P-value from the
auto-tuning?
• Is the stability of the Control System OK? (excite with a step in the Set-
point/Reference Signal)
• Apply a step change in the reference: What is the steady-state control
error?
• Reverse vs. Direct AcMon: What happens to the stability of the control
system if the controller mode is changed from Reverse acMon to Direct
acMon? (In the controller manual, Direct acMon is denoted Normal mode.)
• Fine-tune the PID parameters if necessary.
https://www.halvorsen.blog
Step 3: Running Hardware with the Real System

Fuji PXG5 + Real Air


Heater
Hans-Petter Halvorsen Table of Contents
Fuji PXG5 + Real Air Heater
Purpose: Apply your Hardware in the Production Environment

Hardware Hardware
u y
PID Process
DAQ
Fuji PXG5 + Real Air Heater
Industrial PID Controller

Process Value
1-5V

Control Signal
0-5V

Students: Test the PXG5 PID Controller on the real Air Heater. Are you able to use the
same PID settings you found using the Model? Test also the Auto-tuning functionality.
Do you get the same parameters as using the model? Which PID parameters are best?
When you are not in the Laboratory
For Online Students

For Online Students and when you are not on the


Laboratory, you can use:
• “Fuji PXG5 PID Simulator”
• “Air Heater Black Box Model”

These can be downloaded from the website for this


assignment
“Fuji PXG5 PID Simulator” + “Air Heater Black Box Model” Example
For Online Students and Ex
am
when not in the Laboratory pl
e

(You see the Block Diagram on the next slide)


“Fuji PXG5 PID Simulator” + “Air Heater Black Box Model” Example
For Online Students and Ex
am
when not on the Laboratory pl
e

Fuji PXG5 PID Simulator

Air Heater Black Box Model


Fuji PXG5 + Real Air Heater + PC for Monitoring
Industrial PID Controller
Process Value
1-5V

Trending/Monitoring
0-5V
the Process Value and
Control Signal on the PC Control Signal

y Process Value
u USB 1-5V Control Signal
0-5V

With this setup you can Monitor (Plot


and Log Data to File) the Process Value
PC with LabVIEW and Control Signal on your PC
Save Data to File (Datalogging)
Right-click-Properties

Recommended Settings
Save Data to File (Datalogging)
Ex
am
pl
e
Measurement
Open the File with Logged
File – Data Visualization
Open the File with Logged Data in MS Excel and
Data in e.g., Notepad: create a Chart (Measurement Value, Control Value)

Make sure to include Units

Make sure to format Number of Decimals


87
Comparison of PID Parameters
Example:
Kp PB [%] Ti [sec] Td [sec] Tuning Method Comment
Built-in PID in
LabVIEW
Fuji on Model

Fuji Autotuning
on Model
Fuji on Real
Process
Fuji Autotuning
on Real Process
... others

Fill out a similar Table with the values you


find. Discuss the Results.
https://www.halvorsen.blog

Digital Twins
A brief Overview of a Digital Twins and how it is related to HIL Simulations

Hans-Petter Halvorsen Table of Contents


Digital Twins
A digital twin is an “exact” digital replica of a
product, process or service. This living model
creates a thread between the physical and
digital world
General Digital Twin Concept Sketch
SW
Model of
HW the System
Output
Control Input
System
Unit HW

Feedback
Digital Twin
• Digital twins integrate internet of things, artificial
intelligence, machine learning etc. to create living
digital simulation models that update and change
as their physical counterparts change.
• A digital twin continuously learns and updates
itself from multiple sources (sensors, etc.) to
represent its near real-time status
Digital Twin and HIL
• The terms Digital Twin and Hardware in the Loop
Simulation are closely related.
• National Instruments doesn’t use the term digital
twin, but their hardware-in-the-loop (HIL) testing
technology platform provides similar
functionality
• http://www.ni.com/en-no/innovations/automotive/hardware-in-the-loop.html
• https://www.digitalengineering247.com/article/seeing-digital-twin-double/
Digital Twins in Automation Systems
• Preventive Maintenance
• Improved Control
• Model Based Control (MPC)
• State Estimation and Kalman Filter
• Can use the simulated environment to experiment
with different controls strategies
• Model different scenarios to optimize the
production
Why Digital Twins?
• Preventive Maintenance
• Predictive Analytics
• Improved Control
• Can use the simulated environment to
experiment with different controls strategies
• Model different scenarios to optimize the
production
Fuji PXG5 + Real Air Heater + Digital Twin

A Simulator running in
parallel with the real system
𝑢
𝑦
Simulator
𝑦 𝑢

Prediction and Analytics


Fuji PXG5 + Real Air Heater + Digital Twin
Industrial PID Controller
Process Value
1-5V

Model of Process 0-5V


(Air Heater)
Control Signal

y USB Process Value


u 1-5V Control Signal
0-5V

Computer (with LabVIEW)


Hans-Petter Halvorsen
University of South-Eastern Norway
www.usn.no

E-mail: [email protected]
Web: https://www.halvorsen.blog

You might also like