Pages: 1 ... 4 5 [6] 7 8 ... 10   Go Down
Author Topic: 28BYJ-48 5-Volt Stepper  (Read 80112 times)
0 Members and 2 Guests are viewing this topic.
Offline Offline
Edison Member
*
Karma: 8
Posts: 1341
If you're not living on the Edge, you're taking up too much space!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

What he said.  Seriously.  My code does support acceleration in many of the functions so you can achieve the results in AccelStepper library without any effort.  Even using 5v.  12v is capable of going much faster with the only difficulty that celem mentioned.
Logged

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

Skype Brighteyes3333
(262) 696-9619

Offline Offline
Jr. Member
**
Karma: 3
Posts: 52
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

sbright33 - re "What he said.  Seriously." No offence intended - your library and the empirical research behind it are commendable and it is just that your RPMs exceed the factory specifications and my personal experience. I have never tried running that stepper on 12V nor the resistors and capacitors. Maybe I'll try it when the time is available (if I can dig up a suitable 12V PS). I do have copies of your step1a.pde and step1p1dps.pde. Is there another version that I should try instead?
Logged

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

Here is the newest version for 28BYJ-48.

https://gist.github.com/sbright33/4178431

12v is reliable, you just have to mind the heat.  This means you cannot run at full speed for 20 minutes.  You can go slow forever using the "cool" functions.  Or go full speed then stop to let it cool down.
Logged

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

Skype Brighteyes3333
(262) 696-9619

Kelowna, BC Canada
Offline Offline
Newbie
*
Karma: 0
Posts: 17
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Reply #74 on: March 13, 2013, 06:13:49 AM

Thanks very much for the information.  I have a very big learning process ahead of me.  I have bookmarked serveral of your suggestions so I can come back to them as required.
Logged

Harvey
in Kelowna, BC

Brazil
Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,

  I've been doing some tests with this motor and I found that it misses some steps in two situations:

1. If you use speeds higher than 14 RPM;
2. If you change the direction frequently.

Case 1 seems normal. It must have a limit when the motor can't rotate fast enough to follow the signals.

Case 2 is something more strange. I created a small sketch where the motor turns an angle based in the value of a potentiometer. The noise in the readings of the potentiometer makes the motor go forward/backward often. When I turn the potentiometer to the limit, it doesn't come back to the initial position. I could get some good precision only if I reduce the speed down to 8 RPM.

Have you noticed this?
Logged

Offline Offline
Jr. Member
**
Karma: 3
Posts: 52
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

izanette - I have never tested for precision.  However, I would prefer to see programmatic tests without using a potentiometer. For example, running a securely fastened  stepper via test software to a set-point position, mechanically marking the position, then pseudo-randomly run the stepper back and forth and finally return to the set-point position and verify its position to the previous mark.
Logged

Brazil
Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

izanette - I have never tested for precision.  However, I would prefer to see programmatic tests without using a potentiometer. For example, running a securely fastened  stepper via test software to a set-point position, mechanically marking the position, then pseudo-randomly run the stepper back and forth and finally return to the set-point position and verify its position to the previous mark.

Hi celem,

Yes, I agree that it is better to have some random movements to make it easier for anyone to reproduce the experiment. So, I created this simple sketch:

Code:
/*
 * Brownian motion
 *
 * A stepper motor moves forward by randomically chosen steps.
 *
 */

#include <Stepper.h>

// change this to the number of steps on your motor
#define STEPS 2038

// create an instance of the stepper class, specifying
// the number of steps of the motor and the pins it's
// attached to
Stepper stepper(STEPS, 8, 10, 9, 11);

// the position of the motor
int pos = 0;

// end of the brownian movement
boolean finish = false;

void setup()
{
  // set the speed of the motor to 7 RPMs
  // values higher than this leads to lose of steps
  stepper.setSpeed(7);
}

void loop()
{
  if (!finish)
  {
    // choose a value from -5 to 10
    // statistically, it will move forward.
    int movement = random(-5, 10);
   
    stepper.step(movement);

    // saves the position of the motor
    pos += movement;
   
    // finishes when it completes 2 turns
    if (pos > 2 * STEPS)
    {
      finish = true;
     
      // returns to the initial position
      stepper.step(-pos);
    }
  }
}

  Using it, I found out that the speed limit is even lower: 7 RPM. I'm using 4 NiMh batteries to power the motor, they supply about 4.8V. Maybe with a higher voltage it is possible to achieve higher speeds without loosing steps.
Logged

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

