Connecting mag encoder to spark max

Hello, we are trying to use a mag encoder as an absolute encoder via the spark max breakout board but we can’t get any real values. we connected the spark max via CAN.

How do we connect it to the breakout board?
How do you read the absolute position?

Thank’s in advanced, Ha-Dream team #3075

1 Like

We need more information to help.

How do you currently have it hooked up? What mag/absolute encoder are you using? I’m assuming the vex one?

Assuming it’s the mag encoder from vex, it states the absolute encoder interface is PWM. I don’t think either the talonSRX or spark max have the ability to read a pwm value on its data port, meaning you’ll need the pwm value from the encoder to go back to the roborio.

Alternatively, if you use the absolute encoder as an incremental encoder, you can hook that up to the data port, and also install a limit switch to zero it at a certain location. Depending on the application, that can be good. If it’s for something with continuous rotation however (like a swerve module for instance) it’s not very good.

Edit: As noted below - I apparently provided bad information and the srx can read a pwm input from the mag encoder

it’s the SRX Mag encoder (yes from vex). we connected it to the talon via the data port and it works, but we are trying to connect it to the spark as well (we are trying the neo motors out) and we don’t know if in the next years we will have talons on our robot.

The NEO encoder uses all three data lines (A/B/Index) which are normally used for the Mag encoder, so you can’t use them at the same time.

If you just need incremental position, the NEO encoder works well on its own.

Using external encoders on the Spark Max while it is in brushless mode isn’t supported yet.

https://trello.com/c/5DzjvCsj/46-ability-to-reconfigure-data-port-to-support-external-encoder-in-brushless-mode

1 Like

The TalonSRX does read the PWM input from the magnetic encoder.

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