Pages: 1 2 [3] 4 5 ... 10   Go Down
Author Topic: 28BYJ-48 5-Volt Stepper  (Read 85191 times)
0 Members and 2 Guests are viewing this topic.
Offline Offline
Jr. Member
**
Karma: 3
Posts: 52
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The nano's supply is inadequate for the stepper. I used a separate 5v supply and just tied the grounds.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 6
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

@sbright33:
Hi! Do you have a new version of your code? Can you explain better your idea about the angle for motors x, y?

J
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

My newer library is on another thread here.  Many improvements.  More coming.  PWM to make it smoother.  Non-blocking to free up the processor for other tasks.  Higher voltage to increase performance without getting hot...

I'd like to move 2 motors called x,y at the same time.  Pointing a laser for example.  While the laser is on when you go from 0,0 to 10,10 it should move at a 45 degree angle.  That's simple just move 1x,1y,1x,1y... until you get to 10.  Or move them simultaneously.  Not so simple when you're going to 75,80 or an arbitrary x,y.  There must be an easy algorithm?  I don't know it.  Anyone?
Logged

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

Skype Brighteyes3333
(262) 696-9619

Phoenix, Arizona USA
Offline Offline
Faraday Member
**
Karma: 41
Posts: 5610
Where's the beer?
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

There must be an easy algorithm?  I don't know it.  Anyone?

http://en.wikipedia.org/wiki/Bresenham%27s_line_algorithm

Fairly simple for 2D stuff (there are tons of implementations out there - it is used for line drawing in 2D graphics); not sure what it would take to add a 3rd stepper (or more). You might also look into the few g-code interpreter implementations for the Arduino that are out there...
Logged

I will not respond to Arduino help PM's from random forum users; if you have such a question, start a new topic thread.

Phoenix, Arizona USA
Offline Offline
Faraday Member
**
Karma: 41
Posts: 5610
Where's the beer?
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Found this; the links still work:

http://www.gamedev.net/topic/536735-bresenham-2d-3d-4d-6d/
Logged

I will not respond to Arduino help PM's from random forum users; if you have such a question, start a new topic thread.

Phoenix, Arizona USA
Offline Offline
Faraday Member
**
Karma: 41
Posts: 5610
Where's the beer?
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

BTW - that 6D one looks like it could be easily generalized to N-degrees...
Logged

I will not respond to Arduino help PM's from random forum users; if you have such a question, start a new topic thread.

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

Your first link looks really simple!  I like simple.
Only 10 lines of code in the loop.  Thanks!
2D is enough.
Logged

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

Skype Brighteyes3333
(262) 696-9619

0
Offline Offline
Newbie
*
Karma: 0
Posts: 6
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

did that algorithm work for pointing at x,y?
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

Yes, in my simple experiments.  Only 10 lines of code it is easy to follow.  I've been sidetracked by a few other projects hope to get back to this.  The whole point of Bresenham is to make a straight line while moving to arbitrary x,y.
Logged

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

Skype Brighteyes3333
(262) 696-9619

Wales
Offline Offline
Jr. Member
**
Karma: 0
Posts: 57
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

My newer library is on another thread here.  Many improvements.  More coming.  PWM to make it smoother.  Non-blocking to free up the processor for other tasks.  Higher voltage to increase performance without getting hot...

Hi sbright33, many thanks for your library. But I cannot find this newer version. Would you mind sharing the link?

I'm glad I found this, because with the standard library 28BYJ was getting very hot an not really behaving well!

I had trouble cobbling the code together from the various bits in this thread. Is there any particular reason to be pasting inline rather than just use a standard code-bin like pastebin or gist? If it helps anyone else, I put the latest version I could find on https://gist.github.com/4149982

The advantage of using something like Gist is that you can update the one file whenever you like and the forum link will always be up to date then.

Please don't take this as any criticism of your excellent library - it's just a newbie asking a newbie question!
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

Thanks for your compliments and posting my old code on Gist.  I can update that site now?  Will do it with a few different versions.  It has branched off to a few since 2011.  One for a bigger motor without gears.  One for multiple steppers and servos together non-blocking with scripts.  One using PWM.  One to detect higher loads when the motor reaches travel limits.  I could try to put them all together, or keep them separate.  I also have a simple version for beginners which includes running cool and acceleration.  This might be a great introduction for new users to understand first before it gets complicated.
Logged

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

Skype Brighteyes3333
(262) 696-9619

Wales
Offline Offline
Jr. Member
**
Karma: 0
Posts: 57
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for your compliments and posting my old code on Gist.  I can update that site now?  Will do it with a few different versions.

Would love to see your new versions! You can't edit my pasted code there, but creating a new account takes less than a minute and is free. You can either "fork" my copy of the code into your account, or just start again. If you want me to now remove my copy of the code I'm happy to delete it and replace it with a link to your new code.

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

Viewed 6900 times exactly!
Logged

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

Skype Brighteyes3333
(262) 696-9619

Wales
Offline Offline
Jr. Member
**
Karma: 0
Posts: 57
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Viewed 6900 times exactly!

Indeed. Which shows how popular your library is and how many people would appreciate the updates being made available!

If you have many versions, the other thing you could do would be to create a repository over at github. Then you have versioning and code commenting and people can suggest changes or improvements or bugfixes, they can follow the project and be notified of changes etc.

In fact, Arduino itself lives right there! https://github.com/arduino/Arduino

It might look scary to start with, but you'll soon see how easy it is. https://help.github.com/articles/create-a-repo

If there's anything I can do to help, please let me know.
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

According to your link, Step 1 and 2 are on my local machine?  But I don't have Linux.  How do I do this with windows?
Should I just start with Gist?  I get it!
Logged

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

Skype Brighteyes3333
(262) 696-9619

Pages: 1 2 [3] 4 5 ... 10   Go Up
Jump to: