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

Plant TF Extraction

If the plant model is not known the plant model can be identified by running the SFRA in open loop. For this, first a DC operating point is chosen. For example, in a buck converter a fixed duty cycle is provided to the converter. The SFRA_INJECT function is used to add small signal injection to the duty value. Which is then provided to the PWM driver. The SFRA_COLLECT function is used to analyze data from the excitation and calculate the plant transfer function, for example, (y/u) which, in case of a voltage controlled power supply, will be Vout/Duty. Figure 10 illustrates the software diagram for the SFRA inclusion.

SW_diag_tf_extractn_spruhz5.gifFigure 10. Software Diagram for Plant tf Extraction

Observe the PWM ISR code. Here, the SFRA_INJECT routine is called to add a sinusoidal injection on the DC operating point "Duty_pu_DC" to generate the duty cycle "Duty_pu" for the PWM module. Later in the code, the feedback is used to collect the response for the sinusoidal injection.

interrupt void PWM_ISR(void) { …. // // Read ADC and computer Fbk Value // Vout1_Read = (float32)Vout1R/(4096.0); // // Add SFRA injection into the duty cycle for the open loop converter // Duty_pu=SFRA_F32_inject(Duty_pu_DC); // // Update PWM value // EPwm1Regs.CMPA.half.CMPA=((long)(BUCK_PWM_PERIOD))* Duty_pu; SFRA_F32_collect(&Duty_pu,&Vout1_Read); ….. }

Once the DC point is established, that is the converter is running and outputting the desired duty cycle. The SFRA GUI can be used to initiate a SFRA sweep. Open the SFRA GUI.exe located in the GUI folder of SFRA install.

For instruction on how to connect and what each panel on the SFRA GUI box means, see Section 3.6. Click Setup Connection and set the baud rate to be 57600 on the pop up window. Uncheck boot on connect and select the appropriate COM port. For procedures to find out which COM port to select, see Section 3.6. Click OK to close the pop-up window and return to the main screen.

On Main Window, click Connect. Once connected the GUI will parse the current settings for the FRA sweep from the controller, these include the Start Frequency of the sweep, the length of the frequency sweep array (this is fixed in the code and hence cannot be changed through the GUI), injection amplitude and steps per decade. Leave these as default for now.

Press the Start Sweep button.Wait for the status bar in the GUI to change to Sweep Complete.The results of the SFRA sweep are now displayed on the window. The open loop graph result has no meaning as the plant is not in in closed loop operation. Therefore, select Plant in the drop down menu to the left. Once Plant is selected in the drop down menu, the GUI will look similar to Figure 11.

plant_frequ_resp_plot_spruhz5.gifFigure 11. Plant Frequency Response Plot

Drag your mouse across either of the graphs to locate the values at specific frequencies used in the Frequency Response Analysis. A SFRAData.csv file inside the GUI folder is updated with the latest run of the SFRA library. All runs of the SFRA library and time stamps are saved under that folder. If the checkbox “Save SFRA Data as CSV” is unchecked, the excel sheet will pop up after each sweep with the data of the frequency response. Each subsequent sweep is added as a new page on the excel sheet.

    NOTE

    The change to the checkbox will only affect the save of the next run of the SFRA. The selection must be done before hitting “Start Sweep”.

The frequency response measured can then be used to design the compensation by importing the frequency data is MATLAB. The Scripts were described in Section 3.5.