AM263x Motor Control SDK  09.02.00
Software frequency response analyzer Test

This example demonstrates usage of SFRA library. PI controller is designed for plant of constant value for testing the functionality of SFRA. When "sfra1.start" variable provided with value "1" at run time will initiate the SFRA functionality for configured frequency vectors and calculates plant /open loop/ closed loop magnitude and phase vectors. These data points can be exported and used for boded plots generation.

Files and directory structure

Folder/Files Description
sfra_main.c Main function for SFRA Library testing
sfra_main.h Main function for defining control loop functionality with SFRA
sfra_examples_hal.c and sfra_examples_hal.h files for setting up interrupt and gpio profiling
sfra_examples_settings.h User configurable SFRA defines
sfra_f32.h SFRA library related header file
dcl/ Folder with DCL library related files
sfra.syscfg EPWM Configuration as per testing requirement

Supported Combinations

Parameter Value
CPU + OS r5fss0-0 nortos
r5fss0-0 freertos
Toolchain ti-arm-clang
Boards am263x-cc
Example folder examples/sfra

Steps to Run the Example

  • When using CCS projects to build, import the CCS project for the required combination and build it using the CCS project menu (see Using SDK with CCS Projects ).
  • When using makefiles to build, note the required combination and build using make command (see Using SDK with Makefiles ).
  • Launch a CCS debug session and run the executable, see CCS Launch, Load and Run
  • Halt R5F core. Open "Expressions" window and add "sfra1.start" global variable. Set the value of "sfra1.start" to "1".

Sample Output

Shown below is a sample output when the application is run:

Magnitude and phase vector data values after SFRA initiated by providing "1" to sfra1.start is shown in figure.

Data values of calculated magnitude and phase vector in expression window

You should see following message after the processing is done for 100 samples, which takes around two minutes.

Test passed