That makes sense to me.  You can only go 7RPM when you change directions without a delay.  You can go 14RPM in one direction.  The solution is simple.  Go 14RPM, then stop for a short delay before changing directions.  It's easy to calculate the delay using 7RPM.  It's just twice the delay between steps at 14RPM.

Why not use 12V as in my code?  You can change the duty cycle while moving so it never gets warm.  Increase it back to 100% for 1 step before and after you change directions.  This will give you 30RPM without any delay, even when changing directions.  That's 4x faster.
Logged

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

Skype Brighteyes3333
(262) 696-9619

Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Here is the newest version for 28BYJ-48.

https://gist.github.com/sbright33/4178431

12v is reliable, you just have to mind the heat.  This means you cannot run at full speed for 20 minutes.  You can go slow forever using the "cool" functions.  Or go full speed then stop to let it cool down.
For sure there's something that I didn't understood but, after using, with success, the first sketch on this post, I'm trying the last one without obtaining nothing of good. The four red leds on the PCB stay fixed without blinking.
In the setup there's no declaration of potentiometer to drive the motor. Is there something, due to my ignorance, that I miss? Thank You!
Logged

Kelowna, BC Canada
Offline Offline
Newbie
*
Karma: 0
Posts: 17
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I am having trouble.   I found one code that I actually got to work, giving me the 1 RPM.  I have to admit I did not save it and cannot find it again for love nor money.. For some of my previous postings you can refer to # 70 area.  I Have had several other projects that needed my attention thus the delay in getting back to Stepper Motors.

 I am wanting to start out fresh, and see if starting with a clean slate gets me on the right track.

I have some (5 sets) new motors and the 2003 drivers that should be on my door step in the next few days.  I also have two of the A4983 driver boards.

My first objective is to load a fresh sketch with code that I know has been proven.  I see several within these pages but am confused as I know zero about reading the codes.  Your direction again to the correct code for the basic forward reverse operation would be greatly appreciated.

Once I get the new motors and boards, I will try to keep my nose to the grind stone until I get this mastered. Thanks so much for your help.


Logged

Harvey
in Kelowna, BC

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

I don't think my code is compatible with A4983.  Try it with ULN2003.

Just download my code from Gist.  Try one function call at a time in Loop() until you get the hang of it.
Logged

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

Skype Brighteyes3333
(262) 696-9619

Cincinnati, OH
Online Online
God Member
*****
Karma: 43
Posts: 766
I'm not bossy...I just know what you should be doing.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

HarrisCreekCentral:

I have a copy of Jack Purdum's Beginning C for the Arduino and would be happy to send it to you. (I pretty much know what's in it now.) I have a junk email account at h656775@yahoo.com if you want to send me your mailing address. On the email subject line write something like "Arduino C Book" so I don't just delete it!
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for your work on this!
I'm new to Arduino, but your code makes sense so far apart from a few things...

My current Loop (test) code is:

Code:
 
  ramp(false, 1200);
  dw(13,HIGH);  
  degrpmslowCool4(false, 3.6, 1200);

I'd expect this to ramp up, then when the LED comes on to do one rotation - I assumed "deg100" is the number of degrees divided by 100. But it spins round more than that (around 2 times ish).

Can you clarify how the values work? My eventual goal for my project is to get the motor rotating at a known speed (doesn't need to be fast, a few RPM is enough, but I do need to know the speed is reasonably accurate; i.e. whatever function to run at a consistent 6rpm would be fine)


**EDIT**
Actually, just having this command in my loop:

Code:
degrpmEZ(false,90,1200); 

Will leave the motor just spinning forever- so I guess the "deg100" is not what I think it is. And if my loop only has degrpmslowCool4(false, 3.6, 1200); in it, the motor never even moves..?
« Last Edit: June 08, 2013, 09:28:18 am by jmbillings » Logged

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

Off the top of my head while traveling I don't recognize ramp().
36000 is 360 degrees in my function call.
1200 is 12 RPM.
Logged

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

Skype Brighteyes3333
(262) 696-9619

Belgium
Offline Offline
Sr. Member
****
Karma: 1
Posts: 281
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I wrote some non blocking code (not using the delay function) for these stepper motors a little while ago: http://www.bajdi.com/non-blocking-code-for-the-28byj-48-stepper-motor/

I have just written some code that controls 4 of these little stepper motors using 2 74HC595 shift registers. So I'm controlling the 4 motors with only 3 pins. Will post it later on my blog.
Logged


Pages: 1 ... 4 5 [6] 7 8 ... 10   Go Up
Jump to: