AM PG Gearbox actual ratio

This isn’t about motors, but AndyMark gearmotors. It seemed close enough to post in this forum.

For some time, it has bothered me a tiny bit that AndyMark does not publish the actual gear ratio of their PG27, PG71, and PG188 gear motors. Before the PG# were available with encoders, it was no issue at all, but now that they have encoders on a back shaft of the motors, there are certainly use cases where you might want to go multiple revolutions and know exactly which direction your output shaft is oriented. So, on my day off work yesterday, having way too many useful but boring things to do, my eye caught that PG71 I have leftover from another project, and which wound up in a “hub stand” on my kitchen table this week as I was working my current pet project. The metric allen keys were only a foot or so away, so I opened that gearbox up right there on the kitchen table (with a piece of corrugated cardboard to keep the table from getting petroleum grease on it) and counted some teeth.

The gearbox housing has a ring gear running from one end to the other (which is the only reasonable way to do a multistage planetary gearbox in a single block ring if you actually want to assemble it) of 46 teeth. The motor pinion has 17 teeth (this number is actually published on the AM site here as I had discovered previously, but I counted anyway 'cause that’s what I was doing). After separating the stages, I found that the sun gear of the middle stage has 11 teeth (which OBTW matches the motor pinion of this motor), and the output stage’s sun gear has 17 teeth, like the first. Curiously, this means that every planetary gear in the whole gearbox is built to have a pitch diameter corresponding to a half-integer number of teeth, as does the Vex VP 9:1 stage.

These numbers gives the PG71 an actual gear ratio of (46+17) * (46 + 11) * (46 + 17) / (17 * 11 * 17) = 226233 / 3179 ≈ 71.165. If you need more than five digits of precision, use the integer ratio! This means that there are not 497 encoder cycles per revolution as stated on the web site, but 498.15+.

OK, now I’m putting on my hacker/speculator/overclocker hat. I’m just sharing my computations, not standing by them! I’m going to include all of the gotchas I noticed, but I’m not offering any guarantees that I didn’t miss any! Speculation level increases from here onward…

I do not have any PG27 or PG188 gearboxes here at the house, but a bit of excel-fu turned up the following highly likely possibilities which are somewhat supported by and do not contradict any of the documentation I found on andymark.com:

After working up these two, of course it occurred to me to wonder what gear ratios could be cobbled together using these two reduction ratios. Let me note here that the sun and planetary gears of the first stage of the PG71 appear to be plastic, but the second and third stage are metal, so the first stage of a PG71 is not equivalent to its output stage, though it has the same gear ratio. There is also that top-end limitation for output torque of 39 ft-lb, which will shear the output shaft(‎†). Using an 11-tooth input for the final stage may reduce that top end (*). Those caveats noted, and with the stock gear ratios in bold:

This is one of those things that you never know you need until you have it. I don’t know how much of a difference it will make, since 71.165 is close enough to 71 (0.23%), but over multiple revolutions that difference might add up. We will be trying to use PG71s for swerve steering (since we already have them) so this might make a difference. Thanks.

By the way, you have a typo in the quote:

I think you meant PG188.

Agreed - over a single resolution, it’s only 50 minutes of arc, which is unlikely to matter in an FRC application, but after a few revolutions, the error accumulates.
You’re Welcome!

Yes, thank you! Fixed.

With a back of the napkin calculation, 400 output shaft revolutions will cause you to be ~1 revolution off.

That could definitely be significant if used in something like a swerve module steering system.

It really bothers me that they don’t have the exact ratio on their site - this is something that could cause some very annoying to debug issues that could be easily avoided by using the exact ratio.

You will have a 1 revolution error at ~214576 encoder cycles, which is 430.7424545+ revolutions, at which time you would think you have turned 431.7424547+ revolutions. Hopefully, you won’t be making that many turns in the same direction with a swerve drive in a few minutes, though with an index feeder this might happen. Note that the published 71:1 ratio is probably good enough if you supplement the encoder with an index sensor to correct your orientation every revolution. If you require a true measure of rotation angle, this is a good idea anyway to correct for any electrical noise or other source of encoder miscounts.

Or just use an absolute encoder after the reduction, which is what we are eventually hoping to do (once we get it working with the included relative encoder). That’s also more ideal for swerve since it can zero itself automatically.