View Single Post
  #6   Spotlight this post!  
Unread 03-02-2015, 07:34
restouffer's Avatar
restouffer restouffer is offline
Registered User
AKA: Bob Stouffer
FRC #2539 (Krypton Cougars)
Team Role: Mentor
 
Join Date: Jan 2014
Rookie Year: 2010
Location: Palmyra, PA
Posts: 11
restouffer is an unknown quantity at this point
Re: Talon SRX spamming forward and backward constantly

I think Wenry may be in class, so his responses will be a bit delayed. I was at the build last night and helped him with his troubleshooting, so I will take a stab at answering your questions.

@Asymons - I don't have direct access to the code that was being used (it hasn't been pushed to our repo yet), but the final test was really simple. I'll try to replicate it here.

We had a command with the following methods:
Code:
void TestTalonCommand::Initialize()
{
	drivetrain->setMotorSpeed(1, 0.5);
}

void TestTalonCommand::End()
{
	drivetrain->setMotorSpeed(1, 0);
}
The command requires the drivebase subsystem, and it uses the built in timing from Command to run for 0.5 seconds.

The setMotorSpeed method is in our subclass of RobotDrive, and implemented like this:
Code:
void Drive::setMotorSpeed(unsigned int motorID, float speed)
{
	motors[motorID]->Set(speed);
}
motors is a vector created in the constructor, and each object is instantiated with "new CANTalon(canID);", where there are different CAN IDs for each of our Talon SRXes.

The Talons are in kThrottle or kPercentVbus mode (Both are names for ControlMode 0).

@Munchskull - I was wondering about that, but since the robot uses CAN instead of PWM I didn't think normal calibration applied. At least, I couldn't find anything in the Talon SRX User Guide for calibrating the Talons for CAN. Do you have documentation on how we could do this?

@GeeTwo - All of the Talons have unique IDs in the web interface. They are also all using the latest (1.4) version of the firmware.

@Christopher149 - Yes. This is the part that is exceptionally puzzling. When the move command is sent (either by moving the joystick or by calling Set()) the motors begin moving. However, when the joystick is returned to center or the command ends, the motors do not stop until the robot is disabled.

Thanks to all of you for responding.