主题中讨论的其他器件:SFRA
我不确定我的 SFRA 是否正确配置。 我将其用于光伏逆变器、基于 TMDSSOLAR (P/C) EXPKIT。 我想在开环中对 SFRA 进行导通、以便对电流环路控制器进行调优。 我的输出电压波没有 干扰。 尽管在我打开 SFRA 之后,它看起来不像稳定的系统。
输出电压:

我的 SFRA 输出为:

当 I SFRA 从其他项目输出时、线比我的项目更平坦、这只是开环。
我遵循用户指南中的实施方案、并检查其他设计中的示例项目和实施方案。
我的实施:
void A1(void) // Dash Board Measurements
//--------------------------------------------------------
{
SFRA_F32_runBackgroundTask(&sfra1);
SFRA_GUI_runSerialHostComms(&sfra1);
//-------------------
//the next time CpuTimer0 'counter' reaches Period value go to A2
A_Task_Ptr = &A2;
//-------------------
}
(...)
interrupt void inverterISR(void)
{
invDutyPU = SFRA_F32_inject(invSine * invModIndex);
invDuty= ((float32_t)(INV_PWM_PERIOD)) * (fabsf(duty));
if(duty>=0)
{
EPWM_setCounterCompareValue(base1,EPWM_COUNTER_COMPARE_A,0);
EPWM_setCounterCompareValue(base2,EPWM_COUNTER_COMPARE_A,invDuty);
}
else
{
EPWM_setCounterCompareValue(base1,EPWM_COUNTER_COMPARE_A,invDuty);
EPWM_setCounterCompareValue(base2,EPWM_COUNTER_COMPARE_A,0);
}
SFRA_F32_collect(&invDutyPU,&inv_meas_cur_diff_inst);
}
void setupSFRA(void)
{
//
//Resets the internal data of sfra module to zero
//
SFRA_F32_reset(&sfra1);
//
//Configures the SFRA module
//
SFRA_F32_config(&sfra1,
INV_PWM_SWITCHING_FREQUENCY,
SFRA_AMPLITUDE,
SFRA_FREQ_LENGTH,
SFRA_FREQ_START,
SFRA_FREQ_STEP_MULTIPLY,
plantMagVect,
plantPhaseVect,
olMagVect,
olPhaseVect,
clMagVect,
clPhaseVect,
freqVect,
1);
//
//Resets the response arrays to all zeroes
//
SFRA_F32_resetFreqRespArray(&sfra1);
//
// Initializes the frequency response array ,
// The first element is SFRA_FREQ_START
// The subsequent elements are freqVect[n-1]*SFRA_FREQ_STEP_MULTIPLY
// This enables placing a fixed number of frequency points
// between a decade of frequency.
// The below routine can be substituted by a routine that sets
// the frequency points arbitrarily as needed.
//
SFRA_F32_initFreqArrayWithLogSteps(&sfra1,
SFRA_FREQ_START,
SFRA_FREQ_STEP_MULTIPLY);
//
// configures the SCI channel for communication with SFRA host GUI
// to change SCI channel change #define in the sfra_gui_scicomms_driverlib.c
// the GUI also changes a LED status, this can also be changed with #define
// in the file pointed to above
//
SFRA_GUI_config(SFRA_GUI_SCI_BASE,
SysCtl_getLowSpeedClock(DEVICE_OSCSRC_FREQ),
SFRA_GUI_SCI_BAUDRATE,
SFRA_GUI_SCIRX_GPIO,
SFRA_GUI_SCIRX_GPIO_PIN_CONFIG,
SFRA_GUI_SCITX_GPIO,
SFRA_GUI_SCITX_GPIO_PIN_CONFIG,
SFRA_GUI_LED_INDICATOR,
SFRA_GUI_LED_GPIO,\
SFRA_GUI_LED_GPIO_PIN_CONFIG,
&sfra1,
(uint32_t)1);
}
// DEFINES:
#define INV_PWM_SWITCHING_FREQUENCY 20000
#define SFRA_FREQ_START 100
#define SFRA_FREQ_STEP_MULTIPLY (float32_t)1.059253 // 1.05
#define SFRA_AMPLITUDE (float32_t)0.01 //0.05
#define SFRA_GUI_VBUS_CLK 50000000
#define SFRA_FREQ_LENGTH 100