Resuming an old thread > The equation when the proportional and integral part is used is: > > Pout=3DKp*(SP-PV) + Ki*sumErr; > > Where sumErr is sumErr=3DsumErr+(SP-PV) for each cycle. > > So the error adds up untill SP-PV=3D0 and then stays there which will giv= e > you an > offset to the PWM value. > > This is a PI regulator. > "the error adds up until SP-PV=3D0" was the solution exactly. I did at th= e time have difficulty getting my head around this. I pictured Integral Term as producing the more aggressive drive toward the SP only, and then averaging out over time to zero once the SP had been reached. In reality, (after some delay) it does add aggressive control then it whittles away toward the offset which settles at the required PWM value. I finally got it all together and it is a thing of beauty to watch as PWM (or Pout), Perr and Ierr are constantly recalculated until the PV is steady at the SP. Experimenting, with the sensor not directly sensing the heat source but instead coupled loosely with a narrow section of aluminium rod I was impressed how fast the system continued to stabilised and how stable it became. The assistance from the list has been very much appreciated. Thanks Justin --=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 .