Pozor na chybu v Application Note AVR221 (Discrete PID controller) od Atmelu
Jakub Ladman
ladmanj@volny.cz
Pondělí Červen 2 16:58:32 CEST 2008
Doporucuji odeslat toto upozorneni a reseni panum do atmelu.
verim ze radi provedou opravu primo v appnote.
Pomuze to tak asi nejvice lidem.
Jakub Ladman
Dne Monday 02 of June 2008 13:02:37 Richard Kaliciak napsal(a):
> Dobry den,
>
> pri hladani vhodnych PID parametrov som narazil na zvlastne spravanie
> regulatora. K_I a K_D som nastavil na nulu, aby som mohol odhadnut
> vhodne K_P. Vsetko pekne fungovalo, ale po urcitej dobe vybehla
> riadiacia hodnota na maximum.
>
> Tymto chcem upozornit na chybu v programe pid.c z AVR221, ktora sa
> prejavi pri K_I=0. V povodnom texte je:
> ---------- begin ----------
> // Calculate Iterm and limit integral runaway
> temp = pid_st->sumError + error;
> if(temp > pid_st->maxSumError){
> i_term = MAX_I_TERM;
> pid_st->sumError = pid_st->maxSumError;
> }
> else if(temp < -pid_st->maxSumError){
> i_term = -MAX_I_TERM;
> pid_st->sumError = -pid_st->maxSumError;
> }
> else{
> pid_st->sumError = temp;
> i_term = pid_st->I_Factor * pid_st->sumError;
> }
> ---------- end ----------
>
> Po istej dobe naakumulovana chyba prekroci maxSumError a i_term sa
> nastavi na MAX_I_TERM, aj ked je I_Factor = 0. Po zmene programu na:
> ---------- begin ----------
> // Calculate Iterm and limit integral runaway
> temp = pid_st->sumError + error;
> if(temp > pid_st->maxSumError){
> i_term = MAX_I_TERM;
> pid_st->sumError = pid_st->maxSumError;
> }
> else if(temp < -pid_st->maxSumError){
> i_term = MIN_I_TERM;
> pid_st->sumError = -pid_st->maxSumError;
> }
> else{
> pid_st->sumError = temp;
> }
> i_term = pid_st->I_Factor * pid_st->sumError;
> ---------- end ----------
>
> to uz funguje ako sa patri.
>
> Richard Kaliciak
> _______________________________________________
> HW-list mailing list - sponsored by www.HW.cz
> Hw-list@list.hw.cz
> http://list.hw.cz/mailman/listinfo/hw-list
Další informace o konferenci Hw-list