Swerve Code help

Team 8086 here. We have a question. Disclaimer: we are new to using CAN wiring.
We have the MK4 sds swerve modules with NEOs and CANcoders. We plan on using CAN wiring in the sequence drive motor → CANcoder → steering motor → the next module etc. Will this work? I read that you can’t connect Spark maxs to CANcoders (that is how I interpreted it). If this is not possible, how would you suggest we wire this? We’re just trying to see if we need to “swerve” and try a different approach to our drive wiring…
RoboWarriors out.

You cannot attach cancoders directly to sparkmax’s you can attach canandcoders to sparkmax’s.

Have you checked out YAGSL to help with your code?

You could also be using MagEncoders which if so is a massive pain to directly connect to Sparkmaxes

1 Like

Our code is working, atleast it will build and deploy. I think we just need to figure out the wiring.
Will we need to connect the sparks to PWM? Is it possible to have a sparkmax CAN circuit and also a CANcoder circuit?

Yes you can have all CAN devices on the same bus. So Sparkmaxes and CanCoders can all plugged together works great. Order doesn’t matter. It just needs to start with Rio and end with PDH/PDP.

1 Like

So just to clarify, nstrike said I can’t directly connect the CANcoder to a Sparkmax. But you said I can connect them on the same bus.
Could you explain the difference?

Sparkmaxes have a special port for external devices mostly for limit switches or encoders. Some teams believe you can connect CANcoders to that special port. But you cannot.

You can connect them to each other on CAN though.

Thank you, that helps a ton.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.