Git Product home page Git Product logo

Comments (6)

laurb9 avatar laurb9 commented on July 17, 2024 1

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.

laurb9 avatar laurb9 commented on July 17, 2024 1

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.

laurb9 avatar laurb9 commented on July 17, 2024

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.

laurb9 avatar laurb9 commented on July 17, 2024

Closing, assumed resolved.

from stepperdriver.

rmnaderdev avatar rmnaderdev commented on July 17, 2024

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.

 avatar commented on July 17, 2024

Thank you very much @laurb9. I'll check it out.

from stepperdriver.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.