Drive arcade and Can Bus

Hello . Our team are buliding mars rover for European Rover Challange (ERC) and we use Roborio as well. I want to control 16 Victor Spx over Can Bus cuz Roborio doesn’t have enough PWM ports. Is ther any way to use arcade drive and Can bus ?

Arcade drive is simply a certain way of mapping your driver’s joystick inputs to motor speeds. The SPXs (as well as all CAN-based motor controllers in FRC) support setting arbitrary velocity and motor output power over CAN - you can use any drive control scheme you want.

2 Likes

First of all, you can get up to 20 PWM ports on the roboRIO using an MXP expansion board. (e.g. navX, SpartanBoard, MoreBoard, etc)

With that out of the way, you can definitely use 16 Victor SPXs on one robot controlled by a roboRIO. So long as you’re careful about not overloading the CAN bus, you shouldn’t have any problem.

As far as arcade drive, that just has to do with how the robot is programmed. You can use the default WPILib ArcadeDrive (or roll your own) to control one victor on each side of the drivetrain, then set the rest to follow those.

1 Like

So only have to declare can id in phoenix tuner and i can use it like normal pwm or need diffrend commands?

i mean how to delcare
this pwm to can
leftFrontVictorSP = new VictorSP(1);

You can just change it to
leftFrontVictorSPX = new WPI_VictorSPX(1); where 1 would be your CAN id and everything else should work the same. Make sure to include the CTRE library in your project though

1 Like

tyvm