Andymark Swerve Programming

Has anyone used the COTS Andymark swerve module with a CIM as drive and a PG motor and encoder to turn? I am having trouble figuring it out using the PG Encoders. If anyone can help me out that would be appreciated.

And we already have a comp bot, just trying to get this working for next year

The PG motors have quad encoders built into them, so you can know how much a given wheel has turned relative to some previous position. This means that you should also get an absolute encoder. For that, I’m gonna link to the thread I always link to: How to measure angles larger than 360 degrees by MA3 encoder? - #12 by retrodaredevil

Basically, the quad encoder is fine to use during the match, but you should use an absolute encoder to “zero” the quad encoder’s position. If you do PID calculations on the RoboRIO, then you might as well not even use the quad encoder. The quad encoder is nice to use with a Talon SRX’s onboard PID control.

I’m not sure if the quad encoders on the PG motors vary in encoder counts per revolution or if the gear ratios on the Andymark swerve modules have varied year to year. Most of the time I find that turning the wheel 360 degrees is 1657 encoder counts, but one year it was 628 encoder counts. You can use Phoenix Tuner to see the encoder counts if you have the quad encoder plugged into a breakout board on the Talon SRX. There’s many different ways to plug in the quad encoder, that’s just the way we did it.

What are you having problems with exactly? Were you able to see the encoder counts go up/down?

Havent had a chance to get the code on an actual robot yet. I have a skeleton written but something didn’t seem right with how it should work

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