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

Adding Support for SFRA GUI

A few modifications to the Code Composer Studio ™ project are required to add support for the SFRA GUI.

  1. Add "sfra_gui_scicomms_driverlib.c" to the project. This can be done in the project window, by right-click on your project and selecting “Add files to project”, then browse to the file under <sfra-install-path>/gui/source.
  2. Add "sfra_gui_scicomms_driverlib.h" to the include path for the project. The file is located at <sfra-install-path>/gui/include.
  3. Call the SFRA_GUI_config function. The GUI can toggle an LED when connected, if this feature is used additional configuration parameters must be passed to the GUI config routine, otherwise pass zero in those parameters. Typical defines used on F28004x control card are shown below. Change them if your hardware requires any changes. Currently the SFRA GUI supports plotting of two vectors, passing a '1' for the plot options defualts the plant and open loop vectors. '2' plots the closed loop and the plant transfer function.
  4. #define SFRA_GUI_SCI_BASE SCIA_BASE #define SFRA_GUI_VBUS_CLK 50000000 #define SFRA_GUI_SCI_BAUDRATE 57600 #define SFRA_GUI_SCIRX_GPIO 28 #define SFRA_GUI_SCITX_GPIO 29 #define SFRA_GUI_SCIRX_GPIO_PIN_CONFIG GPIO_28_SCIRXDA #define SFRA_GUI_SCITX_GPIO_PIN_CONFIG GPIO_29_SCITXDA // // if the following #define is set to 1 SFRA GUI indicates status on an LED // otherwise LED code is ignored // #define SFRA_GUI_LED_INDICATOR 1 #define SFRA_GUI_LED_GPIO 31 #define SFRA_GUI_LED_GPIO_PIN_CONFIG GPIO_31_GPIO31 ..... // // configures the SCI channel for communication with SFRA host GUI // to change SCI channel change #define in the sfra_gui_scicomms_driverlib.c // the GUI also changes a LED status, this can also be changed with #define // in the file pointed to above // SFRA_GUI_config(SFRA_GUI_SCI_BASE, SCI_VBUS_CLK, SFRA_GUI_SCI_BAUDRATE, SFRA_GUI_SCIRX_GPIO, SFRA_GUI_SCIRX_GPIO_PIN_CONFIG, SFRA_GUI_SCITX_GPIO, SFRA_GUI_SCITX_GPIO_PIN_CONFIG, SFRA_GUI_LED_INDICATOR, SFRA_GUI_LED_GPIO,\ SFRA_GUI_LED_GPIO_PIN_CONFIG, amp;sfra1, 1);
  5. SFRA_GUI_SCI_BASE : this is the base for the SCI that is used for SFRA communication.
  6. SFRA_GUI_SCIRX/TX_GPIO: GPIO pin that are used for the SCI peripheral. These are defined currectly for example on controlCARDS where the FTDI chip is connected for the serial link and it uses GPIO-28 and GPIO-29.
  7. The GUI is setup such that it will blink an LED when GUI has established connection with the host. This LED can be specified in SFRA_GUI_LED_GPIO. Also make sure to change SFRA_GUI_LED_GPIO_PIN_CONFIG appropriately.
  8. Also make sure that the SCI clock is enabled. Clock configuration is typically handled in setupDevice()->Device_init() functions. For powerSUITE solutions, these are in the board.c file.
  9. In a slower task with a service rate of ~ 10 ms, call the following routine to keep the SFRA GUI connection alive. This can typically be kept close to the SFRA Backrground function.
  10. SFRA_GUI_runSerialHostComms(&sfra1);
  11. The project will now connect to the SFRA GUI. For more information on how to run the SFRA GUI, see Section 3.6.