# Arduino Forum

## Using Arduino => Motors, Mechanics, and Power => Topic started by: Stolfa on Sep 11, 2011, 03:09 am

Title: Geared Stepper Motor
Post by: Stolfa on Sep 11, 2011, 03:09 am
I was trying to find a cheap geared stepper motor and found the 28BYJ-48 a number of places online and from the specs it seemed to fill the bill.  64 steps to the motor and 64X gear reduction 4096 steps per revolution.  I received it and wired it up and ran it for the better part of three days with various programs.  I kept finding that a full revolution was somewhere between 4072 and 4080.  Maybe I was slipping with acceleration and deceleration???  Slowed everything down. No change.  Finally I cracked the geartrain open and found the following gear teeth counts 9, 9, 10, 11, 22, 26, 31, and 32.  If you calculate this out it is: (22X26X31X32)/(9X9X10X11) = 63.68395...  Multipied by the 64X motor that is 4075.7728.. steps per revolution not 4096!!!  I was expecting an integral number of turns to return to zero.  If you reduce this to the lowest common denominator ( 283712/4455)  it means I have to go 4455 revolutions to get back to zero degrees!  I'm disappointed that it's not an integral number of steps to get 360 degrees.  It was cheap but now I'm looking for a stepper motor that is actually an integral number of steps per 360 degrees.  I'd like to find a stepper motor that's >1000 steps/revolution and returns to zero every revolution.  Any ideas?

Thanks,

Dave
Title: Re: Geared Stepper Motor
Post by: Senso on Sep 12, 2011, 03:47 am
Use an 1.8º/step motor and use micro-stepping with an external driver, that or built a drive-train using timing belts and pulleys.
Title: Re: Geared Stepper Motor
Post by: MarkT on Sep 12, 2011, 08:22 pm
You could calculate the number of actual steps from theoretic steps using:

Code: [Select]

unsigned long actual_steps = theoretical_steps * 283712 / 4455 ;

and then you'll only ever be 1/4000 of a revolution out (which is less than the 1/1000 requirement).

It is indeed an annoying gear ratio!
Title: Re: Geared Stepper Motor
Post by: Stolfa on Sep 12, 2011, 10:27 pm
I'm trying to make a second hand ( that is not constant speed but is 1 RPM).  It will therefore make many revolutions over time.  I will have to do a time correction because not all delays of code will be accounted for. I don't want to make a position correction also.  I could but it will eat up a lot of code space.
Title: Re: Geared Stepper Motor
Post by: sbright33 on Jun 25, 2012, 10:35 pm
Title: Re: Geared Stepper Motor
Post by: sbright33 on Jun 26, 2012, 02:49 pm
This is the correct way to calculate the overall ratio?
(22X26X31X32)/(9X9X10X11) = 63.68395
Maybe the formula is correct, but the counting is wrong?
It's off by 1/2% from 64:1.  That's 2 degrees every revolution.
It's suspicious that the experimental results vary between 4072 and 4080.
If it were skipping steps the results would be >4096.
Title: Re: Geared Stepper Motor
Post by: MarkT on Jun 26, 2012, 04:04 pm
Ouch, gear ratios should be given as exact, otherwise its a misleading spec.  Particularly important for stepper motors...

Microstepping doesn't give the accuracy you might expect, under load 1/4 of a step movement is to be expected at max torque.  Microstepping gives smooth motion and much less noise/vibration and risk of mis-stepping, but only somewhat more accuracy and only at light loads and only if the motor poles are accurately positioned....
Title: Re: Geared Stepper Motor
Post by: sbright33 on Jun 27, 2012, 02:23 pm
I believe 64:1 is the exact answer according to my tests.  I wish we could all be in agreement.
Anyone disagree with 64:1?
Title: Re: Geared Stepper Motor
Post by: jerryjjr on Aug 09, 2012, 09:11 am
I have been goofing around with two of these motors for the last couple of days.  I couldn't figure out what I was doing wrong because 4096 steps went just over one revolution.  I wrote a sketch that manually steps the motor using the 8 step sequence found here: http://arduino-info.wikispaces.com/SmallSteppers

After much trial and error, i came up with approximately 4076 steps per shaft revolution. (Eyeballing it)  Which is close to what Stolfa said.

I will run it for 1000+ revolutions and see if it is a few degrees off, which I am pretty sure it will be.  20 degrees off in 4 million steps isn't too bad though...

It is the REALLY TEDIOUS speed that is bugging me.

Edit: I ran it for 4076000 steps  and it is ahead of my zero mark by about 5 degrees, not the 20 degrees that your calculations say.

