Comments (6)
What I would really like to do is use interrupts for the timing, which would make the entire motor activity async, but I didn't have time to look into that and there are other libraries which do this better.
from stepperdriver.
Try taking a look at the AccelStepper library, it has been around for a longer time.
With interrupts, maintaining the functionality across different chips becomes an issue.
from stepperdriver.
The non-blocking implementation has three phases. First you do startMove() which precalculates the timings and sets up the step counters, then you call nextAction() periodically at the indicated intervals to trigger the pulses. Each call returns how many milliseconds you have until the next move, and you can use that to decide if you have enough time to do something else.
You do not need to call stop() unless you want to cancel the move, because it will reset all the step counters to zero. If you take too long between nextAction() calls, the timing of the pulses will be off, the motor movement will be less smooth but that's about it.
If you do need a lot of time while the motor is moving, I am thinking that you could try to use fewer microsteps to increase the step interval.
from stepperdriver.
Closing, assumed resolved.
from stepperdriver.
Has anyone found a good solution to this problem? I am using ESP32 AsyncWebServer and when the motor is moving it freezes and jerks for a second when requests are made. Is there another library that someone has found that uses interrupts?
from stepperdriver.
Thank you very much @laurb9. I'll check it out.
from stepperdriver.
Related Issues (20)
- Code Analysis HOT 3
- Position drifts over many cycles HOT 18
- support TB6600
- Bug. Two motors nema 17 do not rotate at the same time. HOT 2
- Changing speed
- Motor Status HOT 1
- Not smooth movement HOT 5
- Please advice on constant rotation HOT 2
- Smooth transition between movements in LINEAR_SPEED Profile HOT 2
- Using two steppers - seems that they only can use a single rpm value!! HOT 2
- Stepper.Disable() Issue HOT 2
- Stepper scaling HOT 3
- What is the RPM? HOT 2
- What should be set for the "microstep" value? HOT 2
- No sync move at step_high_min = 30 HOT 1
- Please add non 2^n microstep support for close loop stepper. HOT 2
- TMC HOT 1
- Support non-blocking nextAction()
- compatibility with grbl shield HOT 1
- Sketch didn't work on Apple M1 Pro Sonoma v14.1.2 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from stepperdriver.