HIL Simulation and Testing
In this assignment we will use something called Hardware-in-the-Loop Simulations and Testing. It may be very useful to test that a controller is working 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. More Videos.
We will use a Fuji PXG5 Industrial PID Controller as our "Hardware" in the Loop device. Here you find the Instruction Manual (which must be read carefully!). In addition, we will use the Air Heater System as our process. Blackbox Models and Code Examples are found here.
The following topics are covered in this assignment:
You will need the following hardware:
You need the following software:
Fuji PXG5 PID is an industrial PID Controller typically used in the process industry.
Below you see one of the Industrial PID Controllers we have in the laboratory.
LabVIEW is a graphical programming language, and it has powerful features for simulation, control and DAQ applications.
Typically engineers often create simple LabVIEW VIs that eventually grow out of control, because they don't have the proper structure and best practices. The solution to this problem is organizing your code and data in a way that enables modularity, readability, and reuse.
Some examples are:
Basic LabVIEW Programming (Website)
LabVIEW in Automation (Website)
LabVIEW is a powerful tool for simulations and control. You can simulate dynamic systems (differential equations) in many different ways in LabVIEW. Some examples are:
Below we see an example where we simulate a process in LabVIEW. Instead of the real process we make a model of the real process based on the differential equation of the system. In addition, in this example we control the model using a PID controller.
Here you see some basic Simulation Examples (PowerPoint) where 3 different approaches/alternatives are used.
LabVIEW Control Design and Simulation Module is an add-on to LabVIEW where you can do simulations and create control systems within the LabVIEW environment. You find more information here.
Below we see an example where we simulate a process in LabVIEW using the features in LabVIEW Control Design and Simulation Module. Instead of the real process we make a model of the real process based on the differential equation of the system.
Videos explaining the fundamentals regarding Control Systems:
Understanding PID Control - What is PID Control? (MathWorks)
Example of Control System created with LabVIEW:
LabVIEW has good support for Hardware and DAQ.
The National Instruments USB-6008 is a low-cost, multifunction data acquisition device (DAQ). It has 8 analog inputs, 2 analog outputs, and 12 digital input/outputs. The digital channels are divided into two ports. When one or more channels on each port is set to either input or output, the port is locked into that particular mode.
To use the USB-6008 DAQ from National Instruments, you need to install the NI-DAQmx driver.
When testing Analog Out (or Digital Out) you can e.g., connect the USB-6008 to a multimeter to test if the signal is as expected.
When testing Analog In/Out Pins (or Digital In/Out) you can also use a so-called "Loop-back" Test. here you just wire the input and out put together as illustrated.
In Measurement systems and Control Systems we typically need to deal with noise. Noise is something we typically don’t want. Noise is high-frequency signals. Low-pass Filters are used to remove noise from the measured signals.
Low-pass Filter Overview (Tutorial)
Read Temperature Data with Lowpass Filter in LabVIEW (Video) + PowerPoint (PDF)
When acquiring data from a DAQ device or an I/O Module you typically want to store the data to either a File, a Database or an OPC Server Here we will use the “Write To Measurement File” in LabVIEW as an example If you don’t have a DAQ device or an I/O Module you can create a simple Simulator as exemplified later in this Tutorial.
Logging to Text Files in LabVIEW (Tutorial)
Hardware-in-the-Loop (HIL) Simulation is a technique that is used for testing Control Systems, Embedded Systems, etc. Carrying out a HIL Simulation to Test the Control System, Embedded System, etc. is called HIL Testing.
The machine or physical part of the system (which we call the plant) is normally connected with the control system, through actuators and sensors. With HIL testing the plant is replaced by a simulation of the plant (which we call the HIL simulator). If the HIL simulator is designed well, it will accurately mimic the plant, and can be used to test the control system.