Quote:
|
Originally Posted by asid61
I think your encoder stage should be fine, as long as you do the right math to convert it to true angle.
|
Quote:
Originally Posted by NowlingPro
With some simple gear ratio math I think we should be able to get the right angle.
|
Math? Yes. Simple? No.
I will give you that the SRX libraries and CTRE sensors make this easier by overflowing and counting ticks and keeping them across reboots but it's not as simple as multiplying by a gear ratio. You also need to account for the angle over time and deal with different offsets for each module. Not to mention that least-turn-angle is a lot easier to implement without all of this.
Also, keep in mind the processing power of the controller and the fact that you are multiplying calculations by 4 for all of the modules. Swerve is CPU intensive and anyone who says otherwise isn't logging that data or paying any attention to it. Also keep in mind the limitations of the closed loop calculations that you can do on the Talons. PID is a lot easier with 1:1.
There is a reason other swerve designs incorporate 1:1 turning encoders. Teams went crazy in 2015 trying to figure out how to do it for the AM Swerve modules. Triple Strange just posted a design that had some not-so-simple machining to do it. Check out the 221 site and you'll see 1:1 for turning on all of their designs and crab chassis. There is a reason for this. This is a bigger headache than folks seem to think.