Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Java (http://www.chiefdelphi.com/forums/forumdisplay.php?f=184)
-   -   Motor Moving While Set To Zero (http://www.chiefdelphi.com/forums/showthread.php?t=126081)

Joey1939 08-02-2014 18:12

Motor Moving While Set To Zero
 
We have a motor connected to a talon. In our code the Talon should always be set to full speed forwards/backwards or zero/off. Moving the motor forward or backwards works perfectly, but whenever the motor should be set to zero/off, it continues to move backwards slowly. Any insight would be greatly appreciated.

Here is part of the code for reference:
Code:

public class OI {
    public JoystickButton rollersIn;
   
    public OI() {
        rollersIn = new JoystickButton(rotateStick, 1);
        rollersIn.toggleWhenPressed(new RollersInCommand());
    }

Code:

public class  RollersInCommand extends Command {
    public RollersInCommand() {
        requires(Robot.arm);
    }

    protected void initialize() {
        Robot.arm.rollersIn();
    }

    protected void execute() {
    }

    protected boolean isFinished() {
        return false;
    }

    protected void interrupted() {
        Robot.arm.rollersStop(); 
    }
}

Code:

public class Arm extends Subsystem {
    SpeedController motor = RobotMap.armmotor;
   
    public void initDefaultCommand() {
    }
   
    public void rollersIn(){
        motor.set(-1.0);
    }
   
    public void rollersOut(){
        motor.set(1.0);
    }
   
    public void rollersStop(){
        motor.set(0.0);
    }
}


Joe Ross 08-02-2014 18:21

Re: Motor Moving While Set To Zero
 
What is the LED on the Talon doing when it is moving slowly?

heuristics 08-02-2014 21:19

Re: Motor Moving While Set To Zero
 
Try calibrating your Talon.

Joey1939 09-02-2014 12:42

Re: Motor Moving While Set To Zero
 
Quote:

Originally Posted by Joe Ross (Post 1339781)
What is the LED on the Talon doing when it is moving slowly?

The light is slowly flashing red.

Quote:

Originally Posted by heuristics (Post 1339850)
Try calibrating your Talon.

Okay. Thank you. I think that this will probably fix it.


All times are GMT -5. The time now is 09:30.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi