Hardware-in-the-Loop Testing for Execution of EcosimPro Simulation Models on the PXI Platform

Fernando Carbonero, Empresarios Agrupados

"Being able to execute EcosimPro models in real time on a PXI platform means that HIL testing can be done before real prototyping."

- Fernando Carbonero, Empresarios Agrupados

The Challenge:

Executing and testing, in real time, a model written with the EcosimPro simulation tool on the PXI platform with Phar Lap operating system in a hardware-in-the-loop (HIL) configuration.

The Solution:

Testing two configurations: one with a DC motor model developed with EcosimPro and a model compatible with VeriStand software and executed with PXI Express hardware, and a second configuration with a PI controller coded with EcosimPro and effectively executed in the same PXI model but now connected to a real DC motor.

Author(s):

Fernando Carbonero - Empresarios Agrupados
V. Pordomingo - Empresarios Agrupados
J.M. Zamarreño - Universidad de Valladolid
C. De Prada - Universidad de Valladolid
R. Martí - Universidad de Valladolid

 

Introduction and objectives

The main objective of this project was to test the procedure that makes possible the execution of EcosimPro simulation models in a real-time platform like PXI in a HIL configuration. Two configurations were tested; in the first one the model is executed on the PXI and controlled by an external PLC, and in the second one, a model of the controller is executed on the PXI so it is able to control a real system.


Configuration #1

 

In this first configuration (architecture shown at Figure 1 and real equipment at Figure 2), we started with a simple DC motor model written in EcosimPro simulation language. For being able to execute it in the PXI platform, some steps must be followed:

 

1. In EcosimPro software, generate a Matlab S-function from the DC Motor model.

2. In Simulink, open the previous generated model, define external inputs and outputs of the model and use Simulink Coder to build a simulation model for NI VeriStand.

3. In NI VeriStand, configure a new project importing the simulation model and map model inputs/outputs with corresponding DAQ signals.


A PID was configured in a Siemens SIMATIC S7-1200 PLC with a SB 1232 AQ output module and connected to the PXI hardware. In this way, we can test (Figure 3) a real industrial controller acting on a simulated DC Motor. Additionally, we were able to satisfy real-time conditions in the execution of the model selecting an appropriate sampled time. Fulfillment of these real-time conditions can be easily checked from NI VeriStand through analysis of several model execution signals.

 

Configuration #2
The second configuration (Figure 4) is oriented towards the execution of a PI controller on the PXI system whose model is coded in EcosimPro. The steps for generating a VeriStand compatible model from the EcosimPro PI model are the same as in configuration #1. The DC motor is a model suitable for students in our laboratory and it has an integrated tachometer so we can close the loop with the controller (reading the signal generated by the tachometer and sending a voltage signal to the motor input).

 

 

 

 

 

Figure 5 shows one of the experiments we performed. As the PI controller coded in EcosimPro did not include a limitation in the OP (Output to Process) generated signal, we had to cut off the output of the controller before sending it to the controlled motor, but a delay in the control action is clearly visible before the control action comes into limits. This could be solved implementing a better control strategy, which at this point was out of the scope of this project.

 

Author Information:
Fernando Carbonero
Empresarios Agrupados
Magallanes, 3
Madrid 28015
Spain
Tel: 913098000
fct@empre.es

Figure 3.
Figure 1.
Figure 2.
Figure 4
Figure 5.