Thread: PID Issue
View Single Post
  #5   Spotlight this post!  
Unread 29-01-2015, 15:15
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,112
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: PID Issue

I didn't look closely enough at your code before, but now I see that you might have a fundamental problem. Think about what happens when the wheel speed matches the rate you're commanding. What's the output of the PID function going to be?

Zero.

That's not what you want to tell the motors. I think the simplest fix would be to "integrate" the output of the PID in order to make things work right. Instead of feeding it to the Tank Drive directly, use the PID output to add to or subtract from the motor speed command. That way, when the feedback and setpoint are the same, the motor will continue at its current speed.

Another way to do it is possible, but it isn't as simple to implement when using the "Academic PID" that LabVIEW provides.
Reply With Quote