I'm looking for some reasonably simple PID code to do the following: Inputs: a) 16-bit setpoint (0000-FFFF) b) 16-bit sensor (0000-FFFF) c) P, I & D coefficients (8? 16? bits each) Output: 16-bit drive (0000-FFFF), which increases towards FFFF if sensor < setpoint, decreases towards 0000 if sensor > setpoint, stands still when sensor = setpoint. Code would nominally be called every 10mS, but this is not set in stone. Anything off the shelf out there worth recommending please? Thanks Matt -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist