Thread: PID Loops
View Single Post
  #24   Spotlight this post!  
Unread 13-03-2011, 16:02
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,125
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: PID Loops

Quote:
Originally Posted by PriyankP View Post
So it would be something like target = currentPotValue + (Yaxis * 5) right?
Yaxis is your setpoint and (m*currentPotValue+b) is your process variable.

Adjust the gain "m" and the offset "b" so that your process variable corresponds to your Yaxis output.

Then,

error = setpoint - process_variable;

motor_voltage_command = Kp*error;

Kp is your proportional gain which you tune for the desired response.