View Single Post
  #5   Spotlight this post!  
Unread 25-11-2015, 21:48
Asymons Asymons is offline
Registered User
FRC #4716 (Purple Raiders)
Team Role: Driver
 
Join Date: Apr 2013
Rookie Year: 2013
Location: Ontario
Posts: 33
Asymons is an unknown quantity at this point
Re: Oscillating Motor - PID Subsystem

Quote:
Originally Posted by GeeTwo View Post
No, just to use a non-zero, probably constant value of D. It is convenient to think of D as standing for dampening as well as derivative.

A P-only PID feedback system is (assuming that the mechanical system is linear) is mathematically identical to an undamped spring-and-mass; you would expect it to oscillate for a long time. When the system is far from the target, it is accelerated towards the target. By the time it reaches the target, it has significant speed, but there is no frictional term to slow it down, so it overshoots. You have essentially made a system in which F=kx (Hooke's Law). In terms of a differential equation, it becomes the simple x''=(k/m)x, where k/m is proportional to your P term. If you have done calculus 1 it is easy to verify that one solution to this equation is x=sin(sqrt(k/m)t), that is displacement is described as an undamped sine wave. Some sort of friction term is required to dissipate the initial "potential energy"; neither P nor I do this. Both D and mechanical friction will dampen the oscillations.
Thank you for this excellent response! As soon as I get access to the robot again, I'll try adjusting the variables and add a D constant. Hopefully this is the only issue, otherwise I'll be back here. Would it be acceptable to private message you if another issue arises as it seems you have some experience dealing with PID loops? I'll try not to be too bothersome
Reply With Quote