So we have a huge problem. Our victors and motors don’t work. first of all when we Initially start the robot a victor plugged into that’s not even in loaded or initialized in the code starts to run. Secondly the victors only work when they are part of a RobotDrive object, so we can’t control the victors individually and only ports 1-4 of our digital sidecar work. Then if we try to control a victor plugged into ports 1 2 3 or 4; the only ports that appear to work, I can’t control them manually unless they are part of a Robotdrive object. I know that this isn’t a software problem, nor is there any problem in a crio or sidecar as we have switched the old sidecar and crio with our current ones and this issue still occurs. Any ideas would be appreciated.
Chek the pwm wires. We went thru 3 sets of pwms before we got our working the other day. Try replacing thoose wires. Also make your connections are in the right place
we did, we change them over 2 times. But whats weird is that they only work when part of a RobotDrive. I can’t control any victor individually with victor.set() , only with a RobotDrive. any ideas on that?
I attached all our code below, but the part with the motors I pasted. This is our current set up with the RobotDrive patch. Looking at all our code would probably be easier though. Thanks a ton.
What I want to do is connect all 10 victors and be able to control it with:
victor.set(value);
public class RobotTemplate extends IterativeRobot {
//Victor leftBackMotor = new Victor(1,2);
Victor rightBackMotor = new Victor(1,3);
//Victor leftFrontMotor = new Victor(1,1);
Victor rightFrontMotor = new Victor(1,4);
//Victor topJag = new Victor(1,6);
Victor bottomJag = new Victor(1);
Victor topJag = new Victor(2);
//RobotDrive drive = new RobotDrive(bottomJag, topJag);
RobotDrive drivetrain = new RobotDrive(topJag, rightBackMotor, bottomJag, rightFrontMotor);
AltPID topPID = new AltPID();
//Joysticks
Joystick white = new Joystick(2);
Joystick black = new Joystick(1);
public void robotInit() {
topPID.RPMInit();
topPID.setInputRange(0, 5000);
topPID.setTolerance(15);
AxisCamera.getInstance().writeCompression(20);
AxisCamera.getInstance().writeBrightness(20);
AxisCamera.getInstance().writeResolution(AxisCamera.ResolutionT.k640x480);
AxisCamera.getInstance().writeColorLevel(50);
drivetrain.setSafetyEnabled(false);
drivetrain.setInvertedMotor(RobotDrive.MotorType.kFrontLeft, false);
}
/**
* This function is called periodically during autonomous
*/
public void autonomousPeriodic() {
}
/**
* This function is called periodically during operator control
*/
public void teleopPeriodic(){
double rpmTop = topPID.getRPMTop();
double rpmBottom = topPID.getRPMBottom();
drivetrain.tankDrive(white.getY(), black.getY());
SmartDashboard.putDouble("TOP Victor", topJag.get());
SmartDashboard.putDouble("Top RPM", rpmTop);
SmartDashboard.putDouble("Bottom RPM", rpmBottom);
SmartDashboard.putDouble("Bottom Victor", bottomJag.get());
while(white.getRawButton(3)){
rpmTop = topPID.getRPMTop();
rpmBottom = topPID.getRPMBottom();
SmartDashboard.putDouble("TOP Victor", topJag.get());
SmartDashboard.putDouble("Top RPM", rpmTop);
SmartDashboard.putDouble("Bottom RPM", rpmBottom);
SmartDashboard.putDouble("Bottom Victor", bottomJag.get());
drivetrain.tankDrive(topPID.calculate(20, rpmTop), topPID.calculate(20, rpmBottom));
}
}
}
```<br><br><a class='attachment' href='/uploads/default/original/3X/8/2/8270472e59295a3396a32737fb2fa5d407f06068.zip'>Roubun Rumble.zip</a> (1.01 MB)<br><br><br><a class='attachment' href='/uploads/default/original/3X/8/2/8270472e59295a3396a32737fb2fa5d407f06068.zip'>Roubun Rumble.zip</a> (1.01 MB)<br>
Have you tried picking the robot up off the ground and just done victor.set(.5) instead of going thru all your processing code. you could even unplug the motors from the victors and the lights will still change if everything is going right. that will tell you if its a programing problem. Also, when you enable the robot all the lights on the victors should be solid. If they are still blinking then you got a wiring problem
are you sure that you are powering the sidecar correctly? it sounds like a problem i read in a different thread where they had the sidecar plugged into the wrong place or it wasent being powered at all
If you’re only capable of accessing PWMs 1-4, it’s most likely the case that you have not connected the necessary 12V power supply to the DSC, and are generating signals by virtue of leakage through the 9403.
Have you appropriately repaired your ribbon cable per FIRST’s instructions? A large quantity of cables distributed in the KoP were assembled backwards, which can also cause the problem you describe.
A brief glance at your code also tells me that either 1) you like referring to Victors in code by naming them Jaguars or 2) you’re not initializing Jaguars properly; there is a Jaguar object that you should be using to control Jaguars; you shouldn’t be using the Victor object.