This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS/TMS320F28035: SFRA library useage

Part Number: TMS320F28035
Other Parts Discussed in Thread: SFRA,

Tool/software: Code Composer Studio

hello sir/madam,

i want to SFRA library to measure the H transfer function and GH transfer function based on TMS320F28035 in my project.

our current power topology is a half-bridge LLC, i have questions on the principle how to inject the signals.

1. in order to get the plant bode diagram, how to set the SFPA_Freq_LLC at first?

   a, assign SFPA_Freq_LLC with highest frequency? lowest frequency? or  a fixed frequency point??

   b, because of we have a soft-start process when start for LLC driver, does it have any affect on SFRA?

  Iout_Read= (int32)AdcMirror.ADCRESULT0<<12;

  G_32PWMPeriod_A = SFRA_IQ_INJECT(SFPA_Freq_LLC);

  EPwm1Regs.TBPRDM.all = EPwm2Regs.TBPRDM.all =  G_32PWMPeriod_A

  SFRA_IQ_COLLECT(&G_32PWMPeriod_A ,&Iout_Read);

2.  in order to get the open loop bode diagram,

i find in the guide document and example, the AD value is used as feedback, but not the physical value. why?

(in my opinion, ref always a physical value have to compare with a another physical value to get the error)

are there any requirements on the data format on the arguments for SFRA_IQ_INJECT and SFRA_IQ_COLLECT? i plan to implemented SFRA on the fixed-point MCU。

exmaple in the guide document:

//Read ADC and computer Fbk Value
cntl3p3z_vars1.Fdbk= (int32)Vout1R<<12;
//Add FRA injection into the reference of the controller
cntl3p3z_vars1.Ref= SFRA_IQ_INJECT(Vout1SetSlewed);
// Call the controller
CNTL_3P3Z_IQ_ASM(&cntl3p3z_coeff1,&cntl3p3z_vars1);
//Update PWM value
EPwm1Regs.CMPA.half.CMPA=_IQ24mpy((long)(BUCK_PWM_PERIOD),cntl3p3z_vars1.Out);
SFRA_IQ_COLLECT(&cntl3p3z_vars1.Out,&cntl3p3z_vars1.Fdbk);

finally, there seems a few quick start document on this excellent tool, how i get deep in this topic? thank you very much.

  • 1.

     "

    G_32PWMPeriod_A = SFRA_IQ_INJECT(SFPA_Freq_LLC);

      in order to get the plant bode diagram, how to set the SFPA_Freq_LLC at first?

      a, assign SFPA_Freq_LLC with highest frequency? lowest frequency? or  a fixed frequency point??

     b, because of we have a soft-start process when start for LLC driver, does it have any affect on SFRA?

    "

    a. SFPA_Freq_LLC is the frequency that your LLC control loop will command, the output after the SFRA_INJECT will also be a frequency variable .. please make sure the units etc match.

    If it is in the open loop, the SFRA does not limit what this value needs to be, it does not matter what you set this frequency as.. SFRA can only be performed once the frequency has settled at a steady state value i.e. startup etc are passed..  

    b. SFRA is performed after startup is passed, so that should not affect SFRA at all

    2. 

     

    2.  in order to get the open loop bode diagram,

    i find in the guide document and example, the AD value is used as feedback, but not the physical value. why?

    (in my opinion, ref always a physical value have to compare with a another physical value to get the error)

    are there any requirements on the data format on the arguments for SFRA_IQ_INJECT and SFRA_IQ_COLLECT? i plan to implemented SFRA on the fixed-point MCU。

    exmaple in the guide document:

    //Read ADC and computer Fbk Value
    cntl3p3z_vars1.Fdbk= (int32)Vout1R<<12;
    //Add FRA injection into the reference of the controller
    cntl3p3z_vars1.Ref= SFRA_IQ_INJECT(Vout1SetSlewed);
    // Call the controller
    CNTL_3P3Z_IQ_ASM(&cntl3p3z_coeff1,&cntl3p3z_vars1);
    //Update PWM value
    EPwm1Regs.CMPA.half.CMPA=_IQ24mpy((long)(BUCK_PWM_PERIOD),cntl3p3z_vars1.Out);
    SFRA_IQ_COLLECT(&cntl3p3z_vars1.Out,&cntl3p3z_vars1.Fdbk);

    Well, we always follow a Per Unit (PU) based method to design the software, it is actually better to do it this way for example if you want to design a converter for a different power rating etc, everything will work very well if you have PU. Specially in fixed point controllers which is the case for you. Yes we use IQ24 for everything from a variables perspective when interfacing with the SFRA library. Please refer to SFRA Lib user guide for details. 

    finally, there seems a few quick start document on this excellent tool, how i get deep in this topic? thank you very much.

    can you be specific on "get deep in this topic", a specific question gets an appropriate answer 

  • hello sir,

    i use the software frequency response analyzer gui and communication to my board to get the plant bode.
    it is said connected in the left corner of the interface. and then i choose the plant mode and click "start sweep".
    everything in the gui turn to gray, and keep no change after a long time.

    my question is
    1. is there any indications for the process? how to identify the problem, as i already porting the sfra lib to my poject?

    2. what's the rule for set SFRA1.amplitude? i now set as 0.01 as the example.


    i have below code in my 100K ISR.

    _iq SFRA_i32Iref, SFRA_i32Fdbk;
    _iq21 SFRA_OutFreq ;


    SFRA_i32Fdbk = (int32)AdcMirror.ADCRESULT0<<12;

    SFRA_i32Iref = SFRA_IQ_INJECT(SFRA_i32IoutSetSlewed); //SFRA_i32IoutSetSlewed = 0.5 for the output frequency

    SFRA_i32Iref = _IQsat(SFRA_i32Iref,_IQ24(1.0),_IQ24(0.3149));

    SFRA_OutFreq = _IQ21mpyI32(_IQtoIQ21(SFRA_i32Iref), 705);

    G_32PWMPeriod_A = (_IQ21toF(SFRA_OutFreq)*65536);

    EPwm1Regs.TBPRDM.all = G_32PWMPeriod_A;

    SFRA_IQ_COLLECT(&SFRA_i32Iref,&SFRA_i32Fdbk);
  • typically 0.01 means 1% injection, Choice of injection amplitude is subjective. But typically 1%-0.5% yield good results.

    for the GUI, you may want to put the SFRA strcuture in the expression view, and monitor FreqIndex , is that changing?

    That will be a tell tell sign... if FreqIndex is not changing then it means either the inject, or the collect or the backrground routines are not being called.. you may have to debug your code and make sure they are being called...