Hello! We just got our chassis assembled and running Mecanum drive code, and we’ve hit an impasse. Actually two of them. First, the talons all receive a signal and ‘twitch’ when they are not supposed to be receiving a signal and more so when at least one of them is. It causes the robot to ‘creep’ when enabled but not being controlled. We are going to try to calibrate them with our controller today, but it happens when no controller is plugged in, so it’s a bit unnerving. It doesn’t severely mess with driving, though. The other problem will hopefully be fixed with calibration. The motors spin about 50% faster in reverse than they do while going forward (meaning that the robot will arc while strafing and strafe a little while driving). Does anyone know if these are things that should/can be adjusted within the program or if these are caused by bad Talons (probably not)/sidecar/PWM cables? Do other people have this issue? Thanks!
Make sure you’re using the right Talon objects in code, as RobotDrive will create Jaguars by default. Posting language info/code could be helpful.
Thanks for your reply My code is located on this thread (I decided to ask on the current thread because I was hoping It would be read by more electrical-oriented people). I know the motors are initialized in the wrong order, but that shouldn’t cause the problem, right?
We had a problem with motors twitching last season and yes they were controlled by Talons, however the problem turned out to be a fried component in the DSC. My not be your problem but if you have another DSC it is worth a try to swap it in.
I never got to use the Talon SR, but your problem sounds like a faulty wiring problem, check for shorts (both in the power cords and information cords =PWM]), make sure your PWMs are all in the correct places and aren’t flipped over (it shouldn’t cause your problem but won’t hurt to check anyway), make sure there aren’t any jumpers next to your PWMs in the DSC.
Also, I know very little about programming so I can’t explain this, but in 2012 our robot moved without command once when it was enabled, and our programmer said something about dividing in 0. Dunno where or why it made that happen.
Can you post what the code should look like to control a drive with talons?
By drive I assume you mean a robot drivetrain? That depends on what language you are using. Here’s a quick example in Java:
import edu.wpi.first.wpilibj.*;
/**
* Simple example of how to use Talons to control a drivetrain
*/
public class TalonExample extends IterativeRobot {
private Joystick joystick = new Joystick(1);
private Talon leftMotor = new Talon(1);
private Talon rightMotor = new Talon(2);
// Pass the RobotDrive constructor the two Talon objects we created
private RobotDrive drive = new RobotDrive(leftMotor, rightMotor);
public void teleopPeriodic() {
drive.arcadeDrive(joystick.getY(), joystick.getX());
}
}