Go Down

Topic: Reverse 28BYJ-48? How? (Read 3536 times) previous topic - next topic

sbright33

How do I Reverse my 28BYJ-48 stepper motor?
Tried mystepper.step(-1) just goes forward.
Can I use stepper library?

How many degrees is 1 step?
5.625/64 or 360/64/64
I understand one 64, because of gear reduction.
Why is there 2 64's in the divisor?
The motor only turns 5.6 degrees per step?
Thanks in advance for your help!
If you fall... I'll be there for you!
-Floor

Skype Brighteyes3333
(262) 696-9619

Bajdi

I have 2 of these little stepper motors. No problem to let them turn in both directions. What I haven't figured out is how many steps these little steppers really are. From testing I found out that I need to let them step more then 2000 steps for one rotation. I posted a sketch on my blog to control both steppers with a small joystick.
http://www.bajdi.com/joystick-and-2-28ybj-48-stepper-motors/
www.bajdi.com

sbright33

#2
Jan 09, 2012, 08:44 pm Last Edit: Jan 09, 2012, 08:53 pm by sbright33 Reason: 1
64*64=4096 to be exact.
I tried step(-1) like in your code and step(-64) they just move in the same forward direction as step(+1).
Am I losing my mind?  Am I mistaken?
Just tried it again with your encouragement.  Same results.
I'd post my code, but it's mostly only one line above.
If you fall... I'll be there for you!
-Floor

Skype Brighteyes3333
(262) 696-9619

sbright33

Anyone?  I don't want to Hijack another thread so I will ask again here.  Can I use the Stepper library?
If you fall... I'll be there for you!
-Floor

Skype Brighteyes3333
(262) 696-9619

sbright33

@bajdi-  According to this thread:

http://arduino.cc/forum/index.php/topic,85335.0.html

Your code should not work with the Stepper library to reverse the direction of a 28BYJ-48?
Are you sure it does go both ways CW and CCW?
How did you do it?
If you fall... I'll be there for you!
-Floor

Skype Brighteyes3333
(262) 696-9619

sbright33

The answer is here:
http://arduino.cc/forum/index.php/topic,85335.0.html
If you fall... I'll be there for you!
-Floor

Skype Brighteyes3333
(262) 696-9619

Bajdi


@bajdi-  According to this thread:

http://arduino.cc/forum/index.php/topic,85335.0.html

Your code should not work with the Stepper library to reverse the direction of a 28BYJ-48?
Are you sure it does go both ways CW and CCW?
How did you do it?



I started from the code I found here http://arduino-info.wikispaces.com/SmallSteppers take a good look at how the pins are specified. I had no problem letting them turn both ways. I'll make a video if you don't believe me  :)
www.bajdi.com

sbright33

Ah you have found the proper sequence!
Will let you know if the performance is difference for 8 phases.
If you fall... I'll be there for you!
-Floor

Skype Brighteyes3333
(262) 696-9619

bobotus

Try to switch the connections IN2 and IN3. This did the trick for me. Also this increased torgue a lot (since the stepper is running as it should), and feels like its running cooler.

Here's my setup:
pin8->controller IN1
pin9->controller IN3
pin10->controller IN2
pin11->controller IN4

ps. I'm not an expert, so the connections might be totally wrong. But it works just fine for prototyping. :)


terryking228

Details of the connections for those motors, example code etc is on the ArduinoInfo.Info WIKI HERE:
Regards, Terry King terry@yourduino.com  - Check great prices, devices and Arduino-related boards at http://YourDuino.com
HOW-TO: http://ArduinoInfo.Info

MarkT


64*64=4096 to be exact.

Wrong (in two ways), since the docs say that the gear ratio is 64:1 and
there are 64 _half_-steps per motor revolution.  So 32*64 ought to be the
anwser...

There seem to be at least two different versions of this motor, and the gear
ratios in at least one are not exactly 64:1, but close (this is usually the case
for large gear ratios, the design and implementation are often slightly
different due to the practicalities of gear-train design.
[ I won't respond to messages, use the forum please ]

micahm

Big thanks to bobotus!  Reversing the connections on the 2 and 3 pins on the ULN2003 board did the trick for me.  You can see a video of it working at:  https://www.youtube.com/watch?v=38gmBsDHnmg

Note:  I realized after I can power the ULN2003 board (and thus the 28BYJ-48) off the Vin and ground of the Arduino.  The motor is not a ton of current but all that I read said I should not power it off the +5v of the board as it may blow it up.  It makes sense to me that the Vin is 'outside' of the regulated voltage on the board and can handle more current and voltage, but I figured Vin would be just that.... in.

QUESTION:  Any idea why reversing the connections on the 2 and 3 pins works?  Just trying to understand.

MarkT

The phases have to be sequenced +A/+B/-A/-B (or equivalent), wrong wiring
would give +A/-A/+B/-B which isn't quadrature.  There are 24 ways to wire 4 wires,
8 or them will work and 12 won't.  Of the 8 that work 4 go CW and 4 CCW, and for
a particular direction the wirings are cyclic-permutations of each other.
[ I won't respond to messages, use the forum please ]

Go Up