View Single Post
  #5   Spotlight this post!  
Unread 23-02-2012, 14:52
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,562
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: Help me understand PIDController::OnTarget()

I think depending on your application, you could make an argument for either method.

For example, if you're controlling the angle of an arm, you probably want the same tolerance range throughout the motion of the arm (as implemented). If you're controlling the speed of a shooter, you'd want to use the percent error formula, so that you have a tighter tolerance as the speed of the wheel gets smaller.

In Java, here's the java-doc for setTolerance.
Code:
    /**
     * Set the percentage error which is considered tolerable for use with
     * OnTarget. (Input of 15.0 = 15 percent)
     * @param percent error which is tolerable
     */
Reply With Quote