Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FR: Control the stepper enable pin manually in the code rather than relying on a delay #26

Open
rafik24 opened this issue Feb 16, 2024 · 2 comments

Comments

@rafik24
Copy link

rafik24 commented Feb 16, 2024

Hi MicroBahner,

First of all, Thank you for this great library !

In my application the stepper motors have some weight on when moving, so I need to control the enable pin to ensure they stay where they are at certain times and also that they are disabled by the code when needed.

I looked at the documentation and could not find a way to do this other than setting a delay in stepper.attachEnable().

I there a way to do this or will it require implementation ?

Kind regards,
Rafik

@MicroBahner
Copy link
Owner

MicroBahner commented Feb 17, 2024

Hi Rafik,
as it is now, if you use .attachEnable() the motor is always disabled if it is not moving. Only the delaytime between the last step and disabling ( and between enabling and the first step ) can be set. If you need to disable the motor only sometimes, and sometimes not when it is not moving, you cannot use attachEnable(), but must controll the enable pin by yourself.
But I think it would be a valuable extension, to be able to suppress the automatic disabling if needed. That should not need too much effort, and I will put it on my ToDo list.
Regards
Franz-Peter

@rafik24
Copy link
Author

rafik24 commented Feb 17, 2024

Hi Frantz,

Thank you for your reply.

Indeed not using attachenable and controling the enable pin manually in the code does makes sense for me.

I looked into making the change myself, I could trace the behaviour in the code but my skills in c++ are not there yet 😕

Thank you for adding this to your list.

Many thanks,
Rafik

@rafik24 rafik24 changed the title Control the stepper enable pin manually in the code rather than relying on a delay FR: Control the stepper enable pin manually in the code rather than relying on a delay Feb 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants