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.

TMS320F2800137: SFRA - Sweeping is not moving, also SFRA state is not moving

Part Number: TMS320F2800137
Other Parts Discussed in Thread: SFRA, C2000WARE

Hi,

I'm working with the following user guide - https://www.ti.com/lit/ug/spruik4a/spruik4a.pdf?ts=1695800874493&ref_url=https%253A%252F%252Fwww.ti.com%252Ftool%252FSFRA

I sucssufully connect SFRA GUI to board, and when press Start Sweep button the SFRA stuck on the following mode:


meanwhile the D.C. injection do take action and I can see (with Scope) that PWM is changing.

Its look like state doesn't progress.

I Do use the following Background function:

SFRA_F32_runBackgroundTask(&sfra1);

SFRA_GUI_runSerialHostComms(&sfra1); 

But I cant even debug that to see why state doesn't go on.

Appreciate your help.

  • Hi Michael,

    I am observing that SFRA sweep is happening, and data is getting collected. May I know the frequency at which SFRA ISR frequency is configured and background, serial host comms function frequency?

    Thanks & Regards,

    Shashank

  • Hi Shashank,
    Yes you right, sweep is happening (I observe changes on duty cycle - occur by injection of sweep)
    The frequency of both SFRA ISR (injection and collect) and serial host comms functions is 400 Hz, every 2.5mSec both function running.

    Thanks,
    Michael

  • Michael,

    Can you call  runBackgroundTask,  SerialHostComms in slow task with 100Hz.

    SFRA inject and collect at high frequency (at 400Hz)

    Are you facing the same issue with example provided for SFRA library in DPSDK(C2000Ware_DigitalPower_SDK_xxx/libraries/sfra/examples)?

    Thanks,

    Shashank

  • Hi,

    ok it help, sweeping process is taking about 1-2 minutes (set speed = 10) and afterward I received the plots, now I'm facing with another problem:
    Plots looking like this (Which I think is good result):


    But as you can see, I defined start freq. = 500Hz and the freqVect is remain on 2Hz, and the vector ended at 39.4kHz while GUI said 500kHz:

    Compensation designer GUI using the .csv file the SFRA_GUI create said that 'unstable loop' and give me Kp and Ki which is 1000 larger than calculated values:

    Please advise.

  • Regarding frequency, I changed freqVect via  SFRA_F32_initFreqArrayWithLogSteps(&sfra1,
    SFRA_FREQ_START,
    SFRA_FREQ_STEP_MULTIPLY);

    SFRA_FREQ_START = 500.

    Still having second problem of KP KI variables


  • Hi, another update:
    I changed KDC = 1 and put the zero location frequency at 100Hz (this point the plant plot start to decrease -20db/decade)
    And  I got the following

     

    Now I took the PI parameters and put it on my BUCK controller, changed inject and collect section accodring to manuel,

    Run SFRA again and received same result (down is close loop SFRA result, extended frequency range, because of Nyquist criterion 50kHz and upper is milted by the nyquist criterion)

    What does it mean the stable loop line? 

    How can I proceed? I want to fine tuning PI parameters even more.

    Thanks!

  • Hi Michael,

    Let me know my understanding is correct?

    So, you changed KDC =1 and took PI parameters of stable loop. Substituted those parameters in coefficients of digital compensator of the code - ran SFRA again and achieved stable closed loop with desired phase margin and gain margin. Yes, you can proceed with this stable loop.

    Yes, you can tune even further by changing KDC, fz0, fp0.

    Thanks,

    Shashank

  • Hi Michael,

    SFRA start frequency should be changed in "SFRA_F32_config" function and based on frequency step multiply/number of frequency points, whole SFRA Frequency vector is created.

    Thanks,

    Shashank

  • Substituted those parameters in coefficients of digital compensator of the code - ran SFRA again and achieved stable closed loop with desired phase margin and gain margin

    Hi,

    How do I know that I achieved the desired phase and gain margin?
    On close loop I received the same graph as the open loop. 

    Another question, according to what I set fz0 and KDC? I want that gain margin will be 20dB and phase margin of 80 Degrees therfore I 'play' with fz0 value.
    I extract the following KP KI and put on PI controller on c2000, and ran SFRA again (attaching SFRA of open loop buck).



    And I got the following bode plot of close loop with KP and KI according to previous SFRA:

    There is a bit difference of phase and gain margin. does it ok?

    Thanks!
    Michael

  • Hi Michael,

    You will know the actual phase margin and gain margin by using SFRA GUI.exe after substituting coefficients, so that open loop boded plot will measure gain cross over frequency, phase and gain margin. This difference is acceptable and due to Folg_cf variation which from boded plot should be same for both but differed.

    Thanks,

    Shashank

  • Hi Shashank,

    I run SFRA sweep twice with different KP and KI and received the same bode plot GM and PM:
    For the first bode plot I extract from open loop bode the following (KP= 0.2999623; KI= 0.0002514) - should give me  GM=23.45dB PM=99Degree

    but when running SFRA on close loop I received the following graph (GM = 14.61 PM = 82.85):

    I ran SFRA again with much different KP = 0.0999  KI =0.00025 to receive GM=33 and PM=131.15 (SFRA from open loop ):

    Ran SFRA Close loop again and received (GM = 14.85 PM = 84.06):

    Why this happened? The GM PM values haven't change during KP KI changes.

    Thanks!
    Michael

  • Michael,

    The difference between two boded plots also depend on bias point at which plant is running. You may observe differences between boded plots of plants at both times due to bias points (Voltage and current input provided with operating frequency) and also switching noises. So, Above is acceptable range but we should not see any differences in Gain and phase margin if plant boded plot matches exactly.

    Thanks,

    Shashank

  • Shashank, thanks for your fast response


    So when changing plant plot (running open loop in different voltage and current input) I'll be able to see differences on GM PM?
    For example, the above open loop plant plots are on specific Vout = 1V , if I'll ran SFRA for Vout = 2V I'll able to change GM PM values more accurately? 

    Can you define me it as a process? Which steps to do for tuning PM GM to specific values. It will be the best way to understand.

    Thanks a lot!

    Michael

  • Michael,

    Yes- as plant plot changes, there will be impact on GM, PM. 

    SFRA can be run at typical bias point and design a compensator based on desired GM, PM by changing KDC and Fzo with control ISR frequency.

    There will not be significant change in stability parameters from light load to typical load. 

    So best way is to design compensator at typical bias point (as major run time will be at this point) and use the same compensator at different loads (50% of typical load etc.), observe the impact on GM,PM.

    Thanks,

    Shashank

  • Hi Shashank,

    I Ran SFRA AC sweep in open loop for Boost on D.C. (load) of 15-20% (sweeping) 
    I received the follow open loop bode plot and planed compensator targeting GM=29.55 PM=78.97

    therefore I took Kp and Ki and implement it on my Boost PI controller
    Ran SFRA while Sweep was again around 20% and received the follow bode plot


    As you can see, on SFRA GUI I got almost the required value, but on comp. designer I see different numbers..
    Should I pick "Proportional Gain" plot to see close loop SFRA response? should Kp be 1 ? or should I place Boost Kp instead? or something else?

    Again, Thanks a lot!

  • Michael,

    SFRA GUI is the tool you need to proceed with as it is sweeping plant and open loop plots from hardware itself and digital controller specific to device. 

    As per my understanding you are achieving desired Gain and Phase margin with SFRA Tool measurements. So, Thats great. Let me know, if you have any further questions.

    Thanks,

    Shashank