Go Down

Topic: 28BYJ-48 5-Volt Stepper (Read 215511 times) previous topic - next topic

rpt007

#165
Jun 22, 2016, 05:07 pm Last Edit: Jun 22, 2016, 05:36 pm by rpt007
@Hollay,

pls give us a bit more details about:
- your stepper motor (the same as headline says? I ask because the thread was started in 2011 ..)
- your stepper driver
- your power supply

If you are talking about having too less torque CW - it might depend on the speed.
There is a dependency between speed and torque.

As you are running CCW a bit faster than CW (you say, not fast enough - that may indicate driver/power supply/voltage issue) it seems that the motor at CCW speed has enough torque (or at least more than CW at low speed).

If you are operating your motor in a speed range, where torque is low, mightbe you need a gear reduction, so that the motor can run faster, but the resulting movement is still slow enough for your project.



Before you ask:
Did you really read and understand How to use this forum ?
AND:
Do you have already some solution or is a part of the problem sitting in front of the screen?  :)

Hollay

Hi,
thanks for reply&help.

The motor is the same as in the headline. The driver board is a ULN2003 based tiny board (with 4 red leds), got in bundle from dx.com.
The power supply is a 240V AC/12V DC at 2A with stabilizer 7809 for the Nano and 7805 for the motor driver board. I guess it should be enough.

There should be 2 different speed values for the 2 directions.
The project has to have enough torque in the slow motion phase to run smooth with a camera on it and fast enough if parking back after exposure.
The motor is connected with a belt drive to the curved rod in order to avoid backlash btw. gears. The gear on the rod has to turn exactly with 1 RPM.
Just for information how a barn door tracker is looking like, here's an example (not mine): LINK
Thanks and regards:
Frigyes

rpt007

#167
Jun 23, 2016, 12:20 am Last Edit: Jun 23, 2016, 12:32 am by rpt007 Reason: Added link
I am not familiar with your combination of driver and stepper.
What I found in the Internet, and if this information applies to your hardware:
Your motor needs 64 steps to make one 360 degree turn.

The integrated gear has a ration of 64:1, means that you have to send 64 * 64 = 4096 steps to have one full revolution. (Actually: 4076, see link below).

Compare that with your code:
Code: [Select]
const int stepsPerRevolution = 200;

So exchange the 200 with 4076 and test again.

Read the details in this link.
Before you ask:
Did you really read and understand How to use this forum ?
AND:
Do you have already some solution or is a part of the problem sitting in front of the screen?  :)

Hollay

Hmm, that sounds right.
I will test it on the weekend.
Thanks: Frigyes

rpt007

pls don't forget to leave a feedback here; EVEN when it works  :)
Disclosing a successful way to solve a problem will help to avoid repeating same kind of questions all over again and such waste precious free time on already solved issues.
Before you ask:
Did you really read and understand How to use this forum ?
AND:
Do you have already some solution or is a part of the problem sitting in front of the screen?  :)

Hollay

#170
Jun 26, 2016, 02:06 pm Last Edit: Jun 26, 2016, 02:50 pm by Hollay
Well, for the first look it seems to be worse. :(
I've set the value for 4076, but same time had to decrease speed (value: Sp). Now the torque is good at the minimum speed (1), but there's no more fine adjustment for speed as it seems not to take floating values (like Sp=0.9), only 1-7 as integer. I don't really understand why.
I've started a trial&error.
E.g. if I set the value for 1024, I have a speed range 1-25, which is way better in sense of fine tuning. Torque at Sp=1 seems to be OK, although highest speed is still not fast enough. If I set it higher, the motor makes only a high freq noise but not a single turn. :smiley-confuse:
I'm afraid the stepper library couldn't give me more...

rpt007

As I have no such motors I cannot give it a try myself. Maybe somebody else here has the same configuration available and could give you a helping hand.
Alternative: look at another motor / driver combination which is in the range what you are looking for.
Before you ask:
Did you really read and understand How to use this forum ?
AND:
Do you have already some solution or is a part of the problem sitting in front of the screen?  :)

Hollay

#172
Jul 08, 2016, 10:44 pm Last Edit: Jul 08, 2016, 11:00 pm by Hollay
Ask again for help.
Using still the here already attached code I tried to change the small 28BYJ-48 on another unipolar stepper in order to get more torque. The config is the same: a Nano board with ULN2003 driver.

Tried e.g. a 42BYJ-07 (Syntha motor from a HEQ5 telescope mount) geared motor (as this is a 12V stepper, the ULN board gets 12V now).

The stepper is only vibrating, no matter in which sequence the coils are powered. Took an old unipolar motor from a 5,25" FD drive, same vibration W/o a single turn.

Tried another codes, not only stepper.h library but accelstepper too, same result.

