SPRUIK4A September   2018  – June 2019 TMS320F280021 , TMS320F280021-Q1 , TMS320F280023 , TMS320F280023-Q1 , TMS320F280023C , TMS320F280025 , TMS320F280025-Q1 , TMS320F280025C , TMS320F280025C-Q1 , TMS320F280040-Q1 , TMS320F280040C-Q1 , TMS320F280041 , TMS320F280041-Q1 , TMS320F280041C , TMS320F280041C-Q1 , TMS320F280045 , TMS320F280048-Q1 , TMS320F280048C-Q1 , TMS320F280049 , TMS320F280049-Q1 , TMS320F280049C , TMS320F280049C-Q1 , TMS320F28075 , TMS320F28075-Q1 , TMS320F28076 , TMS320F28374D , TMS320F28374S , TMS320F28375D , TMS320F28375S , TMS320F28375S-Q1 , TMS320F28376D , TMS320F28376S , TMS320F28377D , TMS320F28377D-Q1 , TMS320F28377S , TMS320F28377S-Q1 , TMS320F28378D , TMS320F28378S , TMS320F28379D , TMS320F28379D-Q1 , TMS320F28379S

 

  1.   C2000 Software Frequency Response Analyzer (SFRA) Library and Compensation Designer in SDK Framework
    1.     Trademarks
    2. 1 Introduction
    3. 2 Installing the SFRA Library
      1. 2.1 SFRA Library Package Contents
      2. 2.2 How to Install the SFRA Library
    4. 3 Module Summary
      1. 3.1 SFRA Library Function Summary
      2. 3.2 Principle of Operation
      3. 3.3 Per Unit Format
      4. 3.4 Floating Point (Singe Precision)
        1. 3.4.1 Object Definition
        2. 3.4.2 Module Interface Definition
        3. 3.4.3 Adding SFRA Library to the Project
        4. 3.4.4 Adding Support for SFRA GUI
      5. 3.5 Script for Importing Frequency Response and Designing Compensation
      6. 3.6 SFRA GUI Options and How to Run
    5. 4 Compensation Designer
      1. 4.1 Launching Compensation Designer
        1. 4.1.1 Standalone From SFRA GUI Folder
        2. 4.1.2 From Solution Adapter Page
      2. 4.2 Compensation Style and Number
    6. 5 Case Study
      1. 5.1 Plant TF Extraction
      2. 5.2 Designing Compensator Using Compensation Designer
      3. 5.3 OL Measurement
      4. 5.4 Comparing SFRA Measured Frequency Response Versus Modeled
    7. 6 Running Software Test Bench Example for SFRA
    8. 7 Using SFRA Without SFRA GUI Integration
    9. 8 FAQ
  2.   Revision History

Using SFRA Without SFRA GUI Integration

Do these steps to integrate the SFRA in the project:

  1. Because of resource limitations, some of the applications may not have an SCI port free that is needed by the SFRA GUI.
  2. In that case, omit the steps for the SFRA GUI integration in Section 3.4.4.
  3. Integrate the Inject, Collect and background functions as described in Section 3.4.3.
  4. To start an SFRA sweep, put the SFRA object in the watch window.
  5. Write SFRA_OBJ.start to 1, when you want the SFRA sweep to start. (This is the alternative to clicking start sweep on the SFRA GUI.)
  6. Monitor the SFRA_OBJ.FreqIndex variable; it will gradually increment as SFRA sweep is performed.
  7. Once the SFRA_OBJ.FreqIndex reaches Vec_Length, the SFRA sweep is complete.
  8. As part of the SFRA initialization, as pointed out in Section 3.4.3, the Open Loop and Plant Magnitude and phase are stored in arrays called.
  9. //------- SFRA Related Variables -------- float plantMagVect[SFRA_FREQ_LENGTH]; float plantPhaseVect[SFRA_FREQ_LENGTH]; float olMagVect[SFRA_FREQ_LENGTH]; float olPhaseVect[SFRA_FREQ_LENGTH]; float freqVect[SFRA_FREQ_LENGTH];
  10. Put these in the watch window to inspect and study the response.
  11. Once the sweep is complete, click on View-> MemoryBrowser inside CCS.
  12. Inside Memory Browser, enter &freqVect to see the frequency vector and select 32-bit floating point,
  13. MemoryBrowser_2.jpgFigure 23. Memory Browser View of Stored SFRA Vectors
  14. Click on save memory, shown encircled in Figure 23.
  15. A popup will appear. Select TI data and specify the file name *.dat in the location you prefer.
  16. SaveMemoryPopUp.jpgFigure 24. Save Memory Pop-Up Window
  17. Click on Next and specify the address from the memory browser for the start of the array and then the length.
  18. Make sure 32-bit floating point is selected. Click Finish.
  19. SaveMemoryWindow.jpgFigure 25. Save Memory Options
  20. This will save the data in *.dat file.
  21. Repeat this step for plantMagVect, plantPhaseVect, olMagVect, olPhaseVect, so you will have 5 *.dat files.
  22. If you want to use this data in MATLAB or other tools, the data can be populated to an excel file.
  23. Open the FRAData.xlsx file located at <install directory>\sfra\scripts in excel.
  24. You can choose to re-name and save the file.
  25. This excel sheet has four columns, in the first column is the frequency data.
  26. Open the *dat file that was saved.
  27. Data.jpgFigure 26. Selecting Data From .dat File to Put in the Excel
  28. Select the data from the second line onwards to the end of the file and do Ctrl+C to copy the data.
  29. Open the Excel File, go to the first element under the corresponding vector and do Ctrl+V to copy the array.
  30. Data_excel.jpgFigure 27. SFRA Data Copied in Excel File
  31. Repeat the steps for each column.
  32. Once the excel file is updated for all five columns, use the matlab script to import the FRA data. Then, use it inside sisotool to design compensator and carry out stability analysis.
  33. The file an also be downloaded as a *.csv file and used with the compensation designer tool.