alternate to AFmotor shield
- This topic is empty.
2013-07-22 at 15:08 #5920AnonymousInactive
I’ve got these:
5V Stepper Motor + ULN2003 Driver Board Set from (dx.com)
and want to make a makelangelo variant — the GUI/pc side of your setup looks to be the easiest to work with of the various drawbots I’ve looked at.
the problem is that the ULN2003 is just a Darlington array. basically just allows me to directly control the stepper.
the stepper library from arduino won’t work, it’s a blocking process, but I found this library : https://github.com/adafruit/AccelStepper
I am trying to figure out what changes I need to make to the makelangelo code so I can use that with the driver boards I have.
I’m not a great coder, but I think I can make this even without a helping hand, but it will be tedious.
I would love to get a shortcut 🙂
Any suggestions?2013-08-09 at 00:35 #6384AnonymousInactive
Uh… I’m not familiar with the ULN2003. If you send the Arduino code when you get it working I can make it available to other people. You should only have to change the setup() and line() methods, if I remember correctly.2013-08-09 at 00:48 #6383AnonymousInactive
I’ll be hacking at it this weekend — if I get something working out then I’ll send it along2013-08-19 at 20:14 #6382AnonymousInactive
looks like I need to do 2 main things to substitute the accelstepper commands for the AFmotor ones, other than changing pin definitions.
define forward and backward to be 1 and -1
and make a function to handle onestep() — accelstepper equivalent would be move (1|-1); run();
If time permits this week, I’ll be testing this out.2013-08-28 at 16:41 #6386AnonymousInactive
I could put the m1.onestep() in a function on it’s own and that would make it easier to add #defines for different boards.
Will you be sharing your changes back with the github project so other people can use your solution?2013-08-29 at 20:41 #6387AnonymousInactive
I will be uploading — soon as I figure out what’s wrong with my changes 🙂 currently it takes a couple of really slow steps no matter how fast or far I tell it to go… for the first time I found myself wishing the arduino IDE had a debug mode so I could step through and see what it’s trying to do looks like print statements will have to do..
Should have time to finish up this weekend, it being labor day and all. :crosses fingers:2013-09-04 at 21:50 #6388AnonymousInactive
All right, I’ve got it mostly working, speed controls aren’t quite there(it just ignores all speed settings and uses the hard coded values, but it moves correctly.
I forked it, uploaded my changes then made a pull request.
here’s my Fork.
First time working with GitHub, so if I did it all wrong, let me know what I need to do to fix it.
Summery of what I had to change:
AccelStepper.h instead of AFMotorDrawbot.h — both should work,since the AF is a superset of the AccelStepper library — I just needed it to throw errors so I could alter all the AF-specific code
stepper initialization AF has a direction and a step pin, AccelStepper just has pins for the motorcoils.
Couldn’t figure out the FORWARD and BACKWARD functions in AccelStepper — so I defined them as 1 and -1 which works great.
replaced all the onestep() and step() instructions with Move();run();
and last, I hit the autoformat button in Arduino 1.05, and it bleeped up all the whitespace 🙁
All told quite a bit of fun, and thanks for the encouragement! I hope others find it useful.
–never really did anything other than a hello world before, other than t-SQL queries which are an entirely difference beast2013-09-05 at 19:36 #6385AnonymousInactive
Nice work! Looking forward to getting that patch in.
- You must be logged in to reply to this topic.