Also, ( 283712/4455) can be reduced to 25792/405.  Not that it matters much...
Title: Re: Geared Stepper Motor
Post by: scottyjr on Aug 10, 2012, 02:43 pm
I too was not successful in attaining accuracy with this geared stepper. I tried many values at a painfully slow stepping rate with a perhaps .5 oz. load. Could never get it to be at it's rotational starting point after feeding it values of 4096 and various values either side of that. Very nice powerful little guy, especially considering it's motor/driver package price and availability. - Scotty
Title: Re: Geared Stepper Motor
Post by: sbright33 on Aug 13, 2012, 03:32 pm
So that's 2 people that show 4076 steps.  Another user where his results vary.
Maybe they have a different model or manufacturer?
Maybe there are making a mistake?
Does anyone else measure exactly 4096 steps per turn like me?

I can see this thread has been read about 1200x.  Only 2 people with these funny results?
Title: Re: Geared Stepper Motor
Post by: martinsiegrist on Sep 25, 2012, 11:38 pm
I have two of these motors and will set up a test the next few days. Want to make a turntable for a 3d scanner so it would be really helpful if i could return to zero....
Title: Re: Geared Stepper Motor
Post by: sbright33 on Sep 26, 2012, 07:02 pm
Thank you for verifying.  I'm sure you will find no problems and be able to return to zero.
Title: Re: Geared Stepper Motor
Post by: sbright33 on Oct 08, 2012, 09:46 pm
Did you try it?
Title: Re: Geared Stepper Motor
Post by: ADLC on Nov 01, 2012, 10:24 pm
Uau,
I was testing a 28BYJ-48 and I observed the same behaviour: a full turn was not 4096 steps (using half-step excitation mode), but something closer to 4076.

I carried out several tests running 100 turns (in order to adjust the decimals) and I calculated a gear box ratio of 63,6828125 ...
Obviously, the calculations of Stolfa are quite more precise, and answers one doubt I had about my experiments: why was the ratio so strange?

Finally, I would like to ask all you an additional  question about this motor: I have two of them and in both of them the shaft have some play (clearence) of about 7.25º, what also render this motor as usefulness for precision works :-(

Have someone also realized that in his motors?

PD: This motor is mainly used to move the doors of the aircond machines ... in this scenario high precision is not a must ...

Title: Re: Geared Stepper Motor
Post by: TrifonTr on Jan 02, 2013, 01:31 pm
According to Stolfa the motor requires 64*((22*26*31*32)/(9*9*10*11)) steps for a full revolution. This fraction simplifies to 1650688/405. Therefore 405 turns are needed to get back to the initial starting position.
Title: Re: Geared Stepper Motor
Post by: ArduinoPithicus on Jan 03, 2013, 10:24 pm
Having played around with this stepper for a couple of days, my results show an inconsistent undershoot similar to the previous posts.
Maybe this could be a power supply problem ?
Perhaps any future posters could post the type of supply they are feeding ULN2003.
For my part, I was using 2 paralelled 9V (PP3) batteries.
Title: Re: Geared Stepper Motor
Post by: MarkT on Jan 04, 2013, 03:19 am
For high-precision geared motors anti-backlash gears are normally used (where spring-loaded gears remove all
the slack in the mechanism).

Adding a hi-res shaft-encoder after the gearbox would allow accurate positioning without needing to worry about
slack or the precise gear ratios...
Title: Re: Geared Stepper Motor
Post by: Stolfa on Jan 04, 2013, 04:53 pm
I just received a new 10-pk of these 28BYJ-48 5VDC stepper motors and tested one to see if maybe a different manufacturer would use a slightly different gear ratio, some being 4096:1 and some being 4075.7728...   I set the stepper motor sketch up so that it rotates for 4076 steps, pauses for 3 seconds, then repeats; a period of about 15.3 seconds.  Depending on which ratio is in the gear box it either exceeds a revolution by 0.22271 steps or it is short a revolution by 20.2271... steps.  If the gear ratio is 74075.7728.. the paused point of the shaft will precess one revolution in 79 hours.  If the gear ratio is 4096:1 then the pause should precess in the other direction and make one revolution in 51 minutes.  Right now it's on course for about a 79 hour precession.  There may be another source of these motors with a 4096:1 ratio. If you know of one; let me know.

Dave
Title: Re: Geared Stepper Motor
Post by: sbright33 on Jan 05, 2013, 03:50 pm
I can't believe there are so many motors that are not 4096:1.  Why?
Does anyone else have the 4096 ratio?
Title: Re: Geared Stepper Motor
Post by: tatsuha on Jan 21, 2013, 08:10 am
I only just got my Uno a week or so ago, so I'm still somewhat new to this.  I ordered a kit from ebay with a 5v 28BYJ48 stepper included.  It didn't come with a data sheet, but it seemed similar to the others online.

I tested it as accurately as I could with no tools and some arduino codes (mostly the oneRevolution example) and for it to do a full revolution with the standard stepper.h library, I have to use "2046" as my stepsPerRevolution value.  I assume the way I have it wired means it's doing full steps vs half steps or something, but even doubling that would result in 4092 instead of 4096.  Additionally, when I use setSpeed(2), it seems to take about 28 seconds rather than 30 to complete a full circle.

Any help with this would be fantastic, though I know it's not the point of this thread.  But my motor does have an unusual number of steps to go full circle.  I haven't tested to see if it's exactly one circle, nor have I opened it to check the gear ratios, but hopefully it helps.
Title: Re: Geared Stepper Motor
Post by: Stolfa on Mar 09, 2013, 05:59 pm
sbright33,

I popped off the face of a 28BYJ I had and found the following:

(http://i49.tinypic.com/vyqjav.jpg)

I highlighted the gear teeth with a red dot and show the teeth/gear.  My gear ratio is:
(31*32*26*22)/(11*10*9*9) = 283712/4455 = 25792/405 = 63.68395...  If anyone can show 64:1 please similarly pop the face and count teeth.  Can anyone find anything but the above ratio of gear teeth.  The face is replaceable with a little added Vaseline inside.    All motors I've seen pictures of have three intermediate shafts (the shaft ends show through the case) for a total of 4 gear reductions.  It is conceivable that someone may have (40*40*20*20)/(10*10*10*10) = 64 or similar. Yes, there is some slop in the nylon gears but I'm using it for a clock so I'm only driving it in one direction.  I am driving it many revolutions so I do need to know the ratio precisely.  If someone can show me a 64:1 eBay gear source I'd be delighted!  Right now for me the total number of steps are (64 * 25792)/405 =  4075.7728395...  Therefore I step 4075 steps for one revolution and add an additional step every 313 out of 405 revolutions (313/405 = 0.7728395.. the decimal remainder of 4075.772...).  Unfortunately I make an array named correction[404] = {1,0,1,1,1,0,....  0,1,1,1} to decide if a correction step is needed.  It's messy but it keeps the second hand pointing up at 12 o'clock.
Title: Re: Geared Stepper Motor
Post by: sbright33 on Mar 12, 2013, 12:13 am
I have bought a number of these motors from different vendors.  All of them are 4096.  I would notice if it was 4076, a 20 step difference.  My code does 4096 steps quickly then pauses for 5 seconds.  It stops in the same place even after hours of running.  I don't doubt your picture or you counting Stolfa.  My question is this:

Why would someone design it with 4075.772 steps???
Title: Re: Geared Stepper Motor
Post by: MarkT on Mar 12, 2013, 02:50 am
Because they were just used to designing gear trains, not gear trains for open-loop motion control?

AFAIK these motors are made specifically to steer airflow in air conditioning systems, which is the
reason they are so cheap and why exact gear ratios aren't part of the original specifications I suspect.

4096 steps sounds great but the gear train backlash means a standard stepper motor with microstepping
controller probably outperforms this motor - except in price!
Title: Re: Geared Stepper Motor
Post by: ADLC on Mar 12, 2013, 07:27 am
I totally agree with MarkT.
For me, the main problem of this motor is its backslash: it make "vibrate" anything you attach to the shaft even if you rotate only in one direction (anyway, any stepper motor has some backslash, but in this motor it is exagerated by the great play of the gears).

But its advantage is so high: a really reduced price ...
Title: Re: Geared Stepper Motor
Post by: Stolfa on Mar 12, 2013, 02:29 pm
If anyone knows of one, please post an eBay vendor name that sells a 5V 28BYJ stepper motor  with a 4096 steps/revolution rather than the 4075.722...  that all mine show.  I would love to find a 4096 step source. The three different orders I've made all exhibit 4075+.
Title: Re: Geared Stepper Motor
Post by: sbright33 on Mar 13, 2013, 04:24 pm
I understand.  Ask Terry his email is at the bottom.

http://yourduino.com/LearnArduino1.htm

Other than this design, is there another cheap source with gears?  I have some with 16:1 that look the same from the outside.  How can you get 4096 steps without gears?  If speed is not a concern, even with backlash, how can you beat it?  Most cheap steppers are about 1 deg/step?
Title: Re: Geared Stepper Motor
Post by: scottyjr on Mar 14, 2013, 05:25 pm
Ah! Finally an explanation as to why some users of this stepper cound not attain the hoped for results as sbright33 and others got in getting it to do a precise full revolution in 4096 steps. I too would like to know of a source for these steppers that for sure have 4096 steps per revolution. - Scotty
Title: Re: Geared Stepper Motor
Post by: sbright33 on Mar 14, 2013, 06:52 pm
I can fix my code to work with 4075+.  All I'd need is a motor to test it.  Already the code is able to rotate by 0.36 x 1000 to make a full revolution.  Notice the step size is not even close to a multiple of 0.36 degrees.  The only disadvantage is the need for floats the way it is written.  Who wants it?
Title: Re: Geared Stepper Motor
Post by: sbright33 on Apr 08, 2013, 07:08 pm
I guess nobody wants to rotate exactly 1 revolution...
Title: Re: Geared Stepper Motor
Post by: Stolfa on May 16, 2013, 01:40 pm
sbright33,

Stolfa
Title: Re: Geared Stepper Motor
Post by: pebert on Jan 13, 2014, 09:50 pm
Hi

What happened to this issue?

I just ended up in trouble with my 28BYJ-48 and realized that I have the same issue as some of you.

Did you ever managed to find a motor with an even number of steps per revolution?

Title: Re: Geared Stepper Motor
Post by: Stolfa on Jan 15, 2014, 05:58 pm
Sbright33,

I think you had received one of my 28BYJ stepper motors last summer.  Any luck at checking it's steps/rev?

Dave
Title: Re: Geared Stepper Motor
Post by: ozgr on Apr 16, 2014, 02:21 pm
hi everyone, I've recently bought 28BYJ-48 5V DC stepper motor from china for my school project. I chose this motor only because it's cheap.

The gear ratio doesn't have to be exactly 64:1 for me, because I won't use them where the precision is important. Nevertheless because of sheer curiosity, I opened up one of them and count the gears. It was a painstaking process thanks to teeny tiny plastic teeth.
I took some photos to use zoom option and save my eyes but my average digital camera doesn't come up with nice photos.

So I double checked the numbers and found out exact same numbers with Stolfa;

Main rotor has 9 teeth and connected to 32-11 gear then 9-22 --> 10-26 and finally 31.

(32*22*26*31)/(9*11*9*10) = 63.68395062 (405:25792)  which is NOT acceptable for precise applications. I don't know why the manufacturer uses these gears instead of using some others to achive 1:64 ratio. Is it difficult to find or produce plastic gears with different teeth numbers?

Now I understand why quality stepper motors are expensive. At least they meet the spesifications manufacturers provide.
Title: Re: Geared Stepper Motor
Post by: Hellolife on Jun 28, 2014, 08:06 pm
Hello,

I don't understand why this motor wouldn't be a good help for precision projects. First of all, reductors are based on "mutually prime" gears, to distribute wear evenly. But, more, there is NO ideal reduction factor: by exemple, in watchmaking, what i f i want to cut a 47 teeth gear ?
One can, i think, approach any angle with desired accuracy with this step-motor, eventually by running it more than one "complete" turn. I shall calculate the number of steps and turns with this goal of minimum error, modulo 2*pi, or modulo 64*63.75 etc

Sorry for my poor english.
Regards
Title: Re: Geared Stepper Motor
Post by: MarkT on Jun 28, 2014, 10:48 pm

(32*22*26*31)/(9*11*9*10) = 63.68395062 (405:25792)  which is NOT acceptable for precise applications. I don't know why the manufacturer uses these gears instead of using some others to achive 1:64 ratio. Is it difficult to find or produce plastic gears with different teeth numbers?

The motor is made specifically for steering vanes inside
vehicle air-conditioning units, its not designed to be very precise
(the backlash is large, for instance), its designed to be easy to drive from
a 5V control circuit and just powerful enough to do the job.  The large
gear ratio is to increase the torque to resist forces on the vanes more
than anything.

Its very cheap because its made in 10^8 quantities probably.
Title: Re: Geared Stepper Motor
Post by: steinie44 on Sep 01, 2014, 04:05 pm
I think, one thing that has been completely overlooked in this thread is the frequency of your Arduino. If anyone has programmed a millis clock will know the problem you run into. Not all Arduinos run at exactly the same speed, close, but not exact.
Title: Re: Geared Stepper Motor
Post by: MarkT on Sep 01, 2014, 06:12 pm
The Duemilanova came as standard with a 16MHz quartz crystal, so it could be
used to determine accurate times and frequencies.

The Uno comes with a cheap 16MHz ceramic resonator, only accurate to 0.5% or
something like that.   My Uno had space to solder on a quartz crystal in place of
the resonator so I did that, as sometimes you want accurate time.

This is a bit of a step back IMO.  I hope the recent versions of the Uno allow such
a repair job to be performed...