Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix-encoder-pipeline #929

Merged
merged 1 commit into from
Sep 2, 2021
Merged

fix-encoder-pipeline #929

merged 1 commit into from
Sep 2, 2021

Conversation

Ezward
Copy link
Contributor

@Ezward Ezward commented Aug 31, 2021

  • the complete.py template hooked up the encoder parts
    using hard-coded value for mm_per_tick and ignored
    the configuration for MM_PER_TICK.
  • The RotaryEncoder was also using a default
    value for the poll_delay so polling was incorrect
    in anything except the default vehicle loop rate.
  • This commit fixes the building of the pipeline
    in complete.py to use the correct configuration.
    It also calculates the poll_delay for the RotaryEncoder
    based on the DRIVE_LOOP_HZ configuration.

- the complete.py template hooked up the encoder parts
  using hard-coded values or defaults and ignored
  the configurations for MM_PER_TICK and ODOM_DEBUG.
- In addition, the RotaryEncoder was given a
  hard coded value for the pin rather than use ODOM_PIN.
- Finally, the RotaryEncoder was also using a default
  value for the poll_delay so polling was incorrect
  in anything exception the default vehicle loop rate.
- This commit fixes the building of the pipeline
  in complete.py to use the correct configuration.
  It also calculates the poll_delay for the RotaryEncoder
  based on the DRIVE_LOOP_HZ configuration.
@Ezward Ezward self-assigned this Aug 31, 2021
@Ezward Ezward requested a review from DocGarbanzo August 31, 2021 07:03
@TCIII
Copy link
Contributor

TCIII commented Aug 31, 2021

I integrated Ezward's updated complete.py into my DC v 4.3, created a new mycar, and verified that it ran without error.
In myconfig.py I was able to set the "MM_PER_TICK = 25.9347" in the "ODOMETRY" and I was able to set "STEERING_PWM_INVERTED = True" in "STEERING FOR PIGPIO_PWM OUTPUT".
Running manage.py drive resulted in a "Distance Travelled" of ~5238 mm which is within less than a 1 percent deviation from the calculated value. Also I was able to observe correct differential steering of my 6WD robot chassis whether it was being controlled by my RC transmitter or the output of my SBC Rpi 4B.

Copy link
Contributor

@DocGarbanzo DocGarbanzo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@DocGarbanzo DocGarbanzo merged commit 6479fed into dev Sep 2, 2021
@Ezward
Copy link
Contributor Author

Ezward commented Sep 4, 2021

Fixes #925

@Ezward Ezward deleted the fix-encoder-pipeline branch September 4, 2021 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants