I have 3 CIM gearbox on each side… comment was made that i may need a y to connect 2 motor into 1 PWM port… i guess thats a limitation on the arcade class???
Since we are using Talon SRX with CAN bus, can i assume that i will just each motor separated in my RobotMap.java like this ?
public static final int
Drive_Left1 = 0,
Drive_Left2 = 1,
Drive_Left3 = 2,
Drive_Right1 = 3,
Drive_Right2 = 4,
Drive_Right3 = 5;
Our team also uses a 3 CIM gearbox on both sides for our drive train. Look into a slave/master setup. A CANTalon object can be set to follow another CANTalon object.
Section 9.1.3
Also, I don’t believe a y connector is legal (I could be mistaken).
PWM Y connectors are legal, a CAN master/slave setup is also legal. (comma splice, I know)
You need one motor controller for each CIM.
You need 6 motor controllers of the same type and settings.
If you go the PWM route, you will need a total of 4 PWM y connectors.
If you go the CAN route, you can simply daisy-chain all of them together, connecting one to the next, eventually connecting all 6 together in a line.
For CAN, unlike PWM, you need to set up your master/slave setup.
… basically slave the fifth and sixth talon outside of RobotDrive to the appropriate talons inside RobotDrive.
PWM is easier to work with in my opinion.
I argue CANTalon is easier than PWM. If a CANTalon misbehaves you can use the web-based config to determine why - without adding telemetry to your robot code.
A PWM motor controller will provide little feedback as to why it’s not doing what you want.
do i add these lines in my robot.java class? or to my robotmap.java class?
I am a little confused and very new to java…
I was trying to use Robotbuilder but gave up because the talon SRX are not available… since it feels that it has not been updated since 2013, i am assuming that some new sensors, actuators are missing and feel that i should just code from scratch and learn the hard way… (that’s my french sticking…)
I am now trying to follow the WPILIB docs and this video
Wish i could find a resource that explain what the class are for… These are my assumption… please correct if i am off…
robot.java --> main program, this is what call all other class/methods
robotmap.java --> where i define ports on Roborio, sensors, controller…
OI --> define my joystick and human interface…
I then create subsystem class in which i call the robotmap.java to get the hardware settings …
public class RobotMap {
public static CANTalon _frontLeftMotor = new CANTalon(11); /* device IDs here (1 of 2) */
public static CANTalon _rearLeftMotor = new CANTalon(13);
public static CANTalon _frontRightMotor = new CANTalon(14);
public static CANTalon _rearRightMotor = new CANTalon(15);
/* extra talons for six motor drives */
public static CANTalon _leftSlave = new CANTalon(16);
public static CANTalon _rightSlave = new CANTalon(17);
then in my DriveTrain_Subsystem class
private RobotDrive MainDrive = new RobotDrive(RobotMap._frontLeftMotor, RobotMap._rearLeftMotor, RobotMap._frontRightMotor, RobotMap._rearRightMotor);
I added the joystick line in my OI.java class
Joystick _joy = new Joystick(0);
and finally, added the following to my Robot.java class… unfortunately it will not resolved the DriverJoystick …
public void teleopPeriodic() {
Scheduler.getInstance().run();
double forward = DriverJoystick.getRawAxis(1); // logitech gampad left X, positive is forward
double turn = DriverJoystick.getRawAxis(2); //logitech gampad right X, positive means turn right
DriverJoystick.arcadeDrive(forward, turn);
}
Any help would be appreciated… i think once i resolve how ot properly use the Talon SRX CAN then i can keep going… until then i am kinda stuck…
You should just use two motor controllers to create your RobotDrive, one for the left and one for the right, and not four. Then set up the other two left side motors as followers of the one left side motor you used to create RobotDrive. Do the same for the right side.
You do not show your code where you actually set up any motors to be followers. It is well documented in the manual that was linked in a prior post.
Edit: I am assuming here that all three motors on one side are on the same gearbox.
Then, just use your two masters (one left and one right) to create your RobotDrive object (it has a constructor that just takes one left and one right motor) and you have it.
Omar, Not, RobotBuilder does not have Talon…
We coded everything without Robotbuilder as we could not find a great instruction to update RobotBuilder… We are pretty new and really not comfortable with Java / Eclipse / GitHub and everythign else yet…:ahh: :ahh: :ahh:
It just occurred to me you never actually described any failure symptoms other than [1] missing-talon-in-robotbuilder.
[2] So I’m guessing your problem is that the code doesn’t build?
If [1] and [2], then you likely never installed the CTRE Toolsuite which installs the API for CANTalon, and the RobotBuilder additions for CANTalon. Is that possible?
finally got it to work with the help of FIRST Help Now this weekend… the code link you provided from Github is working well… but because i am a java newbie, i missed the slave setup from which master to follow…
I though i did download the CTRE suite… obviously i missed a step… will redo tonight.