Conversation
Wheel diameter and track were measured with a caliper on a v3: 44 mm and 78 mm, against the 40 mm and 90 mm both drivers carried. Only v3 was measured, so v1 and v2 keep the old values rather than inherit a reading nobody took on them. Encoder counts per revolution is unchanged and still unverified, so distances remain provisional. AI-assisted: Claude Opus 5
A 7 PPR encoder decoded x4 gives 28 counts per motor shaft revolution and 1400 per wheel revolution, against the 12 both drivers carried. A v3 pushed by hand through one wheel turn read 1399 and 1401 on the two wheels, so every odometric distance shrinks to 43% of what it was. Only v3 was measured, so v1 and v2 keep 12. AI-assisted: Claude Opus 5
AI-assisted: Claude Opus 5
This was referenced Aug 28, 2026
Merged
Contributor
Author
|
Superseded by #28, which carries these three commits unchanged plus the sensor lever arm, the geometry getter and a motor brake. Closing so there is one branch to review. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The dimensions were in three places and all three disagreed
drv/move/move.canddrv/control_loop/control_loop.ceach carried their owncopy of the wheel diameter, gear ratio, encoder resolution and track, and
PyDotBot's simulator carries a third in Python. The two C copies agreed with
each other and both were wrong; the simulator was closer.
Bench measurements on a v3 settle all three open numbers:
Track is carried as 78 rather than the raw 77 so the C and Python models
agree exactly. The encoder figure comes from
01bsp_qdecwith the robot pushedby hand through one wheel turn, twice: 1399/1401 and 1408/1392, both runs
averaging 1400.0, all four readings within 1.14%. That is 28 counts per motor
shaft revolution over the 50:1 reduction, which is a 7 PPR encoder decoded x4.
The nearest alternatives are 15% away, so nothing else fits. An earlier hand-turn
reading of about 14300 counts per wheel revolution is superseded: it corresponds
to roughly ten wheel revolutions rather than one.
Net effect on behaviour: every odometric distance drops to 43% of what the
firmware previously computed, and the heading integration was under-rotating by
14% from the track alone. Nothing that consumes odometry was correct before this.
Why the header is under drv/ and not in bsp/conf/
These values are per-board, so
bsp/conf/dotbot_v3_config.his the obvioushome, and it does not work.
control_loop.cis also compiled on the host forPyDotBot's simulator, and that build puts only
drv/on the include path;reaching
bsp/conf/means going throughboard_config.h, which pulls ingpio.hand the nRF headers. The header therefore keys off the sameBOARD_DOTBOT_V*macros but stays free of hardware dependencies. There is acomment saying so, because moving it is the natural thing to try.
v1 and v2 are deliberately unchanged
Only a v3 was measured. v1 and v2 keep 40 mm, 90 mm and 12 CPR in the
#elsebranch, because applying a v3 caliper reading to boards nobody put a caliper on
would be an assertion rather than a measurement.
Also here
control_loop_get_geometry()exports the compiled constants so a host holdingits own copy can check the two against each other. PyDotBot has a test that uses
it; that test skips against a library predating this change, so the two can land
in either order.
Validation
Host build with
BUILD_WITH_EKF=ONlinks clean. SESBUILD_TARGET=dotbot-v3 make 01drv_movelinks clean under-Werror -Wall -Wextra. Values were checkedby compiling and printing them per board rather than reading the source: v3 gives
44 / 78 / 28 / 50 and 0.098736 mm per count, v1 and v2 give 40 / 90 / 12 / 50 and
0.209440.
clang-format -style=fileclean.Not validated on a moving robot. What stays unproven is the encoder count at
speed: a hand push is slow, so it cannot show sample-rate loss, and
db_qdec_initleavesSAMPLEPERat its 128 us reset default, which at 28 CPRgives roughly 20x margin at full motor speed. The signature if that is wrong is
driven odometry reading consistently short of 10128 counts per metre.