sys id toolkit

Upload: davidleonardo-galindo

Post on 03-Apr-2018

219 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/29/2019 Sys Id Toolkit

    1/13

    LabVIEW System Identification Toolkit

    By Ricardo Santa Olalla

    Introduction

    In the System Control Design the most important consideration is a well defined modelfor 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 plantand 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 showsa 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-inputsingle-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 VIsConclusion

    References

    Model Estimation through the System Identification Assistant

  • 7/29/2019 Sys Id Toolkit

    2/13

    LabVIEW System Identification Toolkit

    Page 2 of 13

    Without prior knowledge of programming in LabVIEW, you can use the SystemIdentification 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 thisexample 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_motorand choose the dc_motor_test1.lvm file.

  • 7/29/2019 Sys Id Toolkit

    3/13

    LabVIEW System Identification Toolkit

    Page 3 of 13

    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 anddrag the Motor Output to the second graph.

  • 7/29/2019 Sys Id Toolkit

    4/13

    LabVIEW System Identification Toolkit

    Page 4 of 13

    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 stepby 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 whichaffects the error in the system.

  • 7/29/2019 Sys Id Toolkit

    5/13

    LabVIEW System Identification Toolkit

    Page 5 of 13

    Figure 5. System Identification Step

  • 7/29/2019 Sys Id Toolkit

    6/13

    LabVIEW System Identification Toolkit

    Page 6 of 13

    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 rawdata 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 achievespecific 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 willread 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.

  • 7/29/2019 Sys Id Toolkit

    7/13

    LabVIEW System Identification Toolkit

    Page 7 of 13

    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.

  • 7/29/2019 Sys Id Toolkit

    8/13

    LabVIEW System Identification Toolkit

    Page 8 of 13

    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.

  • 7/29/2019 Sys Id Toolkit

    9/13

    LabVIEW System Identification Toolkit

    Page 9 of 13

    Figure 9. SI Model Estimation Express VI

    Just as in the previous section, select ARMAX as the type of model.

  • 7/29/2019 Sys Id Toolkit

    10/13

    LabVIEW System Identification Toolkit

    Page 10 of 13

    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

  • 7/29/2019 Sys Id Toolkit

    11/13

    LabVIEW System Identification Toolkit

    Page 11 of 13

    Now that we have the coefficients of our plant we can get the transfer function of thesystem 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 ofthis 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 ContinuousVI. 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 FunctionEquation VI.

    Figure12. Draw and Save Transfer Function

    To check if the model is a close representation of our plant, we need to simulate andcompare it to the original response from the motor. We simulate the model by using the

    SI Model Simulation VIand then we just compare both signals.

  • 7/29/2019 Sys Id Toolkit

    12/13

    LabVIEW System Identification Toolkit

    Page 12 of 13

    Figure 13. Model Validation

    Figure 14. Transfer Function and Model Validation

    Conclusion

  • 7/29/2019 Sys Id Toolkit

    13/13

    LabVIEW System Identification Toolkit

    Page 13 of 13

    This document shows how to use the LabVIEW System Identification Toolkit to estimatea 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 customizedcode.

    References

    LabVIEW System Identification Toolkit User Manual

    LabVIEW System Identification Toolkit