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.
Hi this is Vinod ,I m designing DC-DC converter using 320f28035.My Pid part is not work properly.Any one can sugess me that how can I implement PID.
#include "IQmathLib.h"
#include "pid_reg3.h"
volatile PIDREG3 pid1_Vdc = PIDREG3_DEFAULTS;
void main(void)
{
pid1_Vdc.Kp=_IQ(30);
pid1_Vdc.Ki=_IQ(15);
pid1_Vdc.Kd=_IQ(0);
pid1_Vdc.Kc=_IQ(0.2);
//pid1_Vdc.Err=_IQ(0);
pid1_Vdc.Ref=_IQ(i_set_count);
pid1_Vdc.Fdb=_IQ(0);
pid1_Vdc.OutMin=_IQ(1667);
pid1_Vdc.OutMax=_IQ(1000);
}
Plz help me.
Regard
Vinod Kumar
interrupt void ADCINT1_ISR(void)
{
static volatile Uint16 i=0; // Counter for pin toggle
GpioDataRegs.GPBSET.bit.GPIO34=1;
PieCtrlRegs.PIEACK.all = PIEACK_GROUP1; // Must acknowledge the PIE group
//--- Manage the ADC registers
AdcRegs.ADCINTFLGCLR.bit.ADCINT1 = 1; // Clear ADCINT1 flag
//--- Read the ADC result
Vmeasure = AdcResult.ADCRESULT0; // Read the result
pid1_Vdc.Ref=_IQ(i_set_count);
pid1_Vdc.Fdb=_IQ(Vmeasure);
id1_Vdc.calc(&pid1_Vdc);
pwm=_IQ24int(pid1_Vdc.Out);
// Update new period
EPwm1Regs.TBPRD = pwm;
}
Vinod,
I am assuming this module is from the DMC LIbrary, the DMC blocks depend on the IQ math library point specified in the IQmathLib.h, this GLOBAL_Q value is then used by these blocks. Unless you have changed this it is defined as Q24, Clearly as Q24 only 8 bits of integer, (1 sign) the maximum value can only be 2^7.
Thus the following two lines violate this,
pid1_Vdc.OutMin=_IQ(1667);
pid1_Vdc.OutMax=_IQ(1000);
Please understand that F28035 is a fixed point processor. And hence Q point is important for the operations to work correctly.
If you did not know already, we have a digital power library that is collection of highly optimized blocks for power specific applications specially DC-DC where switching rates are in 100's of Khz. This is available through controlSUITE and comes with documentation.
What topology of DC-DC are you working with?
For the archives, there is also a new pid_grando being released in April's controlSUITE update, being used with a new BLDC/FOC kit. I would use this for any non digital power applications (where you would want to use the compact version in the power_lib)
To TI Employee and all member,
I am refering this module pid_reg3 ,I try to design Kp Ki Kc of the PID for an AC-DC PFC controller ,
but I don't know how can define "Kc" parameter?
Anyone can give me some advice.
Thanks!
Joseph Yang
Kc is a correction gain for the Ki term
C:\ti\controlSUITE\libs\app_libs\motor_control\math_blocks\v3.1\~Docs
typically for PFC we tend to use a 2p2z compensation technique, you may want to evaluate the examples and DPLib in controlSUITE.
Hi ChrisClearman,
Thank for your reply ,I have seen pid_reg3 documents, But I want to know Kc with Kp,Ki,Kd of formula , basically Kp,Ki,Kd is main parameter of PID controller ,so how to calculate Kc value is my question.
and PFC by 2P2Z ,it's must be modeling for open loop , but it's too complex for me, so I tend to try and error by PID whether it's feasible method?
Thanks!
Joseph.
have you looked at pid_grando? It is a better compensation block and easier to use.
2P2Z is described in the Digital Power Lib
C:\ti\controlSUITE\libs\app_libs\digital_power\f2803x_v3.2\Doc
page 18.
These are optimized, very fast compensation blocks and what we would recommend for PFC
Hi ChrisClearman,
I had referred to the page 18 of library and try to change the way to optimize the controller , but there was not described that how to design and calculate.
Generally ,The PID Controller defined 3 parameter of Kp,Ki,Kd, but 2P2Z must be defined 5 parameter, there is different ,
Could you give me that where can get 2P2Z designing example for PFC of Digital Power(include how to calculate b0,b1,b2,a1,a2) ?
Thanks!!
Joseph
Hong,
Please review the main system guide for any of the digital power kits in controlSUITE
for exampe, on the PSFB kit look at page 30
C:\ti\controlSUITE\development_kits\HVPSFB\~Docs
"Directly manipulating the five coefficients independently by trial and error is almost impossible, and requires mathematical analysis and/or assistance from tools such as matlab, mathcad, etc. These tools offer bode plot, root-locus and other features for determining phase margin, gain margin, etc.
To keep loop tuning simple and without the need for complex mathematics or analysis tools, the coefficient selection problem has been reduced from five degrees of freedom to three, by conveniently mapping the more intuitive coefficient gains of P, I and D to B0, B1, B2, A1, and A2. This allows P, I and D to be adjusted independently and gradually. These mapping equations are given below."