Você está na página 1de 13

LabVIEW System Identification Toolkit

By Ricardo Santa Olalla

Introduction In the System Control Design the most important consideration is a well defined model for the plant that you want to control. The reason is that the entire design will be based on this mathematical model. One way to obtain this model is by using a numerical process known as system identification. This process involves acquiring data from a plant and then numerically analyzing stimulus and response data to estimate the parameters of the plant. System identification is a process that includes acquiring, formatting, processing, and identifying mathematical models based on raw data from a real-world system. You then validate that the resulting model fits the observed system behavior. If the results are unsatisfactory, you revise the parameters and iterate through the process. Figure 1 shows a typical system identification flowchart.

Figure 1. System Identification Flowchart

The National Instruments LabVIEW System Identification Toolkit combines data acquisition tools with system identification algorithms for accurate plant modeling. It provides two tools, an assistant and a library of VIs, for identifying discrete single-input single-output (SISO) and multiple-input and multiple-output (MIMO) linear systems. Table of Contents Model Estimation through the System Identification Assistant Model Estimation through the LabVIEW VIs Conclusion References Model Estimation through the System Identification Assistant

LabVIEW System Identification Toolkit

Without prior knowledge of programming in LabVIEW, you can use the System Identification Assistant to develop a model that reflects the behavior of a certain dynamic system. You access the System Identification Assistant through the NI Express Workbench. The Express Workbench is a new framework that can host multiple interactive National Instruments tools and assistants. To open the System Identification Assistant you go to Tools > System Identification Toolkit > Launch System Identification Assistant.

Figure 2. Express Workbench Under this environment you build your project through several steps. In the first step we need to define how to acquire the signal coming from the plant. To do this, we add a step and choose whether to acquire the data through DAQ or load it from a saved file. In this example we will use the data saved in a LabVIEW Measurement File (.lvm) from one of the shipping examples. To add the step you click on Add Step > Signal Input/Output > Load/Save Signals > Load from LVM. Click on the folder icon and navigate to the following folder: C:\Program Files\National Instruments\ExpressWorkbench\System Identification Assistant\Examples\dc_motor and choose the dc_motor_test1.lvm file.

Page 2 of 13

LabVIEW System Identification Toolkit

Figure 3. Load/Save Signals Make sure that both Motor Input and Motor Output have a check next to them. This will add both signals to the project. We close that window and on the left side of the screen, you should now see the Load from LVM step. To see the stimulus and response signals, drag the stimulus signal (Motor input) over to the graph. To view the response signal select Add Display and drag the Motor Output to the second graph.

Page 3 of 13

LabVIEW System Identification Toolkit

Figure 4. Model Input and Model Output signals From this data, we will estimate the model of the motor. To do this we add a second step by selecting Add Step>System Identification>Model Estimation>Parametric Estimation. Make sure that the stimulus signal is Motor Input and the response signal is Motor Output. Choose the autoregressivemoving average with exogenous terms (ARMAX) Model type. For more information on the types of models, check the LabVIEW System Identification User Manual. On the other tabs you can choose the Model Order which affects the error in the system.

Page 4 of 13

LabVIEW System Identification Toolkit

Figure 5. System Identification Step

Page 5 of 13

LabVIEW System Identification Toolkit

Once we close the step setup, the Parametric Estimation will appear on the left side of the window. To view the calculated values we add another display. Then we Drag Sys ID model to the third display to see the coefficients that were calculated.

Figure 6. Signals with coefficients Once we have the coefficients we can either save them to a file or use them to design our control system. To do this, right click in the SysID model under Parametric Estimation. Model Estimation through the LabVIEW VIs The System Identification Toolkit also provides VIs that you can use to preprocess raw data from a dynamic system and develop a model that reflects the behavior of that system. These VIs enable you to customize a LabVIEW block diagram to achieve specific goals. You can also use other LabVIEW VIs and functions to enhance the functionality of the application. The first task is to provide the signals coming from the plant. For this example we will read the same LabVIEW Measurement file (dc_motor_test1.lvm) that we used before. To read it we place the Read from Measurement File Express VI from the Express Palette.

Page 6 of 13

LabVIEW System Identification Toolkit

Figure7. Read From Measurement File Express VI This VI will open a window to configure the Express VI. Here you need to browse to find the file to read. C:\Program Files\National Instruments\ExpressWorkbench\System Identification Assistant\Examples\dc_motor.

Page 7 of 13

LabVIEW System Identification Toolkit

Figure 8. Read from Measurement File Express VI Once you have the signals configured in the Express VI we will use another Express VI called SI Model Estimation under the System Identification palette. This Express VI will allow us to choose the model type, the dimensions, the order, and the type of data.

Page 8 of 13

LabVIEW System Identification Toolkit

Figure 9. SI Model Estimation Express VI Just as in the previous section, select ARMAX as the type of model.

Page 9 of 13

LabVIEW System Identification Toolkit

Figure 10. Configure Model Estimation Click Ok to accept the settings. The Express VI will generate the code in the background for generating the coefficients and obtaining the system model.

Figure 11. Acquire Data and Model Estimation Page 10 of 13

LabVIEW System Identification Toolkit

Now that we have the coefficients of our plant we can get the transfer function of the system using the system model output, so that it can be saved to a file or used by the LabVIEW Control Design Toolkit. Wire the system model out to SI Convert to Transfer Function of CDT VI. The output of this VI is the transfer function of the model which can be used in the NI LabVIEW Control Design Toolkit to aid in the design the control system for the model plant. In this example we will save the model transfer function into a file and we will display it in the LabVIEW Front Panel. The first thing we need to do is convert the transfer function into a Continuous-Time model by using the CD Convert Discrete to Continuous VI. Then we save the model to a file with the CD Write Model to a File. To display the transfer function equation we can use the CD Draw Transfer Function Equation VI.

Figure12. Draw and Save Transfer Function To check if the model is a close representation of our plant, we need to simulate and compare it to the original response from the motor. We simulate the model by using the SI Model Simulation VI and then we just compare both signals.

Page 11 of 13

LabVIEW System Identification Toolkit

Figure 13. Model Validation

Figure 14. Transfer Function and Model Validation

Conclusion

Page 12 of 13

LabVIEW System Identification Toolkit

This document shows how to use the LabVIEW System Identification Toolkit to estimate a model of a plant, using stimulus and response signals. The toolkit provides two ways of executing necessary algorithms. The first is through the System Identification Assistant that uses ExpressWorkbench as the interface, and does not require any LabVIEW programming knowledge. The second is by using the LabVIEW VIs to build customized code. References LabVIEW System Identification Toolkit User Manual LabVIEW System Identification Toolkit

Page 13 of 13

Você também pode gostar