Using External Historical Data with Predict

In some DeltaV installations, data may be collected and recorded either manually or in a system that is not connected to the DeltaV system. In other installations, historical data may have been saved in the historian of another control system that is being replaced by the DeltaV system. In these cases, it may save time to use this historical data to create process models and control definitions to be used by the MPC function block in a DeltaV system. The Predict application can use data from a file to develop a process that may then be used to generate the MPC control. The Predict application can also verify a model against data from a file. This section describes how DeltaV Predict uses data files, the required data file format, and the utilities included in the DeltaV system to export data from a historian into a file.

Developing a Process Model from a File

DeltaV Predict application normally uses data from a historian to create the process model used in control generation. However, DeltaV Predict can use historical data saved in data files as well. The data file must contain historical values for all inputs and outputs used in the MPC block and the data must be formatted correctly for DeltaV Predict to use.

To use historical data from a file, you must first create a module that contains an MPC function block. The MPC block must reference the DeltaV inputs and outputs that will be used in the control. Download this module to a controller or Application Station and then start DeltaV Predict. Connect DeltaV Predict to the MPC block. From the DeltaV Predict main menu, select either FileAutogenerate from File (to create a model and generate MPC control definition in one step) or FileCreate Model From File. The Create Model From File option is grayed out unless you are in Expert mode.

When you select either of these options, a dialog appears in which you specify the data file to use. After you select the file and click OK, DeltaV Predict performs the selected command using the data file and presents the results as if you had used data from a historian.

Verifying a Process Model against Data from File

In order to validate the identified process model, DeltaV Predict application normally uses data on the trend from a historian or the original data used to create the model. However, DeltaV Predict can use historical data saved in data files as well. The data file must contain historical values for all inputs and outputs used in the MPC block and the data must be formatted correctly for DeltaV Predict to use.

To use historical data from a file, you must have created a model for the configured MPC function block. Verification options are grayed out unless you are in Expert mode. In DeltaV Predict select the model you wish to validate. You can either right-click and select Verify ModelVerify Model Against File Data or click the corresponding button on the model display. When you select either of these options, a dialog appears in which you specify the data file to use. After you select the file and click OK, DeltaV Predict verifies the model predictions against the data file and presents the results as if you had used data from a historian.

Verifying a Process Model against Data from File

In order to validate the identified process model, DeltaV Predict application normally uses data on the trend from a historian or the original data used to create the model. However, DeltaV Predict can use historical data saved in data files as well. The data file must contain historical values for all inputs and outputs used in the MPC block and the data must be formatted correctly for DeltaV Predict to use.

To use historical data from a file, you must have created a model for the configured MPC function block. Verification options are grayed out unless you are in Expert mode. In DeltaV Predict select the model you wish to validate. You can either right-click and select Verify ModelVerify Model Against File Data or click the corresponding button on the model display. When you select either of these options, a dialog appears in which you specify the data file to use. After you select the file and click OK, DeltaV Predict verifies the model predictions against the data file and presents the results as if you had used data from a historian.

Data File Format

You can create and verify models using data files. For best results, the values contained in the data file should reflect normal conditions over the operating range of the process. For model creation, the data is normally of the form obtained with open loop bump testing. Any input or output sample values that represent abnormal conditions should be replaced by a non-numeric string in the data file. Use a tool, such as Microsoft Excel, to format and edit the file.

The data files must be saved as .dat files and formatted in a particular way for DeltaV Predict to use them. The data files must contain the following information formatted as described:

Line 1 - Must contain the phrase DeltaV_MPC_Data <eol>

Note

The above header specifies to DeltaV Predict that this is a historical data file.

Line 2 - Lists the Number of Controlled Variables<tab>The Number of Constraint Variables<tab>The Number of Manipulated Variables<tab>The Number of Disturbance Variables<eol>

The number of each type of variable should correspond to those that you configured in the associated MPC function block, except when any Controlled Variable is configured as an Optimizing variable. Refer to the Example Predict Data Files in this topic for examples.

Line 3 - Lists the Number of samples in the file <tab> The sampling period in seconds <eol>

The sampling period must be the sampling period of the data in the file.

Line 4 - An empty line <eol>

Line 5 - Lists the identifiers of the Input and output references separated by tabs <eol>

