View Single Post
  #3   Spotlight this post!  
Unread 10-01-2013, 09:17
Jared Russell's Avatar
Jared Russell Jared Russell is offline
Taking a year (mostly) off
FRC #0254 (The Cheesy Poofs), FRC #0341 (Miss Daisy)
Team Role: Engineer
 
Join Date: Nov 2002
Rookie Year: 2001
Location: San Francisco, CA
Posts: 3,078
Jared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond repute
Re: Switching between position PID (autonomous) and velocity PID (teleop)

With the amount of robot-to-robot, robot-to-gamepiece, and robot-to-field contact that occurs during teleop, any feedback system on the drive is going to see a LOT of disturbances. Disturbances can make your loops unstable, or have weird "what the heck just happened" consequences. We used velocity PID during teleop for Lunacy initially (to help with traction control), but ultimately removed that in favor of a simpler motor ramp up/down limit and the drivers liked the feel better.

If you want an acceleration limit, you can simply limit the rate of change of your speed commands.

For example:

Code:
[pseudocode]
maxChange = 0.05
speed = 0

while(robot is running)
    input = joystick.getY()
    if input > (speed + maxChange)
        speed = speed + maxChange
    else if input < (speed - maxChange)
        speed = speed - maxChange
    else
        speed = input
    end if
   
    motor.set(speed)
end while