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.

Basic questions on PID and PWM

Status
Not open for further replies.

spider7

Newbie level 4
Joined
Feb 5, 2011
Messages
7
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,373
Hello Everybody,

I WOULD LIKE ALL OF YOU TO READ PATIENTLY AND COMPLETELY.

I have fair working knowledge on Microcontrollers. I am trying to build a temperature controller for WAX POTs which requires some unique features. I have few basic questions to ask. We will talk about only basics avoiding any kind of application notes, Tuning Methods, Motors. We will talk about only Heaters which is 50VAC(which is unsual in this world). And medium in which it will heated is air. I am using K type thermocouple to sense the temperature. The Volume of the pot is roughly about 250-450 Cu.cm. I can program in C but NOT in assembly.

I know P, I and D. "P"= Proportional which the current error derived from Target Temperature and the Current Temperature. "I" is the integral and it is the accumulation of errors of the past. And finally the "D" is the derivative. Now here is it the past error or difference of current error and past error. Now if I put these things in an Excel sheet the temperature range from 30 to about 500 Deg C. And give a Set Temperature paramter and calculate as per the PID formula. There are various ones. I am using as described above. What I found is that the Output which (P+I+D) is always between 1-3 for any given Target (Iknow that this will be fed to Heater On/Off).

Now I have few question on PID as well as PWM.

1. Does the Integral becomes or limited to zero anywhere during the process( I mean in between the Set and Target) or we have to limit near to the target.

2. Here I would like bring some attention that any heater heats fast at lower temperatures and slow at higher temperatures(if air is the medium). Also the heater cools very fast at higher temperatures and slow in lower temperatures. If this the case then what is the use of output which is 1-3 always for any set point on the other hand where we require fast on/off condition of the heater at higher temperatures and slower on/off condition at lower temperatures. How can I overcome this perticular point if I am correct what I stated above.

3. Normal or rather all Process control introduces PWM signal to Heater. What does exactly the PWM do. I would like to have some good answer for this like explaining to a kid who does not know anything.

4. I know that finally it is said that tuning is the one for the success. But as I stated on point 2 above. How can we tune these conditions. Hence I don't think it is the tuning part which is important.

I think as of now without understand properly the above things I cannot proceed further. Hence I request all of you to enlighten me on these points. I will expect a good expert's explaination.:)

Thankyou all.
 

1. it depends how your PID is implemented, most digital PID i have seen are positive only, so every data goes from 0 to 16000 and you must limit the integral part (even all parts) to this values...

2. & 4. the fact is that you must choose an 'Operating Point' to tune your PID, taking in account an operating point, you can make a linear model of the POT and tune up the PID even when you operate far from the OP..

3. the PID controller Output is an continous signal, not an ON-OFF signal, very complex devices implements and Digital to Analog converter (DAC) to output this signal, but as you stated, a heater control implements a more simple conversion, by using Phase Width Modulation (PWM) this modulation, takes in account that the width of a digital pulse on a constant period of time is related (proportional?) to the average voltage measured on the pulse output. it's an economic way to get an analog behavior from a Digital Output... (I have used this all days, but i'm not very sure about the math behind this assumption...) any way it's wide used, and the common way to work with heathing systems...

Hope it helps...
 

Thankyou for your reply.

1. it depends how your PID is implemented, most digital PID i have seen are positive only, so every data goes from 0 to 16000 and you must limit the integral part (even all parts) to this values...

So does it mean that once it has been zeroed or limited it has to start again. If yes then can you tell how to do this part.

2. & 4. the fact is that you must choose an 'Operating Point' to tune your PID, taking in account an operating point, you can make a linear model of the POT and tune up the PID even when you operate far from the OP..

But I have seen have different version for this. Because I have different operating points. Let's say that one type of wax requires 200 DegC and other other type reqires about 500 Degc. If I tune at 200 then 500 gets undershoot means never reach the target and if I tune at 500 then 200 is overshooted.

3. the PID controller Output is an continous signal, not an ON-OFF signal, very complex devices implements and Digital to Analog converter (DAC) to output this signal, but as you stated, a heater control implements a more simple conversion, by using Phase Width Modulation (PWM) this modulation, takes in account that the width of a digital pulse on a constant period of time is related (proportional?) to the average voltage measured on the pulse output. it's an economic way to get an analog behavior from a Digital Output... (I have used this all days, but i'm not very sure about the math behind this assumption...) any way it's wide used, and the common way to work with heathing systems...

I think I wanted to mention here about the output to heater. The heater output is always On/Off only I beleive. Either it is driven by relay or optocoupler.

Acutally I am bit confused by PWM. If it is a width of digital signal which means on cycle and off cycle. If this is the case, this can be done with timing function as well. Why we require PWM.

Thankyou.
 

hi, first a cuestion... how are you planning to implement the PID algortihm??? do you have something in mind? remember that a digital implementation is different than the analogic way...

1. say I=1 and your integral part is 45 and the actual error is -160. instead of decrementing down to -115 the integral part, must be limited to 0... if the error changes to... 34 say, the first time the integral part will be 34. the seccond time will be 68 and so until (if the error persist) it reaches 15980... the next loop, instead of adding up to 16014, it should be limited to 16000.... (assuming a 0 to 16000 data range...)

2. well, it's true, so you must test tunnig with an intermediate operating point, or implement a more complex control algorithm, or some auto.tunnig pid algorithm...

3.
PWM is made by timming! most microcontrollers USES an internal timer for the PWM function... PWM is used to have an analog behavior from an ON-OFF output, it depends on how much time do you want the cycle to be... say, to output sound waves, your PWM could be over 100us cycle, for a heather (110/220VAC) i could use 60 secconds cycle or more...
the PWM module on the microcontrollers is used mostly for very fast PWM (over 1KHz) for a heather, mostly (60sec) you will need to implement a slow version of PWM (using timers if you want)
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top