Jump to content

update step value on stepper motor


bjorn

Recommended Posts

Is there a way to update the stepper value of the stepper motor?

I want the stepper motor to stop moving if the program crashes or is stopped without stopping the stepper motor.

I'm currently using the "drive_forward" commands, but in this case, the stepper motor continues to move if the user quits the program, or if it crashes.

But it seems impossible to continously feed the stepper controller with new positions when using target position, or set steps. It ignores set_steps and _target_position if it still has steps left.

The only way i've found is to completely stop the motor, and put steps into it again.

Is there another way?

 

regards

Link zu diesem Kommentar
Share on other sites

If you need to be absolutely sure that the stepper stops running when your program stops running you will probably need to use an additional relay in the power supply of the stepper motor.

With the Relay Bricklets that we have (solid state or  industrial dual relay) you can use a monoflop method. With this you can set a timer that you need to reset and if you top resetting (e.g. because your program crashed) the relay will disengage and the power is cut.

Link zu diesem Kommentar
Share on other sites

  • 2 weeks later...

I'm really starting to regret using Tinkerforge for this project.. Tinkerforge is really easy to use, and is working quite well, but there is some really annoying things that is making this project much more complicated than just using an Arduino with a steppermotor controller.

 

That you are saying is a kind of sollution to get around the problem, but that makes the project even more complex.

Maybe it's possible to just run a second thread that is monitoring the state of the parent thread.

I'm programming everything in C, so there is a lot of other things I can do with this..

 

Thank you for your answer. I thought I was going crazy because I didn't find any answer to this problem :)

Link zu diesem Kommentar
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Gast
Reply to this topic...

×   Du hast formatierten Text eingefügt.   Formatierung jetzt entfernen

  Only 75 emoji are allowed.

×   Dein Link wurde automatisch eingebettet.   Einbetten rückgängig machen und als Link darstellen

×   Dein vorheriger Inhalt wurde wiederhergestellt.   Clear editor

×   Du kannst Bilder nicht direkt einfügen. Lade Bilder hoch oder lade sie von einer URL.

×
×
  • Neu erstellen...