Pages: [1]   Go Down
Author Topic: 28BYJ-48 question  (Read 1057 times)
0 Members and 1 Guest are viewing this topic.
UK
Offline Offline
Jr. Member
**
Karma: 1
Posts: 62
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,

I've just 'graduated' from the starter kit so I'm pretty clueless, but branching out and experimenting with a few different things for a device I want to build, which includes steppers. So I bought this 28BYJ-48 stepper and hooked it up as below using the sketch below, from Adafruit. Works great!

I don't get something though, it takes an input value of 2048 to make it go round once. Can anyone explain please how this relates to its specs (Step angle: 5.625 x 1/64. Reduction ratio: 1/64) or the sketch? At Adafruit it states a value of 500 should turn it once... different motor or have I been a bit of a muppet between the sketch and the circuit somewhere?

Thank you


circuit:


sketch:
Code:
/*Adafruit Arduino - Lesson 16. Stepper*/
#include <Stepper.h>

int in1Pin = 12;
int in2Pin = 11;
int in3Pin = 10;
int in4Pin = 9;
Stepper motor(512, in1Pin, in2Pin, in3Pin, in4Pin);  

void setup()
 {  
   pinMode(in1Pin, OUTPUT);  
   pinMode(in2Pin, OUTPUT);  
   pinMode(in3Pin, OUTPUT);  
   pinMode(in4Pin, OUTPUT);  
   while (!Serial);  
   Serial.begin(9600);  
   motor.setSpeed(30);
 }
 
 void loop()
 {  
   if (Serial.available())  
   {      int steps = Serial.parseInt();    
          motor.step(steps);  
   }
 }
« Last Edit: May 14, 2013, 05:08:28 pm by nass » Logged

Photography nut trying to make the flux capacitor of macro pho

0
Offline Offline
Shannon Member
****
Karma: 161
Posts: 10438
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ah, I remember playing with this stepper, I believe it takes about 4096 _half_ steps to go round.  If you use full-steps
it takes 2048 (approx), which corresponds to 512 full sequence cycles per revolution.

I say approx because the gear ratio isn't actually 64:1.
Logged

[ I won't respond to messages, use the forum please ]

UK
Offline Offline
Jr. Member
**
Karma: 1
Posts: 62
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you MarkT
Logged

Photography nut trying to make the flux capacitor of macro pho

Topsham, Vermont USA
Offline Offline
Edison Member
*
Karma: 23
Posts: 1759
... in The Woods In Vermont
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi, there is added info / example software here:  http://arduino-info.wikispaces.com/SmallSteppers
Logged

Regards, Terry King terry@yourduino.com  - Check great prices, devices and Arduino-related boards at http://YourDuino.com
HOW-TO: http://ArduinoInfo.Info

Offline Offline
Edison Member
*
Karma: 6
Posts: leet
If you're not living on the Edge, you're taking up too much space!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Terry, do your motors have exactly 4096 half steps?  I can't remember where I got mine, and people are asking.
Logged

If you fall... I'll be there for you!
-Floor

Skype Brighteyes3333
(262) 696-9619

Topsham, Vermont USA
Offline Offline
Edison Member
*
Karma: 23
Posts: 1759
... in The Woods In Vermont
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Terry, do your motors have exactly 4096 half steps?

Hmmm. I ASSumed they did based on Other Stuff I Read.

That's not the same as Knowing.  I think I just sent my last in-USA sample to someone; I'll get more soon, and my reaction is to test them with multiple resolutions (like does it return exactly with 40960 steps?? 

I also may tear one apart and count teeth??  Anyone done that? 

The stated Gear Reduction on the specs I see is 64:1 so 360/5.625=64 steps per revolution on Internal Motor.  And 64*64=4096 steps per output shaft revolution.

Hmmm.... Needs to be Proofed..
Logged

Regards, Terry King terry@yourduino.com  - Check great prices, devices and Arduino-related boards at http://YourDuino.com
HOW-TO: http://ArduinoInfo.Info

Offline Offline
Edison Member
*
Karma: 6
Posts: leet
If you're not living on the Edge, you're taking up too much space!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Some motors are 4096 exactly, others are 4075.123 or something.  Not very convenient.
Logged

If you fall... I'll be there for you!
-Floor

Skype Brighteyes3333
(262) 696-9619

Offline Offline
Edison Member
*
Karma: 6
Posts: leet
If you're not living on the Edge, you're taking up too much space!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Still no word Terry?  I have some 4096 motors, but I'm not sure where I got them.
Logged

If you fall... I'll be there for you!
-Floor

Skype Brighteyes3333
(262) 696-9619

0
Offline Offline
Shannon Member
****
Karma: 161
Posts: 10438
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Some motors are 4096 exactly, others are 4075.123 or something.  Not very convenient.


Strong suspicion they are made as cheaply as possible to a common specification with low accuracy
requirements - the original purpose is controlling air-vanes in car air-conditioning systems I believe,
Logged

[ I won't respond to messages, use the forum please ]

Topsham, Vermont USA
Offline Offline
Edison Member
*
Karma: 23
Posts: 1759
... in The Woods In Vermont
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi, I just got 5 more of these in to test with here is USA and I'll try to get to some testing.

Hmmm. I don't believe any of these can have a factor that is not the product of two integers.. they ARE just teeth, right??

So funny numbers make me strongly suspect some dropped pulses.

I need to prototype a small robot using these Real Soon Now....
Logged

Regards, Terry King terry@yourduino.com  - Check great prices, devices and Arduino-related boards at http://YourDuino.com
HOW-TO: http://ArduinoInfo.Info

Pottstown, PA
Offline Offline
Sr. Member
****
Karma: 4
Posts: 297
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I also may tear one apart and count teeth??  Anyone done that?

Although I cannot find the post now, someone had and posted images of rather odd gearing. - Scotty
Logged

Offline Offline
Edison Member
*
Karma: 6
Posts: leet
If you're not living on the Edge, you're taking up too much space!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes, but some are 4096, some are 4075.  BOTH EXIST. 
I'm am curious about Terry's motors specifically because he is selling them!
Logged

If you fall... I'll be there for you!
-Floor

Skype Brighteyes3333
(262) 696-9619

Pages: [1]   Go Up
Jump to: