Continous work of stepper motors

Hello guys,

I am new here so patience and indulgence are welcome :slight_smile:

I did my first basic projects but now I decided to do something more complicated. In my project I use stepper motors (28BYJ-48). I read the libraries functions but I still dont know how to make them run continously. In my project I need to move some flap until homing button is pressed.

Here is part of some sketch I found. It makes my motors move but just for some period (600 steps I assume):

...

stepper1.move(600);
stepper1.setSpeed(stepperSpeed);

stepper2.move(600);
stepper2.setSpeed(stepperSpeed);

stepper1.runSpeedToPosition();
stepper2.runSpeedToPosition();

...

Some example os short sketch would be werry helpfull :slight_smile:

Something that in words sounds like:

while A0=high rotate the engine :slight_smile:

Hi,

your information is too incomplete to help you:

  • e.g. what library do you want to use?
  • what about your driver and the wiring with your stepper?

To get into the stuff about stepper motors, start with:
Robin's Stepper Motor Basics

Ok, more data...

I started to learn from this source:

My sketch comes from this page. My library is: #include <AccelStepper.h>

Is it really so difficult to make them move until some condition occurs?

Please some help :confused:

I don't know too much about the ULN2003 and the "direct" method to drive a stepper.
As I am working with stronger motors I am used to drivers (starting with a drv8825 and up to Gekko drivers) which drive the motor just by getting "step/pulse" and "direction" from the Arduino. But your configuration should work nevertheless with your configuration.

The sketch #1 in the tutorial tells the stepper to go to a position "20000", counting down the distanceToGo and it that == 0, it should reverse and go to "-20000".

Ref to AccelStepper library: the library is limited to about 4000 steps/sec - which means in your case, that your motor (due to the gear) can only turn about 60 RPM - is that ok for you?

Pls check the wiring again and post it so that we can exclude any wiring issues.

AccelStepper library, setSpeed(), runSpeed()

Konradus:
Is it really so difficult to make them move until some condition occurs?

Just write some code to make it move one step and repeat that as often as you want.

...R

pls post your complete sketch - it is impossible to guess what you are really doing; if the code lines of your first post is the only instruction in your main loop - then your motor is just moving 600 steps and then it will stop - provided that there is no more instruction.

So - pls post your full sketch and tell us what you want to accomplish.