-
-
Notifications
You must be signed in to change notification settings - Fork 117
Driver DRV8825 for stepper motor was added #1407
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
base: develop
Are you sure you want to change the base?
Conversation
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters (5)
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including You can disable this status message by setting the WalkthroughThree new files were added under Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes ✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
devices/Drv8825/version.json (1)
8-12
: Releasing fromdevelop
may expose unstable codeIncluding
^refs/heads/develop$
inpublicReleaseRefSpec
means every build from the develop branch is treated as a public (non-prerelease) package. Most repos keepdevelop
for integration and reservemain
/version tags for release artifacts, letting CI append a pre-release label (e.g.-alpha
). Consider either:
- Removing
develop
from the list, or- Adding a
release
: false / prerelease scheme for develop to prevent accidental public pushes.Example minimal change:
- "^refs/heads/develop$", + "^refs/heads/develop$" // remove or turn into prerelease patternUp to project policy, but worth a second look.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (16)
devices/Drv8825/Direction.cs
is excluded by none and included by nonedevices/Drv8825/Drv8825.cs
is excluded by none and included by nonedevices/Drv8825/Drv8825.nfproj
is excluded by none and included by nonedevices/Drv8825/Drv8825.nuspec
is excluded by none and included by nonedevices/Drv8825/Drv8825.sln
is excluded by none and included by nonedevices/Drv8825/Drv8825_circuit_bb.jpeg
is excluded by!**/*.jpeg
and included by nonedevices/Drv8825/MicrostepsController.cs
is excluded by none and included by nonedevices/Drv8825/Properties/AssemblyInfo.cs
is excluded by none and included by nonedevices/Drv8825/README.md
is excluded by!**/*.md
and included by nonedevices/Drv8825/Settings.StyleCop
is excluded by none and included by nonedevices/Drv8825/StepSize.cs
is excluded by none and included by nonedevices/Drv8825/packages.config
is excluded by none and included by nonedevices/Drv8825/samples/Drv8825.samples.nfproj
is excluded by none and included by nonedevices/Drv8825/samples/Program.cs
is excluded by none and included by nonedevices/Drv8825/samples/Properties/AssemblyInfo.cs
is excluded by none and included by nonedevices/Drv8825/samples/packages.config
is excluded by none and included by none
📒 Files selected for processing (3)
devices/Drv8825/category.txt
(1 hunks)devices/Drv8825/packages.lock.json
(1 hunks)devices/Drv8825/version.json
(1 hunks)
🔇 Additional comments (5)
devices/Drv8825/category.txt (1)
1-1
: Category looks correctThe device is appropriately categorized as "motor". No further action required.
devices/Drv8825/packages.lock.json (2)
29-40
: Consider marking build-only tools as PrivateAssets to avoid bloating the deployment image
Nerdbank.GitVersioning
andStyleCop.MSBuild
are build/analysis-time tools. When they appear as direct package references the nanoFramework project will carry them into the lock file, but unlessPrivateAssets="all"
(ordevelopmentDependency="true"
) is set in the<PackageReference>
the assemblies are copied to the target and increase flash/RAM usage on MCU targets for no benefit.Please double-check the corresponding
csproj
:<PackageReference Include="Nerdbank.GitVersioning" Version="3.7.115" PrivateAssets="all" /> <PackageReference Include="StyleCop.MSBuild" Version="6.2.0" PrivateAssets="all" />If those attributes are already present you can ignore the warning; otherwise consider adding them and regenerating the lock file.
1-49
: Lock file LGTM – exact pinning matches nanoFramework guidanceAll runtime packages are pinned to exact patch versions with content hashes, ensuring deterministic builds — exactly what nanoFramework recommends. No anomalies spotted.
devices/Drv8825/version.json (2)
3-3
: Patch component is implicit – confirm that this is intentional
"version": "1.1"
resolves to1.1.0
under NBGV.
If you intend to ship the very first patch (-preview or ‑beta later) this is fine; if you expected1.1.x
to be auto-incremented you need to bump the third component manually or rely onversionHeight
.
1-16
: Versioning file otherwise looks consistentSchema reference, numeric-identifier padding and cloud-build variable propagation are all in line with the repo’s other device libraries.
devices/Drv8825/README.md
Outdated
|
||
1A, 1B, 2A, 2B - connect to the 4 coils of motor | ||
|
||
DIR - connect to microcontroller pin |
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.
Would be good to expand this to include a simple description. Perhaps even from the data sheet.
DIR - Connect to microcontroller output pin, sets the direction of stepping. Internal pulldown
STEP - Connect to microcontroller output pin, rising edge causes the indexer to move one step. Internal pulldown.
RST - Connect to microcontroller output pin, active-low, reinitializes the indexer logic and disables H-bridge outputs. Internal pulldown.
SLP - Can be joned to RST or left high to enable the device. Low puts the device to sleep.
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 for you review! I'll work on it later and i'll improve documentation
devices/Drv8825/README.md
Outdated
|
||
RST — join with SLP and connect to microcontroller pin or to 3.3-5V | ||
|
||
Logic power supply can be connected to FAULT pin, it will works, but it useless. |
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.
FAULT - Logic low when in fault condition (overtemp, overcurrent). Connect to Microcontroller input with pullup.
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.
I don't believe connecting FAULT to Vcc is the correct thing to do according to the datasheet that's an output which is pulled low for fault conditions. So if there is a fault connecting it to Vcc will cause it to short circuit the powersupply.
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.
Well, I understand your concern. However, according to the datasheet:
Note that the carrier includes a 1.5k protection resistor in series with the FAULT pin that makes it is safe to connect this pin directly to a logic voltage supply, as might happen if you use this board in a system designed for the pin-compatible A4988 carrier
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.
So that is specific to the module you are using rather than the driver chip itself. The link below has a simpler circuit where FAULT is not connected which might be a better option, or perhaps the high level wiring diagram on the TI datasheet.
Description
Motivation and Context
DRV8825 is a stepper motor driver that is made as compatible as possible with A4988, but there are some nuances. I tried to use the A4988 library to work with my DRV8825 driver, but the driver did not work correctly. After little investigation, I realized that despite the same connectors, this driver is more capricious to the control signal. Thus, I wrote a library to control the stepper motor through the DRV8825 driver.
How Has This Been Tested?
When I written a new library, I tested it several times through a sample project with my ESP32 WROOM(rev 3), DRV8825 and Nema 17 (stepping motor) to make sure that the motor does not miss steps.
Screenshots
Types of changes
Checklist:
Summary by CodeRabbit