The identifier names should match those that you configured in the associated MPC function block. They should be placed in the order of the configured variables, for example, for MPC block with three controlled variables, identifiers are in the order CNTRL1, CNTRL2,CNTRL3. Hence, the order will match that of the data, as indicated in Line 7.

Line 6 - An empty line <eol>

Line 7 through the end of data - The data in the following order: index of the sample<tab>first controlled variable value<tab>… last controlled variable value<tab>first constraint variable value<tab>… last constraint variable value<tab>first manipulated variable value<tab>… last manipulated variable value<tab>first disturbance variable value<tab>… last disturbance variable value <eol>

The order of the data should match the order of the configured variables, for example, for MPC block with four controlled variables, data is in the order CNTRL1, CNTRL2,…,CNTRL4. If the data contains values that do not reflect normal operating conditions, replace those values with non-numeric strings to indicate that these values should not be used in the model identification. During identification, the corresponding sample values are replaced by interpolating between the good data values.

Last Line - An empty line <eol>

The following is an example Predict data file for a block consisting of two Controlled Variables (FI101 and PI102), one Constraint Variable (FI103), two manipulated variables (CV100 and CV102) and one measured Disturbance Variable (FI155). The example shows only the first 15 and the last three sample input and output values out of the 389 total. The data was obtained with a sampling period of 5 seconds. Note that some of the output and input data values have been flagged as bad (the values have been replaced by BAD, but could have been replaced by any non-numeric string).

Figure: Example Predict Data File
DeltaV_MPC_Data
2        1        2        1
389      5

FI101    PI102    FI103    CV100    CV102    FI155

1        298.9    49.7     51.4     50.1     40.0     15.0
2        301.1    49.9     49.3     47.6     40.0     15.0
3        301.8    49.7     49.7     52.3     40.0     15.0
4        299.3    49.7     49.8     52.5     40.0     15.0
5        299.7    49.2     48.9     49.5     45.0     19.0
6        299.3    50.1     49.9     50.3     45.0     19.0
7        299.1    50.0     49.9     50.9     45.0     19.0
8        BAD      49.9     49.3     BAD      45.0     19.0
9        299.7    49.2     50.7     49.8     45.0     19.0
10       299.4    50.5     50.3     52.3     45.0     22.0
11       298.6    50.1     50.3     50.6     45.0     22.0
12       298.3    50.0     51.2     48.1     45.0     22.0
13       298.9    BAD      50.9     50.5     45.0     22.0
14       299.7    50.8     49.7     48.7     45.0     22.0
15       300.0    49.8     48.5     52.8     45.0     22.0
.        .        .        .        .        .        .
.        .        .        .        .        .        .
.        .        .        .        .        .        .
387      300.8    50.0     49.4     48.3     35.0     17.0
388      301.1    50.5     50.7     48.5     40.0     17.0
389      301.0    50.2     49.7     51.4     40.0     17.0

Optimizing Variable - If one of the controlled variables is applied for optimization, no connection is required for the control input associated with the manipulated output used to set throughput. (In creating the data file for this case, the number of Controlled Variables does not include the one applied for optimization. For example, for the file shown above, if PI102 is marked for optimization, the data file will not include the column for PI102 and the number of controlled variables is one (1). The format is (only first three samples are shown):

Figure: Example Predict Data File for Optimizing Variable
DeltaV_MPC_Data
 1       1        2        1        (1 CV though 2 configured)
389      5

FI101    FI103    CV100    CV102    FI155    (Optimizing CV identifier excluded)

1        298.9    51.4     50.1     40.0     15.0    (5 data columns, not 6)
2        301.1    49.3     47.6     40.0     15.0
3        301.8    49.7     52.3     40.0     15.0

Extracting Data from the DeltaV Continuous Historian

In some cases, you may need to extract historical data from the DeltaV Continuous Historian into one file that can be used in another DeltaV system to develop a process model. You can export DeltaV Continuous Historian historical data to an Excel spreadsheet using DeltaV Reporter. After saving the file in tab-delimited format, you can easily create a file that conforms to the Predict format. DeltaV Reporter is located in the DeltaV\bin\DeltaVReporter folder on a DeltaV workstation or in the DV_Extras\DeltaVReporter folder on the DeltaV installation disk #4.