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/TIEVM-HV-1PH-DCAC: Do you have sample code for SOGI-FLL?

Part Number: TIEVM-HV-1PH-DCAC
Other Parts Discussed in Thread: TIDM-1007, C2000WARE-DIGITALPOWER-SDK, C2000WARE

Tool/software: Code Composer Studio

Hello.
I'd like to experiment with SOGI-FLL. Do you have any sample code to refer to?

I found some good info on the link below.
http://e2e.ti.com/support/microcontrollers/c2000/f/171/t/679554?tisearch=e2e-sitesearch&keymatch=zero%20crossing

The current waveform is out of phase with the voltage waveform when the AC frequency is changed using SOGI-FLL.
The test code is shown below.

SPLL_1PH_SOGI_FLL_reset (& spll1);
SPLL_1PH_SOGI_FLL_config (& spll1, OUT_FREQ, PWM_FREQ, (float32) 166.9743385, (float32) -166.2661165, (float32) 0.5, (float32) 20000);
SPLL_1PH_SOGI_FLL_coeff_calc (& spll1);
spll1.k = 0.5;
spll1.gamma = 20000;

In the interrupt routine
SPLL_1PH_SOGI_FLL_run (& spll1, ADC_VLINE_VOLT);
invSine = spll1.sine;

Thank you.