MK4i Swerve with Neos

Building an MK4i with Neos. How does the CANencoder get wired? Is it connected to the sparkmax? or does it get wired in the CAN bus? Thanks. (And if anyone has any general wiring tips for the MK4i with neos, that would be great, completely new at this, worked with falcons before).

the cancoder will be attached to the can bus like it normally would

2 Likes

The Sparkmax can not interface with the cancoder. You need to hook it to the CAN bus, then your code should “initialize” the internal encoder on the sparkmax on startup to read that value then you can continue closed loop on the sparkmax. Another option is just running closed loop on the RIO closing on the cancoder value (a little more latency but will work ok).

What if we were feeling a little crazy.

6 Likes

The CANcoder should be connected to the CAN bus, same as before. No need to involve the Spark Max.

That said, if you wanted to avoid the CAN bus (and having to run power to each encoder) for some reason, you can use other encoder options to talk directly with the Spark Max.

2 Likes

For wiring tips my team played around with mounting the spark maxes on a 3d printed on the side of the swerve module. I couldn’t find the CAD but here is a good thread on 3d printed spark max mounts:

1 Like

Thanks everyone. Super helpful. Appreciate it.

2 Likes

You can use: SRX Mag Encoder - CTR Electronics to directly wire them or sync the CANcoder with the spark max periodically

1 Like

You might find this thread useful (MK4i with NEOs too, but with Thrifty absolute encoders instead of CANcoders), so linking here:

Best (easiest) way to connect (wire and program) Thrifty Absolute Magnetic Encoder to REV SPARK MAX Motor Controller? - Technical - Chief Delphi

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