-
Notifications
You must be signed in to change notification settings - Fork 40
Add Recirculation Current Decay Mode Setter/Getter #54
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
Conversation
Add recirculation current decay mode to throttle control; add decay mode setter/getter; default to fast decay (coasting mode) to preserve performance of legacy applications
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One minor thing. Looks good otherwise. Thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, one more thing to improve the docs. Thanks!
Co-authored-by: Scott Shawcroft <scott@tannewt.org>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
Thanks for your help, @tannewt! |
Updating https://github.com/adafruit/Adafruit_CircuitPython_ESP32SPI to 3.5.7 from 3.5.6: > Merge pull request adafruit/Adafruit_CircuitPython_ESP32SPI#128 from adafruit/anecdata-patch-2 > Merge pull request adafruit/Adafruit_CircuitPython_ESP32SPI#126 from adafruit/anecdata-patch-1 Updating https://github.com/adafruit/Adafruit_CircuitPython_LTR390 to 1.1.0 from 1.0.3: > Merge pull request adafruit/Adafruit_CircuitPython_LTR390#3 from CedarGroveStudios/main Updating https://github.com/adafruit/Adafruit_CircuitPython_Bitmap_Font to 1.3.7 from 1.3.6: > Merge pull request adafruit/Adafruit_CircuitPython_Bitmap_Font#41 from jepler/use-bitmaptools-readinto Updating https://github.com/adafruit/Adafruit_CircuitPython_datetime to 1.1.2 from 1.1.1: > Merge pull request adafruit/Adafruit_CircuitPython_datetime#7 from brentru/fix-failing-tests > Merge pull request adafruit/Adafruit_CircuitPython_datetime#6 from cognitivegears/master Updating https://github.com/adafruit/Adafruit_CircuitPython_ImageLoad to 0.14.0 from 0.13.3: > Merge pull request adafruit/Adafruit_CircuitPython_ImageLoad#45 from kmatch98/master > "Increase duplicate code check threshold " > Merge pull request adafruit/Adafruit_CircuitPython_ImageLoad#46 from adafruit/tests-linting Updating https://github.com/adafruit/Adafruit_CircuitPython_Logging to 1.2.8 from 1.2.7: > Merge pull request adafruit/Adafruit_CircuitPython_Logging#18 from dastels/master Updating https://github.com/adafruit/Adafruit_CircuitPython_Motor to 3.3.0 from 3.2.8: > Merge pull request adafruit/Adafruit_CircuitPython_Motor#54 from CedarGroveStudios/master
Added the ability to selectively change DCMotor's default FAST_DECAY recirculation current decay mode (coasting mode) to SLOW_DECAY mode (braking mode) to significantly improve motor performance and throttle/speed linearity. For integrated motor controllers such as the TB6612 and DRV8833, switching to SLOW decay mode also reduces sensitivity to higher (>500Hz) PWM frequency. When coupled with a lower PWM frequency such as 25Hz, SLOW_DECAY mode increases torque at low motor speeds and contributes to a very low spin threshold speed.
FAST_DECAY will remain as the default decay mode for compatibility.
Usage example:
The braking mode change was successfully tested with TB6612 and DRV8833-based motor controllers (Crickit, MotorWing, MotorSheld, and various breakouts) as well as discrete h-bridge circuitry (such as L9110) using CircuitPython 6.1.0.
After this PR is finalized, I will completely rewrite the Improve the Low Speed of Brushed DC Motors learning guide to elaborate on the new recirculation current decay mode improvements.
A big thank you goes to @ZodiusInfuser for the initial idea thread and subsequent discussions.
(reference: https://github.com/adafruit/Adafruit_CircuitPython_Motor/issues/53