Discussion group dedicated to the Philips LPC2000 family of ARM MCUs
PID Controller - "Rode, Dinesh (IE03x)" - Sep 12 5:40:48 2008
Hello,
I am implementing PID Temperature controller using LPC24xx.
Has anybody implemented PID controller?
Please let me know if sample application code in C is available?
Thanks
[Non-text portions of this message have been removed]
------------------------------------

(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )
Re: PID Controller - Adinath jadhav - Sep 13 0:19:29 2008
Dear,
Which algorithm you want to implement?
What is the target process for which you are using this temprature
controlling?
One of the algorithm of PID that you can use is Zeigler-Nichols algorithm.
It requires some initial paramaters of process for which Self Tuning of
target process is required.
regards,
Adi
On Fri, Sep 12, 2008 at 12:19 PM, Rode, Dinesh (IE03x) <
D...@honeywell.com> wrote:
> Hello,
>
> I am implementing PID Temperature controller using LPC24xx.
>
> Has anybody implemented PID controller?
>
> Please let me know if sample application code in C is available?
>
> Thanks
>
> [Non-text portions of this message have been removed]
>
--
Adinath
"The difference between Ordinary and ExtraOrdinary is that little extra."
[Non-text portions of this message have been removed]
------------------------------------

(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )
Re: PID Controller - Cool Dude - Sep 19 7:23:42 2008
hi Rode dinesh,
Did you get your PID working.
Raj
----- Original Message ----
From: "Rode, Dinesh (IE03x)"
To: l...@yahoogroups.com
Sent: Friday, September 12, 2008 12:19:58 PM
Subject: [lpc2000] PID Controller
Hello,
I am implementing PID Temperature controller using LPC24xx.
Has anybody implemented PID controller?
Please let me know if sample application code in C is available?
Thanks
[Non-text portions of this message have been removed]
[Non-text portions of this message have been removed]
------------------------------------

(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )Re: PID Controller - Peter Kic - Sep 28 16:44:23 2008
--- In l...@yahoogroups.com, "Rode, Dinesh (IE03x)"
wrote:
>
> Hello,
>
>
>
> I am implementing PID Temperature controller using LPC24xx.
>
>
>
> Has anybody implemented PID controller?
>
>
>
> Please let me know if sample application code in C is available?
>
>
>
> Thanks
>
> [Non-text portions of this message have been removed]
>
This is a part of my code, that I made for seminar at facultaty. It is
PID controller for servo motor.
Some parts are in slovenian language. I home it will help you:
Translation:
ref_vrednost - reference value
smer_trenutna - way this moment
vrednost - value
hitrost - speed
smer_zeljena_pwm - way, that you wish
pogresek - difference
void avtomatsko_vodenje(unsigned int ref_vrednost, unsigned int
hitrost, char smer_trenutna)
{
static float pogresek=0;
static float vrednost=0;
static int pwm_vrednost=0;
char smer_zeljena_pwm;
static float x1=0;
static float x2=0;
static float x3=0;
static float x4=0;
float hitrost_float;
float ref_vrednost_float;
if (ref_vrednost&0x0200)
smer_zeljena_ref=DESNO; //right
else
{
ref_vrednost=~ref_vrednost;
smer_zeljena_ref=LEVO; //left
}
//to mm/s
ref_vrednost_float=(((float)(ref_vrednost&0x01FF))*2.929);
//way we wish
if (smer_zeljena_ref==LEVO)
ref_vrednost_float=ref_vrednost_float*(-1);
//way this moment
if (smer_trenutna==LEVO)
hitrost_float=((float)hitrost)*(-1);
else
hitrost_float=((float)hitrost);
//main part
pogresek=ref_vrednost_float-hitrost_float;
x4=x3-vrednost;
x1=pogresek-K*x4;
x2=x2+(KI*(To*x1));
x3=(pogresek*KP)+x2;
vrednost=x3;
//end main part, also must bi made: vrednost_stara=vrednost;
//max value
if (vrednost>MAX_VREDNOST)
vrednost=MAX_VREDNOST;
else if (vrednost
vrednost=MIN_VREDNOST;
//max delta
if (P8&0x08)
{
if ((vrednost-vrednost_stara)>MAX_VRED_DELTA)
{
vrednost=vrednost_stara+MAX_VRED_DELTA;
}
else if ((vrednost-vrednost_stara)<-MAX_VRED_DELTA)
vrednost=vrednost_stara-MAX_VRED_DELTA;
}
vrednost_stara=vrednost;
pwm_vrednost=(int)vrednost;
if (pwm_vrednost<0)
{
pwm_vrednost=pwm_vrednost*(-1);
smer_zeljena_pwm=LEVO;
}
else
smer_zeljena_pwm=DESNO;
pwm_setmotor(smer_zeljena_pwm, pwm_vrednost);
}
------------------------------------

(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )