Scaling PID Output


i have implemented pid function using formula,

code: [select]

correction = kp * error + kd * (error - preverror) + ki * (sum of errors)


what should keep output between range? 0-255 if disregard value not between 0 255 produces jiggly behavior?

how about:

code: [select]
if (correction > 255) {
  correction = 255;
} else if (correction < 0) {
  correction=0;
}


--
the quick shield: breakout 28 pins quick-connect terminals


Arduino Forum > Forum 2005-2010 (read only) > Software > Syntax & Programs > Scaling PID Output


arduino

Comments

Popular posts from this blog

CAN'T INSTALL MAMBELFISH 1.5 FROM DIRECTORY - Joomla! Forum - community, help and support

error: expected initializer before 'void'

CPU load monitoring using GPIO and leds - Raspberry Pi Forums