-
Notifications
You must be signed in to change notification settings - Fork 114
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
Microstepping has been added for bipolar (2 and 4 wire configuration) stepper motor. #5
base: master
Are you sure you want to change the base?
Conversation
stepper motor. Microstepping requires the ENABLE/PWM pins of the H bridge chip connected to the MCU pins.
Nice, please merge this. |
Tested on a NEMA17 motor with a esp12e motor shield and a NodeMcu 1.0 and works like a charm. Please merge this. I'm using @Attila-FIN fork meanwhile |
Attila Kovács seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
if (this->micro_stepping) { | ||
this->micro_step_delay = step_delay / number_of_micro_steps; | ||
// the PWM signal frqequency is proprtinal to the RPM | ||
analogWriteFreq(whatSpeed * 100); |
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.
// analogWriteFreq(whatSpeed * 100);
I get two errors with this implementation:
How would I resolve these errors? |
@jcarta and anyone else having this issue => analogWriteFreq is ESP8266 only function so this PR will only work on ESP8266. |
In an attempt to adjust some numerical values on an older sketch I am facing a compilation error: "'PWMRANGE' was not declared in this scope". I am microstepping a 28BYJ-48 with a NodeMCU ESP8266 (ESP-12E) and a L293D Motor Shield. Everything would compile, upload and run without problems with older version of Arduino IDE (not sure which one, it's been a while) and this version of the Stepper library. Any ideas, please? EDIT: I have been looking into the problem and managed to come across some info suggesting that PWMRANGE was defined up to v2.7.4 of ESP8266 (esp8266/Arduino#8447). Any ideas for a workaround to maintain the microstepping functionality with the current version? |
Try add to stepper.cpp: |
PWM based microstepping (1/2, 1/4, 1/8) has been added to four and two wires H bridge (L293D) configuration. L293D ENABLE pins must be connected to MCU pins.
Two wire configuration has been tested using ESP-12E module with L293D motor shield, but four wires not yet.