Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

PID for Gas pressure control

Status
Not open for further replies.

nishal

Advanced Member level 4
Full Member level 1
Joined
May 4, 2007
Messages
108
Helped
10
Reputation
20
Reaction score
5
Trophy points
1,298
Activity points
1,936
pid pressure controller

Hi all,
I am doing a project in pic mcu to control the gas pressure. I have successfully implemented 'P' term i.e. Kp * Error. Although I tried introducing 'I' & 'D' term, it is not working properly as 'P' term and also find hard to fine tune and measure, as rate of change of pressure is usually very high.

Please suggest a method for fine tune or formula for PID to use in Gas pressure correction.

Thanks in advance!

Nishal
 

pid pressure control

If you have difficulties in determining controller parameters, you may want to omit the D action as a first step. I action is generally required to remove a static error for most control processes. If you set I gain rather low, it shouldn't cause problems but still achieves zero error in steady state.

Ziegler-Nichols tuning rules provide a rather easy way to perform an acceptable tuning for usual control processes without complex calculations or signal processing. A pressure controller possibly involves issues as non-linear actor characteristic, simple tuning rules may be inappropriate in this case.
 

pressure control pid

Thanks FvM,

P = Kp * Error
I = I + Ki * Error
D = Kd * (Error - Error_prev): Error_prev = Error

Out = Out + P + I + D

Please let me know any improvements to be made in this formula.

At lower flow rates and only P action exists, pressure seems to be more swinging (±3). but its steady on > 2 lpm flow rates. Is it a better method to change 'Kp' according to the flow rate i.e. one constant(Kp) for <2 lpm flowrate and another for > 2 lpm flowrate. so that it gets steady state on <2 as well as > 2 lpm flowrates.

Kindly let me know whether any other suitable control method exists for Gas pressure control.

Nishal


FvM said:
If you have difficulties in determining controller parameters, you may want to omit the D action as a first step. I action is generally required to remove a static error for most control processes. If you set I gain rather low, it shouldn't cause problems but still achieves zero error in steady state.

Ziegler-Nichols tuning rules provide a rather easy way to perform an acceptable tuning for usual control processes without complex calculations or signal processing. A pressure controller possibly involves issues as non-linear actor characteristic, simple tuning rules may be inappropriate in this case.
 

gas pressure control

You're thinking about variable P gain because you experienced a non-linear control process behaviour, most likely due to the actor properties. In this case, there's no simple solution. If you you are able to measure the actor characteristics, you can try to linearize it. Empirical determining an optimal gain for different operation points is probably the more simple way.

Generally, control of non-linear processes is an advanced topic in control theory. You shouldn't expect simple solutions from standard methods.
 

pressure controller

I am also in the process of developing micro processor based controlers for pressure PIDS. I have the pressure transducer and the servo. Can you tell me what micro controller you are using for your project. I have used Cypress Psoc a great deal. However I may need a different MCU>

Philip
 

pid gas control

Hello,

I have used and PID with an 18f2550 with success.

You can use the matlab tool called IDENT to extract the parameters.

I post the functions that can help you


Kp=0.8142; Ti=0.761; Td=0.19; // valores iniciais do controlo PID (Harcoded).-
TempRef=200.0; // Temperatura inicial desejada (Hardcoded).-
Incializacao_variaveis(); // incialização das variaveis do sistema.-



/* Tarefa que é executada cada 20ms para determinar o controlo do sistema */
void ControlSistema(void){
Medida=read_adc(); // Leitura do valor analogico.-
TempReal=Medida;
TempReal=(TempReal*500)/1024; // Aplica-se a escala adequada para obter
// o valor em ºC.-

eT=TempRef-TempReal; //Cálculo erro

if(SistControl==1){ // Control PID?
uT=q0*eT - q1*eT_1 + q2*eT_2 + uT_1; //Cálculo da salida PID (uT=[Volt])
rT=(uT*1000)/5; //duty cycle maximo 1000 -> 5V.-
/* <<<<< AntiWindup >>>>>*/ //ainda a depurar
if (rT>1000){ //Saida PID se é maior que 1000.-
uT=(uT + 5*p0)*p00;
rT=1000;
}
if (rT<0){ //Saida PID se é menor que 0
uT=uT*p00;
rT=0;
}
/* <<<<< Transferencia da saida PID ao sinal PWM >>>>>*/
ControlPWM=rT;
set_pwm1_duty(ControlPWM);

/* <<<<< Guardar variaveis para proximo estado >>>>>*/
eT_2=eT_1;
eT_1=eT;
uT_1=uT;
}else{ // Control On-Off.-
if(eT>0){output_high(PIN_C2);}
else{output_low(PIN_C2);}
}
if(Datalogger==1){
putc(make8(Medida,1)); // Coloco Na Rs o valor lido alto
putc(make8(Medida,0)); // Parte baixa
}
}


Inicialization

/* Inicialização da variaveis do sistema */
void Incializacao_variaveis(void){
eT_1=0.0; eT_2=0.0; uT_1=0.0; // Inicializo a zero para estado

q0=Kp*(1+(0.02/Ti)+(Td*50));
q1=Kp*(1+(Td*100));
q2=Kp*Td*50;
p0=0.02/Ti; // Parte termo integral
p00=1/(1+p0); // Escalado

Panel=0; // Painel apagado.- Default
PosMod=0; // Se é zero nao faz nada.-
Enter=0; // Não se pressionou Enter.-
SistControl=1; // Começa com sistema de controlo PID.-
datalogger=0; // Datalogger desligado.-
output_b(0x00); // Para inicializar Teclado.-
}

In case that parameters are changed in running mode


/*
En caso de modificar alguma das contantes do PID deve-se recalcular os parametros
da função PID
*/
void Actualizar_parametros(void){
q0=Kp*(1+(0.02/Ti)+(Td*50));
q1=Kp*(1+(Td*100));
q2=Kp*Td*50;
p0=0.02/Ti;
p00=1/(1+p0);
}

If you need more info please send email

Good work

Regards
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top