Git Product home page Git Product logo

Comments (4)

luni64 avatar luni64 commented on June 1, 2024

There is nothing special with stop(). You can simply set a new target position after stopping and start the next move. StopAsync (like the other Async commands) is not blocking. I.e. it returns immediately after you called it. That means that the motor will still run when the function call returns. Before sending another movement command you should make sure that the motor is not running. You can use controller.isRunning() for that.
Let me know if you need an example code for that.

from teensystep.

rvsh2 avatar rvsh2 commented on June 1, 2024

Thanks. I undestand this. The problem is if I don't know exact target position (because I don't store it anywhere..) and I use interrupt to stop the motor.
For example. There is a 5 axis robot in the cell that do some movement using moveAsync and if you open safegate then interrupt is called to stop movement but in the interrupt I don't know what was the target position so I can't continue.. Can I get the target position somehow from some variables so I can start the motors again? Also after stop I don't know exactly which motor was running before but If I could know target positions of motors and actual positions of motors then I could start motors again to run to destination after safegate is closed and reset/start buttons pressed.

Many thanks for help!

from teensystep.

rvsh2 avatar rvsh2 commented on June 1, 2024

Maybe this is trivial question but I'm stuck.

from teensystep.

luni64 avatar luni64 commented on June 1, 2024

There is no simple solution to access the target positions from the library. But I really don't understand why you don't simply store the positions after you set them? I can send you a quick example later today to show you how I would do it.

from teensystep.

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.