Jump to content

update step value on stepper motor


bjorn
 Share

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 to comment
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 to comment
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 to comment
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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...