View Single Post
  #6   Spotlight this post!  
Unread 24-07-2006, 20:45
Nikhil Bajaj Nikhil Bajaj is offline
MATLAB Fan
FRC #0461 (Westside Boiler Invasion)
Team Role: Mentor
 
Join Date: Feb 2003
Rookie Year: 2002
Location: West Lafayette, Indiana
Posts: 101
Nikhil Bajaj has a reputation beyond reputeNikhil Bajaj has a reputation beyond reputeNikhil Bajaj has a reputation beyond reputeNikhil Bajaj has a reputation beyond reputeNikhil Bajaj has a reputation beyond reputeNikhil Bajaj has a reputation beyond reputeNikhil Bajaj has a reputation beyond reputeNikhil Bajaj has a reputation beyond reputeNikhil Bajaj has a reputation beyond reputeNikhil Bajaj has a reputation beyond reputeNikhil Bajaj has a reputation beyond repute
Send a message via AIM to Nikhil Bajaj
Re: Sample PID code???

Quote:
Originally Posted by EHaskins
I can write a simple PID, but I am having trouble when I try to write one to handle more then one output. I would like to be able to have the two/four drive outputs have one group of gains, and also have separate gains for a turret, thrower wheels... .


Is this possible, and if anyone has done this can they show me how they did this.

EDIT: My goal is to have 4-6 output channels. 1-2 would have the same gains.
You could implement the PID as a function that gets passed the loop parameters and the error information required when you call it...that way you can have one PID in code but manage many loops with it.

Or am I not understanding the question?