SPRUHJ1I January 2013 – October 2021 TMS320F2802-Q1 , TMS320F28026-Q1 , TMS320F28026F , TMS320F28027-Q1 , TMS320F28027F , TMS320F28027F-Q1 , TMS320F28052-Q1 , TMS320F28052F , TMS320F28052F-Q1 , TMS320F28052M , TMS320F28052M-Q1 , TMS320F28054-Q1 , TMS320F28054F , TMS320F28054F-Q1 , TMS320F28054M , TMS320F28054M-Q1 , TMS320F2806-Q1 , TMS320F28062-Q1 , TMS320F28062F , TMS320F28062F-Q1 , TMS320F28068F , TMS320F28068M , TMS320F28069-Q1 , TMS320F28069F , TMS320F28069F-Q1 , TMS320F28069M , TMS320F28069M-Q1
There are two first order cascaded filters inside of the Rs Online estimator which are run in order to get an accurate and steady value of the stator resistance. A total of four filters are run, one set of two cascaded ones for the currents, and one set of two for the voltages. Each set of two filters use the same coefficients by default. However, depending on the response required by the application, the coefficients of both filters can be read and written individually. The default cutoff frequency of these filters is set to 0.2 Hz. This cutoff frequency can be verified by the user with the following code example:
EST_getRsOnLineFilterParams(obj->estHandle, EST_RsOnLineFilterType_Current,
&pfilter_i0->b0, &pfilter_i0->a1, &pfilter_i0->y1,
&pfilter_i1->b0, &pfilter_i1->a1, &pfilter_i1->y1);
EST_getRsOnLineFilterParams(obj->estHandle, EST_RsOnLineFilterType_Voltage,
&pfilter_v0->b0, &pfilter_v0->a1, &pfilter_v0->y1,
&pfilter_v1->b0, &pfilter_v1->a1, &pfilter_v1->y1);
_iq pu_to_kHz_sf = _IQ((float_t)USER_EST_FREQ_Hz/1000.0);
cutoff_freq_kHz_i0 = _IQmpy(pfilter_i0->b0, pu_to_kHz_sf);
cutoff_freq_kHz_i1 = _IQmpy(pfilter_i1->b0, pu_to_kHz_sf);
cutoff_freq_kHz_v0 = _IQmpy(pfilter_v0->b0, pu_to_kHz_sf);
cutoff_freq_kHz_v1 = _IQmpy(pfilter_v1->b0, pu_to_kHz_sf);
By default, the cutoff frequency variables will return a value of 0.0002, representing 0.0002 kHz, or 0.2 Hz. Generally, this cutoff frequency should be tuned so that the resistance value can grow depending on the expected temperature dynamics of the application. Figure 16-16 is an example of how the Rs Online varies depending on this cut-off frequency. We plot 0.1 Hz, 0.2 Hz and 0.5 Hz. Using a slow rotating angle of 0.1 Hz, if the cutoff frequency of the filters is faster than the rotating angle, the resistance will tend to follow the rotating angle, so it is recommended to have this filter setting to at least the same frequency of the slow rotating angle to get a better filtered resistance.
As can be seen, having a lower cutoff frequency leads to a less varying resistance. However, if the temperature dynamics of the system allow the temperature to rise too rapid, having a low cutoff frequency might be a problem.
There can be a scenario where the temperature increases very rapidly, requiring a change in the cutoff frequency to a higher value. If the application requires a change in the cutoff frequency, the following code example shows how to do this. In the example we are changing the cutoff frequency on the fly, so we have to read it first, then modify the coefficients, and then write back with the same output, so we avoid affecting the filters' outputs.
EST_getRsOnLineFilterParams(obj->estHandle, EST_RsOnLineFilterType_Current,
&pfilter_i0->b0, &pfilter_i0->a1, &pfilter_i0->y1,
&pfilter_i1->b0, &pfilter_i1->a1, &pfilter_i1->y1);
EST_getRsOnLineFilterParams(obj->estHandle, EST_RsOnLineFilterType_Voltage,
&pfilter_v0->b0, &pfilter_v0->a1, &pfilter_v0->y1,
&pfilter_v1->b0, &pfilter_v1->a1, &pfilter_v1->y1);
// Use global variable desired_frequency_kHz to set the desired cutoff
// frequency of the filters. Use the same cutoff frequency for all filters
cutoff_freq_kHz_i0 = desired_frequency_kHz;
cutoff_freq_kHz_i1 = cutoff_freq_kHz_i0;
cutoff_freq_kHz_v0 = cutoff_freq_kHz_i0;
cutoff_freq_kHz_v1 = cutoff_freq_kHz_i0;
// Use the following scale factor to convert kHz to per unit value
_iq kHz_to_pu_sf = _IQ(1000.0/(float_t)USER_EST_FREQ_Hz);
// Calculate the per unit value for all filters
cutoff_freq_pu_i0 = _IQmpy(cutoff_freq_kHz_i0, kHz_to_pu_sf);
cutoff_freq_pu_i1 = _IQmpy(cutoff_freq_kHz_i1, kHz_to_pu_sf);
cutoff_freq_pu_v0 = _IQmpy(cutoff_freq_kHz_v0, kHz_to_pu_sf);
cutoff_freq_pu_v1 = _IQmpy(cutoff_freq_kHz_v1, kHz_to_pu_sf);
// Calculate coefficients for all filters
pfilter_i0->b0 = cutoff_freq_pu_i0;
pfilter_i0->a1 = cutoff_freq_pu_i0 - _IQ(1.0);
pfilter_i1->b0 = cutoff_freq_pu_i1;
pfilter_i1->a1 = cutoff_freq_pu_i1 - _IQ(1.0);
pfilter_v0->b0 = cutoff_freq_pu_v0;
pfilter_v0->a1 = cutoff_freq_pu_v0 - _IQ(1.0);
pfilter_v1->b0 = cutoff_freq_pu_v1;
pfilter_v1->a1 = cutoff_freq_pu_v1 - _IQ(1.0);
// Configure Rs Online to use the new filter coefficients
EST_setRsOnLineFilterParams(obj->estHandle, EST_RsOnLineFilterType_Current,
pfilter_i0->b0, pfilter_i0->a1, pfilter_i0->y1,
pfilter_i1->b0, pfilter_i1->a1, pfilter_i1->y1);
EST_setRsOnLineFilterParams(obj->estHandle, EST_RsOnLineFilterType_Voltage,
pfilter_v0->b0, pfilter_v0->a1, pfilter_v0->y1,
pfilter_v1->b0, pfilter_v1->a1, pfilter_v1->y1);