What do I wrong? :(

Thanks for any answer.


MAS3

Hi.

If you need more torque, you need more current.
Is your driver able to supply the current the motors need ?

Do you have some specifications about those motors of yours ?
Have a look at "blink without delay".
Did you connect the grounds ?
Je kunt hier ook in het Nederlands terecht: http://arduino.cc/forum/index.php/board,77.0.html

Hollay

Hi,

I don't have any specs for those motors, sorry.
However torque is one issue in case of the 28BYJ, as it is just a tiny stepper. But my bigger problem is that the other steppers, like the 42BYJ-07 doesn't even make a single turn, just jumping a coil forward and another back (seems at least), that's I've written "vibrating". As if I would try to use it with a wrong coil sequence in the code. But tried all variations, no success.

MAS3

If some current limiter kicks in, you might see a similar behaviour.

If you do not know the stall current, it's unlikely you will get it working correctly.

Try measuring voltages and currents, while you have some very slow stepping going on.
Have a look at "blink without delay".
Did you connect the grounds ?
Je kunt hier ook in het Nederlands terecht: http://arduino.cc/forum/index.php/board,77.0.html

k4rma

I'm going to run an astronomical barn door tracker with Arduino nano.
I wrote a sketch, it works so far but I'm not really satisfied with it.
The basic idea is the following:
if powered up, it has to run down (CCW) in parking position. After pushing lower limit switch it has to wait for the START button. If start pressed, it has to turn CW very slow (as it has to follow Earth's turn) until upper limit switch pushed. If pushed, a blinking LED alerts to finish long time exposure.
There is a finetuning included to set +/- the CW speed (it has to be set up while taking long expo photos not to see lines instead of stars due to wrong speed). Speed is saved in Arduino's EEPROM.


Hi Hollay,

I happen to be on a similar issue with these little steppers. I tried SmallSteppers ans AccelSteppers as well, but both didnt really fit my needs.

The following simple example uses Timer1 with two steppers. Within the timed routine it will run the steppers to the position given by steps_X/Y_goto.

Code: [Select]


#include <TimerOne.h>

  byte stepper_sequence_clw[8] = {B01000, B01100, B00100, B00110, B00010, B00011, B00001, B01001};
  byte stepper_sequence_ccw[8] = {B00001, B00011, B00010, B00110, B00100, B01100, B01000, B01001};
  byte stepperX_spos,stepperY_spos,steps_X_step,steps_Y_step;
 
  byte stepperX_pins[4]={2,3,4,5}; //Stepper X digital pins D2...D5 blue pink yellow orange, ULN2003 1-4
  byte stepperY_pins[4]={6,7,8,9}; //Stepper Y digital pins D6...D9
  
  
  byte stepperX_delay = 0; //X stepper max speed
  byte stepperY_delay = 6; //Y stepper slow but with more torque
  
  long int steps_X_goto = 0;
  long int steps_Y_goto = 0;
  long int steps_X_pos = 0;
  long int steps_Y_pos = 0;

void setup(void) {

  for(int i=0;i<4;i++) pinMode(stepperX_pins[i],OUTPUT);
  for(int i=0;i<4;i++) pinMode(stepperY_pins[i],OUTPUT);
  stepperX_spos=0;
  stepperY_spos=0;
  steps_X_step=0;
  steps_Y_step=0;

  Timer1.initialize(1250) ; //max speed / lowest torque for 28BYJ

  Timer1.attachInterrupt(run_steppers);
  
}

void run_steppers(void){

    doSteps();
    //doBlinkLed or whatever
        
 }


void doSteps(){ //Do not use delay here as well as in the called funcs

    //having an endswitch it might be read here
    //if set, either let goto = pos or set goto = pos = 0
  
     if(steps_X_goto > steps_X_pos) doStepX(1,1);
     if(steps_X_goto < steps_X_pos) doStepX(1,0);  
  
    
     if(steps_Y_goto > steps_Y_pos) doStepY(1,1);
     if(steps_Y_goto < steps_Y_pos) doStepY(1,0);
  
      
  }

void doStepX(byte s_step, byte s_direction){
  if(!s_step) return;
  if(++steps_X_step < stepperX_delay) return;
  
  if(s_direction){
    if(++stepperX_spos>7) stepperX_spos=0;
    for(byte i=0;i<4;i++)
      digitalWrite(stepperX_pins[i],bitRead(stepper_sequence_ccw[stepperX_spos],i));
    steps_X_pos++;  
    } else {
    if(++stepperX_spos>7) stepperX_spos=0;
    for(byte i=0;i<4;i++)
      digitalWrite(stepperX_pins[i],bitRead(stepper_sequence_clw[stepperX_spos],i));
    steps_X_pos--;
    }
  steps_X_step = 0;
    
  }

void doStepY(byte s_step, byte s_direction){
  if(!s_step) return;
  if(++steps_Y_step < stepperY_delay) return;
  
  if(s_direction){
    if(++stepperY_spos>7) stepperY_spos=0;
    for(byte i=0;i<4;i++)
      digitalWrite(stepperY_pins[i],bitRead(stepper_sequence_ccw[stepperY_spos],i));
    steps_Y_pos++;
    
    } else {
    if(++stepperY_spos>7) stepperY_spos=0;
    for(byte i=0;i<4;i++)
      digitalWrite(stepperY_pins[i],bitRead(stepper_sequence_clw[stepperY_spos],i));
    steps_Y_pos--;
    }
 steps_Y_step=0;  
  }


 void loop(void) { //main loop, do non time critical things here


//set the steps to go

steps_X_goto = 4076;   //go 1 revolution clockwise
steps_Y_goto = -4076; //and 1 rev counterclockwise


delay(1); //always have a little bit of delay in here
}




The timed function is called every 1250us, resulting to 8k steps per second or 1kHz per cycle ("wave"). In my experiments this gives the stepper a quite decent turn rate leaving at least some torque. For more torque stepperX/Y_delay can be set as plain divider, using a delay of 10 will set the stepper to 100Hz as rated in its specs - which is really slow but should deliver the steppers max torque.

Beneath the timer interrupt and thus no need of using delay() in stepper control this example uses two different wave "signatures" for running back and forth to pick up the exact step in sequence instead of running the whole cycle before changing direction.  

Happy experimenting!

Regards, k4rma













mun35

Does anyone know if the 28BYJ could be made to spin at 100RPM+? Or could one of its brothers/cousins go that fast?

Thanks

jackever

The darlington diagram has 2 of the diodes reversed .

Go Up