Will victors work with spark max

So our robot currently uses 4 spark Max motor controllers and 4 CIM motors (they are kop parts) but we want to change 2 of the spark MAX motor controllers with Victor SPX’s will it work fine (the Spark MAX’s we want to change are coloured blue on the image

You should be fine to use Victors there.

how can we wire them with sparks then

This is nitpicky, but those are motor controllers, not encoders. The encoders are sensors that can be attached to the motor controllers to provide feedback from the motors it’s controlling. The Victors are compatible motor controllers, but they use a different code library than the spark maxes.

Phoenix-Examples-Languages/Robot.java at master · CrossTheRoadElec/Phoenix-Examples-Languages · GitHub this example shows the very very basics for switching to the talonSRX or Victor SPX motor controllers

Just change WPI_TalonSRX to WPI_VictorSPX

To answer the wiring question you can still use the same style of CAN chain for the data wires. You will have to firmware update and update the ids of the new victor spxs in Phoenix Tuner.

The motors attach to the M+ and M- ports and the V+ and V- go to the PDP same as the spark Max. Idk if you have actual encoders but the victorSPX doesn’t support built in encoders while the spark Max does through it’s external data port.

Something to think about is you will probably (someone else can correct me on this) be running the motors at different speeds without realizing it. Because the KOP chassis and gearbox uses 2 motors if you mix and match motor controllers like you are suggesting for only 1/2 you will need to trial and error the speed differences between the victorSPX and the spark maxes. You should swap all of them or do both on one side. Not split two motor controller types on one gearbox. That’s asking for a headache later when the gears inside are moving at slightly different speeds.

so you are telling me that we can wire them daisy chain type but the motors will move at diffrent speeds and it will be a headache for the coding part

It’s possible; I don’t know how the linearity compares between the two, but I’ve seen it happen. Having the same set of controllers from one side of the drivetrain to the other helps though; even if it’s weird, it’ll be consistently weird.

If you need more motor controllers, why not keep the SPARK MAX where it is and use the Victor/Talon on some other mechanism?

Kind of, it’s definitely doable and we’ve had to do similar before. It’s not impossible, but also wanted you to have all the facts before you go through the switch only to realize a bunch of new problems crop up. Its not terribly difficult to do, but idk what the main reason for needing to switch them is. If it was for my own team I would tell them to take out the sparks on the left side and put em only on the right, then you can use the built in encoders on the right side to try and match/limit the speed to whatever the victors in the left can manage.

If you have an external encoder for the left side (there’s a cheap kop gearbox encoder that’s also free with first choice iirc) you can get the current rpm of that side and control them both properly and you won’t even know they are physically different. Code wise it’s a bit of a jump but if you’re using the WPI differential drive the only change is to what motors you are putting in the motor controller groups and how you get the rpm data back out. Definitely doable and maybe a 2 day project for our team.