View Single Post
  #6   Spotlight this post!  
Unread 26-11-2015, 08:31
otherguy's Avatar
otherguy otherguy is offline
sparkE
AKA: James
FRC #2168 (The Aluminum Falcons)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2009
Location: CT
Posts: 431
otherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to behold
Re: Oscillating Motor - PID Subsystem

Regarding the command continuing to run between the robot being enabled/disabled:

Your command will only finish if the onTarget method returns true.
Code:
protected boolean isFinished() {
    	return Robot.pidelevator.onTarget();
    }
When the robot is disabled commands aren't automatically disabled, the command is still trying to move the motors, the outputs to the motor controllers are disabled. So when you re-enable, the command continues to try to get the elevator to the setpoint.

Add something like:
Code:
Scheduler.getInstance().removeAll();
Scheduler.getInstance().disable();
in your disabled periodic() method inside your main robot class. This will disable any command that's active when the robot is disabled.
__________________
http://team2168.org
Reply With Quote