Thread: encoders
View Single Post
  #2   Spotlight this post!  
Unread 01-02-2007, 12:05
TubaMorg TubaMorg is offline
Programmermechanicalelect ricalcoach
AKA: Dan
FRC #1480 (Robatos Locos)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Houston
Posts: 450
TubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond repute
Re: encoders

It sounds as if you have implemented a simple PID control, or at least the proportional part of PID. If you are unfamiliar with this just search for it here on ChiefDelphi. Believe it or not, you aren't too far away from making your drive behave properly. I am guessing you are finding the error between the speed you want and the speed the encoders are showing and applying that error to your motors to make the correction. The problem is you keep overshooting the mark, this is a common problem in all mechanical control systems. You just need to scale down your error so that the response is slower and doesn't overshoot:

correction = error*.4 (for example)

In a true PID control you would scale it down to just enough to prevent oscillation, however this often results in the error never going to 0. That's when you can try adding in the "I" and the "D" part of the control. I will let you find out more about that after you search for "PID"