Simplified Chain Tolerance Correction Pull Request

The purpose of this thread is to discuss the merits and drawbacks of changing (hopefully simplifying) the chain tolerance correction calculations in the Maslow firmware and GroundControl. These changes are in the following PRs


If you have an opinion about these changes, please go vote for it one way or another with either a :+1: or :-1: reaction to @MaslowCommunityGardenRobot’s comment on the Pull Requests.

1 Like

Here’s the description (copied from the PR):

This is another bit of code I found in @madgrizzle’s development branch. I believe this to be a solid simplification of how the chain tolerance correction works.

In the current system, GroundControl accepts a positive or negative percentage adjustment to adjust the chain tolerance for each chain (e.g. 1.3% if your chain is 1.3% longer than expected), it then turns that into a calculated value for distPerRotLeftChainTolerance by multiplying the adjustment by distPerRot . That value is then sent to the firmware, where it is divided by 2*Pi and stored as RleftChainTolerance . It’s then used in place of the sprocket radius R in the firmware for all calculations that involve the sprocket’s radius.

With this change, GroundControl continues to accept a positive or negative percentage adjustment for each chain (current settings will continue to work), but does no calculation on that value. Then that adjustment is sent to the firmware as leftChainTolerance . That tolerance value is simply multiplied by the calculated chain length to derive the adjusted chain length.

Additionally, I think this is maybe slightly more accurate. The current chain tolerance adjustment adjusts for the bit of chain that is still on the sprocket ( Chain1AroundSprocket ). I think the length of the chain around the sprocket is a function of the radius of the sprocket, and not the tolerance in the chain, though it’s likely not a big enough value to matter one way or another. It’s trivial to make this change account for that as well.

1 Like

@bar would you be able to take a quick look since you did the original implementation of this? It’s possible you had a reason for doing it that way that I’m not seeing

1 Like