On Wed, Jul 10, 2013 at 7:55 AM, wrote: > > When Pout =3D 0 you have no error. You need some error for the control lo= op > to control the temp, which is why there will always be some oscillation, > but it can be tuned quite small using the three parameters for Kp. Ki, an= d > Kd, as shown in the graphs on http://en.wikipedia.org/wiki/PID_controller= but it may take a fair amount of experimenting to achieve it if (as in your > case0 the time constants are long. > > But I also wonder if using PWM is the correct way to turn the heater off > and on in your case. I would look at using cycle counting for the triac > instead, i.e. turn the triac on for x cycles and off for y cycles. The > value of x + y could be variable to suit the time constants involved. > > I too, think that PWM would work for a DC heating element, but what you want for AC is cycle count or phase control. You could even equate the PID output % to on time per second (50% output is on for 500ms, off for 500ms), which may be easier than dealing with zero cross detection required for cycle counting or full phase control. It depends on how fast your system responds to power input. Once you get that working, I learned quite a bit from this page: http://www.vandelogt.nl/htm/regelen_pid_uk.htm The section on tuning is pretty well put together. --=20 http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .