Offline
Jr. Member
Karma: 2
Posts: 55
|
 |
« Reply #30 on: February 06, 2012, 11:02:07 pm » |
The nano's supply is inadequate for the stepper. I used a separate 5v supply and just tied the grounds.
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 6
Arduino rocks
|
 |
« Reply #31 on: February 26, 2012, 07:56:06 pm » |
@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
Edison Member
Karma: 4
Posts: 1131
If you're not living on the Edge, you're taking up too much space!
|
 |
« Reply #32 on: February 27, 2012, 12:29:53 pm » |
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
Faraday Member
Karma: 27
Posts: 5078
Where's the beer?
|
 |
« Reply #33 on: February 27, 2012, 01:39:11 pm » |
There must be an easy algorithm? I don't know it. Anyone?
http://en.wikipedia.org/wiki/Bresenham%27s_line_algorithmFairly 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
|
|
|
|
|
Phoenix, Arizona USA
Offline
Faraday Member
Karma: 27
Posts: 5078
Where's the beer?
|
 |
« Reply #34 on: February 27, 2012, 01:41:06 pm » |
|
|
|
|
|
Logged
|
|
|
|
|
Phoenix, Arizona USA
Offline
Faraday Member
Karma: 27
Posts: 5078
Where's the beer?
|
 |
« Reply #35 on: February 27, 2012, 01:42:41 pm » |
BTW - that 6D one looks like it could be easily generalized to N-degrees...
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Edison Member
Karma: 4
Posts: 1131
If you're not living on the Edge, you're taking up too much space!
|
 |
« Reply #36 on: February 27, 2012, 04:44:42 pm » |
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
Newbie
Karma: 0
Posts: 6
Arduino rocks
|
 |
« Reply #37 on: March 28, 2012, 10:30:20 am » |
did that algorithm work for pointing at x,y?
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Edison Member
Karma: 4
Posts: 1131
If you're not living on the Edge, you're taking up too much space!
|
 |
« Reply #38 on: March 28, 2012, 01:19:07 pm » |
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
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 10
|
 |
« Reply #39 on: November 26, 2012, 03:15:14 pm » |
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/4149982The 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
Edison Member
Karma: 4
Posts: 1131
If you're not living on the Edge, you're taking up too much space!
|
 |
« Reply #40 on: November 27, 2012, 12:26:45 pm » |
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
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 10
|
 |
« Reply #41 on: November 27, 2012, 01:13:02 pm » |
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
Edison Member
Karma: 4
Posts: 1131
If you're not living on the Edge, you're taking up too much space!
|
 |
« Reply #42 on: November 27, 2012, 02:53:54 pm » |
Viewed 6900 times exactly!
|
|
|
|
|
Logged
|
If you fall... I'll be there for you! -Floor
Skype Brighteyes3333 (262) 696-9619
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 10
|
 |
« Reply #43 on: November 27, 2012, 03:18:33 pm » |
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/ArduinoIt might look scary to start with, but you'll soon see how easy it is. https://help.github.com/articles/create-a-repoIf there's anything I can do to help, please let me know.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Edison Member
Karma: 4
Posts: 1131
If you're not living on the Edge, you're taking up too much space!
|
 |
« Reply #44 on: November 27, 2012, 08:17:39 pm » |
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
|
|
|
|
|