//-------------------------------------------------------// // Project Code : V2H6K01-23-ENEMAN // File Name : Pll.cpp // Created on : 2023. 08. 08. // Description : // Author : KimJeongWoo // Last modified Date : //-------------------------------------------------------// #include "Cpu1DeviceDefine.h" float CosThetaComp = 0.; float SinThetaComp = 0.; float ErrTheta = 0.; float Theta = 0., ThetaComp = 0.; float SinTheta = 0., CosTheta = 1.; float FreqOut = 0.; float FreqOutFlt = 0.; struct sSogiFll1ph SogiFll1ph; void InitPll(void) { // memset(&SogiFll1ph, 0, sizeof(SogiFll1ph) / sizeof(int)); // SogiFll1ph.Init(FreqRate, Tsamp, VacPeakMax, &VacGrid, &IacInv); } void PllReset(void) { // SogiFll1ph.Init(FreqRate, Tsamp, VacPeakMax, &VacGrid, &IacInv); } void PllRun(void) { // SogiFll1ph.Run(); // // Theta = SogiFll1ph.Theta; // WeHat = SogiFll1ph.WeHat; // FreqOut = SogiFll1ph.FreqOut; // // SinTheta = SogiFll1ph.SinTheta; // CosTheta = SogiFll1ph.CosTheta; // // VdsGrid = VacGrid; // VqsGrid = SogiFll1ph.Vs_Osg_Qu[0]; // // VdeGrid = CosTheta * VdsGrid + SinTheta * VqsGrid; // VqeGrid = -SinTheta * VdsGrid + CosTheta * VqsGrid; // // VdsInv = VacInv; // VqsInv = SogiFll1ph.Vs_Osg_Qu[0]; // // VdeInv = CosTheta * VdsInv + SinTheta * VqsInv; // VqeInv = -SinTheta * VdsInv + CosTheta * VqsInv; // // IdsInv = IacInv; // IqsInv = SogiFll1ph.Is_Osg_Qu[0]; // // IdeInv = CosTheta * IdsInv + SinTheta * IqsInv; // IqeInv = -SinTheta * IdsInv + CosTheta * IqsInv; // // IdsGrid = IacGrid; // IqsGrid = SogiFll1ph.Is_Osg_Qu[0]; // // IdeGrid = CosTheta * IdsGrid + SinTheta * IqsGrid; // IqeGrid = -SinTheta * IdsGrid + CosTheta * IqsGrid; }