Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic 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.

Register Log in

PID Cotrol implementation in microcontroller system

Status
Not open for further replies.

mikasi

Member level 3
Joined
May 28, 2001
Messages
54
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Location
Slovenia
Activity points
351
velocity pid

Hello to all of electronics fans out there.

I have a question about PID control for you. Did any of you implement a PID control in his/hers microcontroller system ?
Does any of you have a good PID documentation (preferd in PDF)?

I'd like to implement a linear temperature control wit electric valve and tmperature sensor feedback.

Thank you for your answers!
 

K

knavekid

Guest
winavr pid controller

I've done preliminary design work for a AVR based PID controller for DC motor position control. I no longer have the links, but you should be able to perform a google search on PID control system to find information. You should find several university class notes and examples for the design equations.

We used the AVR PWM outputs to control current drivers which, in turn, drive the motors. The built-in A/D converter was used to read the position potentiometer for feedback.
 

KamW

Advanced Member level 4
Joined
Jul 16, 2001
Messages
113
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,298
Activity points
1,130
heater control an937

Hi
The best article I know for PID control for microcontroller with code examples was in microcontrol journall (www.mcjournal.com) some time ago.
 

bunalmis

Full Member level 5
Joined
Jan 3, 2003
Messages
268
Helped
19
Reputation
38
Reaction score
11
Trophy points
1,298
Location
Ireland
Activity points
2,147
winavr+pid

Read Target Input

Read Actual output

Calculate err, err= Target - Output
calculate Proportional effect. PE = err * Kp
calculate Integral effect. IE = err * Ki*dt1 + old_IE, old_IE=IE
calculate Derivative effect, DE = Kd * (err - old_err)/dt2, old_err=err

calculate command signal = PE + IE + DE
 

nukhung

Member level 2
Joined
May 13, 2001
Messages
52
Helped
2
Reputation
4
Reaction score
1
Trophy points
1,288
Activity points
248
p i d and pendulum

Does anyone have e-book/documents or experience about calculating Kp, Ki, Kd.
 

marie65

Super Member
Joined
Jan 15, 2002
Messages
198
Helped
19
Reputation
38
Reaction score
8
Trophy points
1,298
Activity points
1,506
windup automatic generation control

Some code and explanations regarding PID design
 

bunalmis

Full Member level 5
Joined
Jan 3, 2003
Messages
268
Helped
19
Reputation
38
Reaction score
11
Trophy points
1,298
Location
Ireland
Activity points
2,147
PID and Kp Kd Ki Parameters

Usualy more difficult the determine of good values of PID parameters using analitic method.

Zigler-Nichols is experimental method.
 

dacadc

Full Member level 2
Joined
Apr 22, 2001
Messages
146
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,298
Location
Ukraine
Activity points
1,101
Reg

I used frequency analysis to determine PID coefficients, but it is complex procedure.
 

ash

Full Member level 3
Joined
Dec 25, 2002
Messages
151
Helped
2
Reputation
4
Reaction score
1
Trophy points
1,298
Location
Europe
Activity points
1,051
I'm looking for some wind-up methods, please help.
 

bunalmis

Full Member level 5
Joined
Jan 3, 2003
Messages
268
Helped
19
Reputation
38
Reaction score
11
Trophy points
1,298
Location
Ireland
Activity points
2,147
Wind up

" I'm looking for some wind-up methods, please help. "

Saturate the integral output your desired level.

integtral_e = integral + new_err*Ki*dt

if integral > my_Plimit then integral=my_Plimit;
if integral< my_Nlimit then integral=my_Nlimit;
 

syrfer18

Newbie level 1
Joined
Jan 26, 2004
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
8
Re: PID Cotrol

simulink program for a PDI A/D-D/A converter and a PDI for a CPU
thanks
 

snsriram79

Member level 4
Joined
May 8, 2001
Messages
71
Helped
1
Reputation
2
Reaction score
0
Trophy points
1,286
Activity points
513
Re: PID Cotrol

u can use velocity PID type algorithm. since in velocity the problem of anti windup is not present so you can use this methosd.

velocity PID is nothing but difference of positional PID which is normal PID with base value

o/p = base value + kp + ki + kd

velocity = op(t) + op(t-1)

if u work on it u will find that integral term is missing and hence the problem of antiwindup is taken care

cya
 

yangxh

Member level 5
Joined
Nov 26, 2004
Messages
94
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,288
Activity points
728
PID Cotrol

I wonder what PID really is?software or hardware can perform it?or both?
 

seyyah

Advanced Member level 2
Joined
Oct 7, 2001
Messages
635
Helped
8
Reputation
16
Reaction score
7
Trophy points
1,298
Activity points
6,139
Re: PID Cotrol

yangxh said:
I wonder what PID really is?software or hardware can perform it?or both?
It's a control technique or part of the control system. It's called regulator or compensator also. It's purpose is to match the actual value and desired value as wanted. A small example: You want to make a room's temperature 30°C. You measure it 20°C. Now you must increase the heater's setting. But how much will you increase it? Generally you want to reach 30°C as fast as possible. If you increase much it can exceed 30°C. If you increase less, it may take a lot of time to reach 30°C. PID determines how much you'll increase it. As you can easily see, for optimum increase value to reach 30°C, without exceeding 30°C and reaching it as fast as possible, you must determine optimum paramater values for PID. This depends on the heater's heating properties and response of the environment to the heater's heating action. So for each system you need to develop a way to obtain optimum PID values. There are practical and theoretical ways. But there is not one solution. Trial & error is more or less a part of the design.

It can be implemented by software and/or hardware.
 

maui

Member level 3
Joined
Nov 19, 2004
Messages
55
Helped
5
Reputation
10
Reaction score
0
Trophy points
1,286
Location
Melbourne Victoria Australia
Activity points
607
Re: PID Cotrol

PID is part of a feedback control system.

A feedback control system measures the output of the system and corrects it's performance against an input.
A PID contains/is a feedback path that contains a Preportional Intergral and Derivitave component of the output.

maui
 

yangxh

Member level 5
Joined
Nov 26, 2004
Messages
94
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,288
Activity points
728
Re: PID Cotrol

Thank you !
I know something about step respond.And some books usually take it as examples for the PID instruction.It seems the PID functioned just at the beginning.BUT in many cases the inputs are not step only .
They are changed in many ways .ANd if the input changes quickly,while the PID can't follow the changing in time.the result may be that the output is trembling or not stable.
Does anyone can explain it.Thank you!
 

Bingo600

Full Member level 5
Joined
Aug 26, 2004
Messages
267
Helped
19
Reputation
38
Reaction score
6
Trophy points
1,298
Location
Cyberspace
Activity points
2,439
PID Cotrol

Dammm :-(

Most of the links above are dead...

I am doing a Temp controlled watertank heater (just 2 liters), and would like to use PID

Am going to use AVR + DS1820 + Heater + WinAVR

Any hints , especially some sourcecode in C would be appreciated.

/Bingo
 

Status
Not open for further replies.
Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top