MK4i Angle Gear Ratio as Decimal

Can someone help me understand how to render the mk4i turn motor gear ratio as a decimal?

The gear ratio for the angle motor is listed as 150/7:1. How is that made into a decimal? Would it be 1/(150/7) or .04667? Or does it just mean 150/7 which is 21.4286?

The 150/7:1 is indicating that for every 150 spins of the motor shaft, the swerve module will spin 7 times. So, both decimal values are correct, just the units are different. 0.04667 swerve rotation / motor rotations or 21.4286 motor rotations / swerve rotation.

Which one you use would be context dependent.

1 Like

It depends which way you’re trying to go.

If you’re converting from output shaft (azimuth) rotations to motor rotations, then multiply by 150/7. If you’re converting from motor rotations to azimuth rotations, then multiply by 7/150.

1 Like

Thank you. I’m still not sure how to implement it.

I’m trying to calculate the conversion factor for the YAGSL swerve library. Here is the formula:

360 / (angleGearRatio * pulsePerRotation)

Given that the cancoder’s pulsePerRotation = 1, I’m guessing this would end up as:
360 / (.04667 * 1)

Or did I get it backward? If it’s not obvious, I’ll ask the author.