//-------------------------------------------------------// // Project Code : CodeLibrary // File Name : HarRes.h // Created on : 2022. 11. 5. // Description : 고조파 제어기 // Author : KimJeongWoo // Last modified Date : //-------------------------------------------------------// #ifndef DIGITALCTRL_HARRES_H_ #define DIGITALCTRL_HARRES_H_ #ifdef __cplusplus extern "C" { #endif //Resonant Control(SNU) struct sLeadCompensator { float WTcomp, SinComp, CosComp, ZT, PT, Kc; float k1, k2, k3; float inPrev, outPrev; float out; float Run(float in); }; struct sIinvHarRes { float Rc; float Wcc, Kr; float Cr1, Cr2, Cr3, Wr; float WeRate; float Kr1, Kr2; float Idr, Idr1, Idr2, Iqr, Iqr1, Iqr2; float Vdr1, Vdr2, Vqr1, Vqr2; float VdssRef, VqssRef; float VdssLead; float VqssLead; float delay, order; float Tsamp; float ThetaRes; void Init(float mRc, float mOrder, float mWcc, float mWeRate, float mTsamp); void UpdateGain(float mWe_hat); void Run(float mIds, float mIqs); void Reset(); struct sLeadCompensator LeadCompd; struct sLeadCompensator LeadCompq; void LeadCompUpdateGain(); }; #ifdef __cplusplus } #endif /* extern "C" */ #endif /* COMMON_RESOURCE_CODELIBRARY_HARRES_HARRES_H_ */