Author Topic: 3d Printed Working Stepper Motor Powered by Digispark  (Read 13006 times)

CristobalGordo

  • Newbie
  • *
  • Posts: 5
3d Printed Working Stepper Motor Powered by Digispark
« on: April 09, 2013, 12:14:01 pm »
This is a programmable stepper motor and driver that I made out of some nails, magnet wire, neodymium magnets, a Digispark, and a 3D printed piece that I designed around these things. 
Heres's a linkto the YouTube video- http://www.youtube.com/watch?v=paT63-8DLbs&feature=share&list=UUVG1PI-SceL_F6BVS2grLbQ
My goal was to make something about the size of a business card that moved. You can't exactly fit it in your wallet but it does indeed move.  It just a first draft- there's lots of room for improvement.  It has a step angle of 15 degrees (although the way I'm driving it, it is 7.5 degrees.) I saw a schematic diagram explaining how a stepper works with eight electromagnets and six permanent magnets in the center and I thought that layout might look cool.  It also does illustrate well how stepper motors work. The white parts were designed in a CAD program, made from WSF material and printed at Shapeways.  The ends of the shaft are cone shaped and pointy.  They are held in place by slightly wider conical indents.  The shaft was slightly longer than the space and I got it in there by pulling it open a little bit.  The material needed to be flexible for this.  The magnets are held in place by epoxy. (It's not fun working with strong little tiny magnets that want to stick together but are also covered with epoxy.  It was a mess and there was swearing.  It was also important that they all be oriented with the same polarity facing out.)  The driver chip is a uln2003 transistor array and it is being controlled by a digispark which is a little arduino compatable microcontroller.  It can be programmed by plugging it in the usb, but it needs an external 20V source to run it.  (I know 20V is high but I just kind of guessed with the electromagnets and that's what they needed to run.  Originally, I had it work with12V with the electromagnets repelling the rotor instead of attracting it, but I think that began to demagnetize the rotor magnets and it gradually stopped working.)  In this video, I just have it run through a series of movements to show that it really works.  I find it's best to shoot your project videos soon before you fry something and it doesn't work anymore.  Not that that is going to happen here....Anyway, thanks for watching.

forsakenrider

  • Newbie
  • *
  • Posts: 26
Re: 3d Printed Working Stepper Motor Powered by Digispark
« Reply #1 on: April 09, 2013, 12:21:08 pm »
VERY cool. nice project! Im looking forward to the developments!

forsakenrider

  • Newbie
  • *
  • Posts: 26
Re: 3d Printed Working Stepper Motor Powered by Digispark
« Reply #2 on: April 09, 2013, 12:58:58 pm »
PS- would you share your schematic and code? You've given me an idea!

CristobalGordo

  • Newbie
  • *
  • Posts: 5
Re: 3d Printed Working Stepper Motor Powered by Digispark
« Reply #3 on: April 09, 2013, 01:32:18 pm »
 I'm not sure what your level is.  If you don't know how to turn something on and off with an arduino and a transistor, start there.  A transistor array is just a package of many transistors together (7 in this case but I only use 4) and they are used to turn on and off the four coil pairs.   The chip on the side is a ULN2003 transistor array.  I connected four outputs from the digispark (0,1,2,4 not 5 because its high is only 3V and not 3 because I didn't understand the note about its internal pullup or down resistor) to four inputs on the transistor array.  Opposite coils are connected to each other.  So the four pairs are connected to the outputs of the transistor array- basically when you set, say, pin 0 HIGH, the corresponding coil pair is turned on.  Cycling through each pair spins the motor.  That's really all the code is.  To make it go in reverse you reverse the order of turning on the coils.  If you search ULN2003 and stepper motor you'll see lots of schematics.  Cheap Chinese 5V stepper motors on Ebay come with a little board with this chip.  Does that help?
« Last Edit: April 09, 2013, 04:33:30 pm by CristobalGordo »

forsakenrider

  • Newbie
  • *
  • Posts: 26
Re: 3d Printed Working Stepper Motor Powered by Digispark
« Reply #4 on: April 09, 2013, 01:39:42 pm »
Yup, I had kinda figured that while googling around.

I noticed some diagrams of stepper motors have N and S magnets on the spindle, but you said yours are all the same?

I was thinking of taking a small brushless outrunner motor, re-arranging the magnets and re-winding the coils to make a stepper motor. Should work I think.

CristobalGordo

  • Newbie
  • *
  • Posts: 5
Re: 3d Printed Working Stepper Motor Powered by Digispark
« Reply #5 on: April 09, 2013, 01:48:52 pm »
Yeah all my magnets are oriented the same way.  That way I didn't have to worry about changing the current flow in the coils.  When on, all coils are south (say) pulling on the north poll of the permanent magnets.  To reverse the coil's pole I'd need H-bridges which would be more complicated.  I wanted to keep it simple and small.  Brushless motors and steppers are similar I believe.  Steppers are in fact brushless too.  Not sure what the difference is off the top of my head.

digistump

  • Administrator
  • Hero Member
  • *****
  • Posts: 1465
Re: 3d Printed Working Stepper Motor Powered by Digispark
« Reply #6 on: April 09, 2013, 03:42:46 pm »
CristobalGordo - awesome project - this came out great! I hope you don't mind, we've featured this as our first project of the day on the homepage: http://digistump.com/


I especially love projects like this which really show how something works at a deeper level - thanks for sharing!

CristobalGordo

  • Newbie
  • *
  • Posts: 5
Re: 3d Printed Working Stepper Motor Powered by Digispark
« Reply #7 on: April 09, 2013, 03:49:51 pm »
Thanks I appreciate that.  The video that you posted was the first test video before I added the digispark.  Better if you use this video-
http://youtu.be/paT63-8DLbs
Thanks again.

digistump

  • Administrator
  • Hero Member
  • *****
  • Posts: 1465
Re: 3d Printed Working Stepper Motor Powered by Digispark
« Reply #8 on: April 09, 2013, 04:00:40 pm »
Fixed the video - thanks again!

Tommy_2Tall

  • Newbie
  • *
  • Posts: 13
Re: 3d Printed Working Stepper Motor Powered by Digispark
« Reply #9 on: April 09, 2013, 11:15:47 pm »
Awesome work Chris'!

As a long time Shapeways fan/customer/wannabe-designer and a more recent ATtiny "aficionado" (thanks to Erik and the Digispark) I love seeing some good old WSF prints with a DigiSpark squeezed in there. :-D

How well does those axles hold up to the spinning/friction? Epoxy-reinforced WSF at the cones?
I did a card-holder with a spring-lock in WSF but the tabs for the spring-lock seemed to wear down pretty fast at first until it kind of "settled" after some repeated usage..
I know it's crazy strong and very flexible but the constant grinding of those cones would get me worried. :-)

CristobalGordo

  • Newbie
  • *
  • Posts: 5
Re: 3d Printed Working Stepper Motor Powered by Digispark
« Reply #10 on: April 10, 2013, 01:47:40 am »
Rotating shafts are always tricky since too tight a fit and they fuse or have lots of friction, too loose and there is wobble. I tried this approach with the springiness holding the pointy ends in place.  It's not an ideal solution for every situation like this (it can't support much weight pulling perpendicularly to the shaft) but it worked ok here.  It probably won't last forever though.  I like the idea of reinforcing the pointy ends with epoxy.  This wasn't really meant to be a load bearing, durable motor so I just used a design that minimized the friction as best I could.
Anyway, thanks for your compliments.