This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Dear C2000 expert,
Currently I'm going to use DCL_DF22_C1 filter as loop compensation, and found that there is no clamped module compared with CNTL_2P2Z, can you please help me know why?
For CNTL_2P2Z, the u(k-1) and u(k-2) can be ensured to the range of max and i_min, but there is no limitation for DCL_DF22_C1 filter, why?
In CNTL_2P2Z, there are 3 limit thresh, max, i_min, and min, can you please help me know what the purpose of using i_min?
Jack,
The CNTL_2P2Z compensator is a fixed point implementation of what is called a "direct form 1" structure. The design incorporates a max/min clamp inside the loop to prevent windup. We sometimes want the compensator output to be clamped to a minimum of zero, for example if the output represents a PWM duty cycle, however if we do this in fixed point the compensator cannot recover quickly from positive saturation because the return path via a1 & a2 needs to see negative values. Therefore we set the lower limit of the two-sided clamp slightly negative (this is i_min), and re-clamp to the desired lower limit to zero after the compensator. This is why you see two clamps in the diagram. It's also explained in the text which follows the diagram in the DPlib user's guide.
The DCL_DF22_C1 is a "direct form 2 transposed" structure which has better numerical robustness than direct form 1 and is faaster to run since there is only one delay line. The C1 is a full implementation without clamping. If you want to implement clamping, you'll need to use the C2 and C3 functions together with a clamp between them. There is an example in the DCL (F28069_DF22) which demonstrates how this is done. The code is:
// run pre-computed controller
u2k = DCL_runDF22_C2(&controller2, ek);
v = DCL_runClamp_C1(&u2k, upperLim, lowerLim);
if (0 == v)
{
DCL_runDF22_C3(&controller2, ek, u2k);
}
Hoping this helps.
Regards,
Richard
Hi Richard,
Thanks for your detail explaination about it.
One more question about the code, I see that if u2k is lager than upperLim or lower than lowerLim, the DCL_runDF22_C3 will not be called, can you please help me know the reason?
// run pre-computed controller
u2k = DCL_runDF22_C2(&controller2, ek);
v = DCL_runClamp_C1(&u2k, upperLim, lowerLim);
if (0 == v)
{
DCL_runDF22_C3(&controller2, ek, u2k);
}
Hi Jack,
The idea is to prevent the compensator states from "winding up", or growing too much, when the loop is saturated. In saturation the loop is out of control, so nothing the controller does is changing anything at the output. However the loop error will be non-zero, so the compensator will still try to correct for it.
By splitting the DF22 in this way we have the 'immediate' part which has no states; and the 'pre-computed' part which has two states. These are respectively the C2 and C3 parts of the controller. The states are labelled x1 & x2 in the DF22 diagrams.
If the control is saturated we first test whether action by the immediate part brings it back within range. If so, we pre-compute C3 for use next time. If not, we don't pre-compute C3 so the states remain at their current values. It's similar to integrator anti-windup in a PI(D) controller, except that we don't have an obvious integrator here.
Hope this makes it clearer. Please let me know if I can help further.
Regards,
Richard
Hi Richard,
Thanks. It's very clear.
One more question, the parameters value( b0, b1, b2, a1,a2) should be the same between DF22_C1 and DF22_C2&C3, isn't it?
If I want to tune the loop parameters, can the tools within SFRA be still used? Loop type select (2P2Z)
C:\ti\c2000\C2000Ware_DigitalPower_SDK_2_00_01_00\libraries\sfra\gui
Hi Jack,
Yes the coefficients are the same between C1 and C2/C3.
You can use the SFRA to determine these coefficients, but be aware there is a notational difference between the coefficients of the DF22 and those of the older 2P2Z in DPlib. In the latest SFRA documentation it says you can set the compensator type to DF22 so it shouldn't be an issue.
Regards,
Richard