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
The implementation of the Rs Online feature requires a certain internal vector to be rotated slowly as the motor spins. This slowly rotating vector is set by default to a value of 0.00001, in per unit value, so it will generate a vector at a frequency of 0.00001 * Estimator Frequency in Hz. So if the estimator frequency is 10 kHz, then the rotating vector will be at a frequency of 0.1 Hz, or with a period of 10 seconds. This rotating vector is needed so that the Rs Online converges to an average resistance measured at different points of that vector.
Although the details are not disclosed on how Rs Online estimates a varying resistance, it is important to know that this rotating angle is used to estimate a resistance at various current vectors. Over time, the online resistance is the average resistance produced by the measurements at all the vectors as they are rotated slowly. In order for the user to know what the rotating vector is set to, besides looking at the currents in the oscilloscope, users can use the following code example.
// These defines are in user.h
#define USER_NUM_ISR_TICKS_PER_CTRL_TICK (1)
#define USER_NUM_CTRL_TICKS_PER_EST_TICK (1)
#define USER_PWM_FREQ_kHz (10.0)
#define USER_ISR_FREQ_Hz (USER_PWM_FREQ_kHz * 1000.0)
#define USER_CTRL_FREQ_Hz (uint_least32_t)(USER_ISR_FREQ_Hz \
/USER_NUM_ISR_TICKS_PER_CTRL_TICK)
#define USER_EST_FREQ_Hz (uint_least32_t)(USER_CTRL_FREQ_Hz \
/USER_NUM_CTRL_TICKS_PER_EST_TICK)
// Initialize obj to the controller handle
CTRL_Obj *obj = (CTRL_Obj *)ctrlHandle;
_iq delta_pu_to_kHz_sf = _IQ((float_t)USER_EST_FREQ_Hz/1000.0);
_iq RsOnLine_Angle_Delta_pu = EST_getRsOnLineAngleDelta_pu(obj->estHandle);
// By default, the returned value in the following line will be close to:
// _IQ(0.00001), representing 0.0001 kHz, or 0.1 Hz
_iq RsOnLine_Angle_Freq_kHz = _IQmpy(RsOnLine_Angle_Delta_pu, \
delta_pu_to_kHz_sf);
For more information about the software execution clock trees used in InstaSPIN, as well as the decimation factors, also known as tick rates, see Section 10.
If the angle delta is never changed, a default value of 0.00001, in per unit value, is set by the library, which results in a slow rotating angle frequency of 0.00001 times the estimation frequency. If the estimation frequency is the same as the PWM frequency, and it is set to 10 kHz, then the slow rotating angle will have a frequency of 0.00001 * 10000 = 0.1 Hz (period of 10 seconds). The slow rotating angle can be seen from the current waveform, as the angle changes how the current is injected into Id. Figure 16-12 shows how the current changes its shape at a frequency equal to the slow rotating angle frequency.
An example of an application that might need a change in this rotating angle is when the motor's temperature increases at a much higher rate, so this rotating angle needs to be faster. The rotating vector does not need to be changed as the temperature increases. It only needs to be set once depending on the expected worst case temperature dynamics of the system, and there is no need to fine tune this value as temperature varies. For example, if the temperature dynamics of a system requires a rotating angle to be changed to 0.2 Hz (period of 5 seconds), the following code example is used to change the slowly rotating angle to the new value of 0.2 Hz:
// This new define represents the desired RsOnLine rotating angle frequency
#define RSONLINE_ANGLE_FREQ_Hz (0.2)
// Initialize obj to the controller handle
CTRL_Obj *obj = (CTRL_Obj *)ctrlHandle;
// The scale factor (sf) calculation is done by the pre-compiler
_iq delta_hz_to_pu_sf = _IQ(1.0/(float_t)USER_EST_FREQ_Hz);
_iq RsOnLine_Angle_Freq_Hz = _IQ(RSONLINE_ANGLE_FREQ_Hz);
_iq RsOnLine_Angle_Delta_pu = _IQmpy(RsOnLine_Angle_Freq_Hz, \
delta_hz_to_pu_sf);
EST_setRsOnLineAngleDelta_pu(obj->estHandle,
RsOnLine_Angle_Delta_pu);
As can be noticed in this code example, the function now sets a value for angle delta, so it expects a parameter to be written, which in this case is variable RsOnLine_Angle_Delta_pu.
The resulting oscilloscope plot related to the configuration done in the previous code example is shown in Figure 16-13.