Shop OBEX P1 Docs P2 Docs Learn Events
Prop driving a stepper motor — Parallax Forums

Prop driving a stepper motor

Graham StablerGraham Stabler Posts: 2,510
edited 2007-10-24 23:03 in Propeller 1
Nothing all that impressive I suppose by the sound of it but I do have the propeller driving a stepper motor using a counter module in NCO mode, the frequency is updated at regular intervals by the algorithm to implement acceleration, constant speed and decelleration or if the move is short just acceleration and decelleration. All with perfectly lineat frequency increase/decrease. Distance travelled in steps is the frequency applied in each update time period multiplied by that period and the algorithm tweaks appropriately to ensure the wanted distance is acheived.

Here is a video, the speed is restricted by the hardware, 2mm lead, 8X microstepping and 26v on the stepper. In theory it can produce pulse rates up to 40Mhz but that is not useful as you cannot store the distances travelled even if you had a motor/application needing that sort of frequency

www.youtube.com/watch?v=bAgV2vtI468

No code yet but will probably follow, I'd also like to get 2-axis co-ordinated motion working eventually.

If anyone is interested the method uses is based on that of the g-rex motion controller by geckodrive.com.

Cheers,

Graham
«1

Comments

  • Graham StablerGraham Stabler Posts: 2,510
    edited 2007-10-19 15:12
    Right that's it! I'm going to try and get my copley/thk linear servo module working in step and direction mode, then you will be impressed!!

    Graham
  • AleAle Posts: 2,363
    edited 2007-10-19 16:24
    I watched the video..., well the setup looks really nice for a plotter or CNC machine, how small is your smallest step ?... Did you try to do some "music" with it ?, like with the printers and scanners ?, jeje it is fun.

    Will you post the circuit ? smile.gif, the soft ? (I never used a stepper motor before, well never had the need, but if you have some soft for brushless 3 phase motors... that will be a deal). Nice work !
  • Graham StablerGraham Stabler Posts: 2,510
    edited 2007-10-19 16:26
    To clarify, the propeller is acting as a motion controller, it outputs step and direction pulses to commercial stepper motor drives. Those are 8X micro stepping but positional accuracy is to the half step which for a 200 step motor and 2mm lead is 0.005mm

    Graham
  • Fred HawkinsFred Hawkins Posts: 997
    edited 2007-10-19 17:36
    Graham, how do you decide the starting speed? And is there a minimum distance that requires an offset move and return to properly arrive at the position?
  • BergamotBergamot Posts: 185
    edited 2007-10-19 19:43
    I'm having pac man flashbacks... burger.gif
  • Graham StablerGraham Stabler Posts: 2,510
    edited 2007-10-19 19:49
    Fred Hawkins said...
    Graham, how do you decide the starting speed? And is there a minimum distance that requires an offset move and return to properly arrive at the position?

    Starting speed is determined by the acceleration acc is added to velocity on each loop.

    I'm not sure what you mean by an offset move?

    Graham
  • bambinobambino Posts: 789
    edited 2007-10-20 06:09
    When you say commercial drives, are you saying the prop is talking to a driver chip, or is it useing fet's to talk to a commercial drive. Saw the video, Is the motor that loud or is that the gear box?
  • Graham StablerGraham Stabler Posts: 2,510
    edited 2007-10-20 10:45
    It sends step and direction pulses to a stepper motor driver board which does include a chip. The point is that it produces step and direction signals in the same way that software like mach3 and turboCNC do except it can produce extremely high pulse rates.

    The motor is not noisey but the combination of motor and leadscrew are, with a ballscrew it would be very quiet.

    Graham
  • bambinobambino Posts: 789
    edited 2007-10-20 11:24
    I have collected every stepper I could get my hands on from old printers and such hopeing someday I could figure them out.
    I think I have a good understanding of them now. And I'm pretty sure I have all the parts I need. I just don't have the time!
  • Don DDon D Posts: 27
    edited 2007-10-22 14:17
    You might be interested in these alternate drivers:
    http://www.arcus-technology.com/performax_1cd.php

    Or for the minimalist,
    http://www.allegromicro.com/en/Products/Part_Numbers/3984/3984.pdf
    (They also have lower current versions)
  • Graham StablerGraham Stabler Posts: 2,510
    edited 2007-10-23 11:56
    Hi Don, as far as the minimal drivers I am more than happy to let the pros put these on well designed PCBs and let me buy them, this is because I come from the CNC side of things and just think of them as parts. Plus buying 86 high quality IMs drives on ebay for a bargain price helps [noparse]:)[/noparse] (most are now sold and I play with the left overs)

    The arcus drives are interesting but the propeller combined with a stepper amp/drive can do exactly the same thing, the propeller could easily take a serial command and convert it into motion except the propeller can produce higher pulse rates too!

    Here is another video, I can now set the number of steps accurately, here the motor performs 50 revolutions:

    www.youtube.com/watch?v=dwtY6gTwQNs

    It also proves it is not an inherently noisy motor [noparse]:)[/noparse]

    I also have another video (not posted) that shows what happens if you make the maximum speed too high, its quite weird.

    Graham
  • Don DDon D Posts: 27
    edited 2007-10-23 13:55
    I agree with the minimal drivers, I also tend to follow the path of least resistance to the goal... However, I suppose someone on this forum might be interested in creating something with them...

    What these options offer are micro-stepping and PWM constant-current drive which gives much better stepper performance on the speed-torque curve than simple constant voltage drives. The Allegro chips are VERY inexpensive and I would certainly consider marrying them to a propeller design before using transistors or other dumb devices.

    For forum readers (re: Maximum speed too high):
    Steppers have certain bands of speeds at which they will cease to move smoothly. The motor and the mechanical system to which it is connected start to step unpredictably at certain resonant speeds. There is also a maximum speed at which the torque required exceeds the torque available from the motor -- Under certain stepping conditions, it is also possible for the motor to actually reverse direction.
  • Fred HawkinsFred Hawkins Posts: 997
    edited 2007-10-23 14:03
    Graham,
    do you bother to stop the motor when you have it bolted in place? It seemed to take a while to spin down to stop in your video.

    Too high speed: probably goes in and out of phase and lurching from speeding up to slowing down.

    Fred
  • Graham StablerGraham Stabler Posts: 2,510
    edited 2007-10-23 15:04
    Don, I agree with you, if you don't want to go the whole hog of a fully built amp but do want decent performance then they will work rather nicely.

    Fred,

    Yes at the end of a move the motor is stopped although not for long.

    In the video with the actuator the acceleration is quite high and the maximum speed is lower. In the video of just the motor because I am running it up to a high speed I make the acceleration quite low (well compared to the max) so the rotor can keep up, the deceleration takes so long because it is coming down from a high speed.

    At really high pulse rates I have seen the motor move backwards in a really odd way. In the video it just falls out of sync altogether but amusingly still sounds like it is accelerating, only right at the end does it ever start moving again.

    Graham
  • Don DDon D Posts: 27
    edited 2007-10-23 17:22
    GS> At really high pulse rates I have seen the motor move backwards in a really odd way.

    The stepper should swiftly accelerate and decelerate (limited by system mass and friction) through whatever mechanical resonances your system has to some reliable high speed as suggested by the torque v.s. speed envelope.

    While this is not intuitive, too little acceleration can be just as detrimental as too much. Experimentation is normally required to determine suitable parameters for acceleration, start and maximum frequencies. One test is to mount a dial gauge at one end to make sure you're not losing pulses.

    But you probably know all this, so I'll sit down and shut up now... : )

    Nice work though... I was looking at using the Propeller for just such a purpose.
  • Graham StablerGraham Stabler Posts: 2,510
    edited 2007-10-23 19:16
    No need to shut up, someone will find it useful [noparse];)[/noparse]

    Why would too low an acceleration be a problem?

    When I say really high I really mean really high, far beyond the motor and drive voltage.

    Graham
  • Don DDon D Posts: 27
    edited 2007-10-23 19:48
    What's happening is that the speed 'loiters' in a resonant band for too long and mechanical oscillation problems start revealing themselves. Once you identify these specific resonant frequencies, you must accelerate through them decisively as opposed to providing the right conditions to cause oscillation.

    Think of the famous video everyone has seen where the bridge resonated itself to pieces under the right wind conditions. Basically the same principle applies here.

    Re really high frequencies: Ah, you are driving the motor using beat frequencies. Fun I suppose, but not too useful...

    If you use a constant current driver, you will achieve higher stepping speeds and better performance altogether.
  • Graham StablerGraham Stabler Posts: 2,510
    edited 2007-10-23 20:36
    I choose speed based on the cutting I'm doing, sometimes it is fast sometimes slow. The geckodrive I'm using has anti-midband resonance circuitry but beyond that if I had a serious problem I would look at viscous dampers etc on the shafts. I have certainly never thought I should need to give thought to specific resonances when actually using the machine, it may just as well loiter in these bands when cutting as accelerating.

    The high frequency was just me exprimenting to see how fast I could run it.

    I am using constant current drivers.

    Graham
  • jammajamma Posts: 33
    edited 2007-10-23 20:43
    Cool stuff, Graham. Any plans to integrate with Mach 3? Has Art opened up an API for pulse generators that you could hook into?
  • Graham StablerGraham Stabler Posts: 2,510
    edited 2007-10-23 21:05
    I don't think I want to go that way, the g-rex which this generation method is inspired by already does that as does the ncPOD I think.

    Graham
  • James NewmanJames Newman Posts: 133
    edited 2007-10-24 02:43
    I gave a quote to my boss's boss today for making a control for the single axis on our break-press. I pretty much won't make much of anything, but I would like to do it for the experience. I would use the propeller and a motor controller board as you have. I've built a microstepping stepper motor controller using the propeller, (not using a motor controller chip at all), but I won't use it as I have yet to test it out properly. So we'll see what happens. I've been a CNC machinist for a year now, didn't know what an allen wrench was before I got there, now I draw up prints, write the programs by hand, make the setups, do production, etc. Hell, I even pickup tools from the local tooling place. Not sure how my progress compares to others, but I feel as though I've gone far... now if I could only get my pay raised above the local 7-11... (I make $9usd/hr)
  • Graham StablerGraham Stabler Posts: 2,510
    edited 2007-10-24 09:42
    Duck to water by the sounds of it.
  • Don DDon D Posts: 27
    edited 2007-10-24 13:55
    Graham:

    You're way ahead -- With anti-midband-resonance circuitry (and/or firmware), you may not have to worry about any stalling problem. I'm not sure how this circuitry performs under varying loads in the resonant ranges, but it sounds like you are cutting successfully at a variety of speeds...

    I might just order one of those drives...
  • Graham StablerGraham Stabler Posts: 2,510
    edited 2007-10-24 14:04
    On my little mill I don't have any anti resonance stuff but have never really had any problems but I think that is because of short lead screws attached at both ends. For a system to be resonant and for that be a problem then it needs some elastic storage, long thin lead screws are a particular nightmare.

    Graham
  • James NewmanJames Newman Posts: 133
    edited 2007-10-24 16:03
    Did you build your own cnc mill, or is it a retrofit? I need something to test my stepper driver on, and control stuff, but even small mills cost hundreds and usually have extreme backlash. I'm considering making my own simple X-Y-Z 'positioning' table.
  • Graham StablerGraham Stabler Posts: 2,510
    edited 2007-10-24 16:08
    This is my mill: www.indoor.flyer.co.uk/millingmachine.htm

    I converted it myself and it makes useful parts, the spindle is actually excellent, steel three-slot collets up to 1/8th and up to 20krpm, great for tiny carbide tooling. It uses all thread on the leadscrews and delrin leadnuts and has surprisingly little backlash. Only downside is the limited working envelope.

    My site doesn't show it but I have now done quite a bit of work in aluminum, it makes great d-type cut outs!

    Hmm, let me find a picture

    Graham
  • Graham StablerGraham Stabler Posts: 2,510
    edited 2007-10-24 16:11
    As you can see, I just needed to position the cutouts at the edges [noparse]:)[/noparse]

    No deburring required!

    Graham
    800 x 600 - 105K
    800 x 600 - 51K
  • NewzedNewzed Posts: 2,503
    edited 2007-10-24 16:15
    Graham, it looks like you are using the same mill as I am - a converted Proxxon MF70.· Mine works great.· I have a Prop Demo Board driving three steppers, using two speeds.· The faster is for etching the board, the slower one is for trimming the board with an .040 router.

    Sid

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Yesterday is history, tomorrow is a mystery, and today is a gift.

    That is why they call it the present.

    Don't have VGA?
    Newzed@aol.com
    ·
  • Graham StablerGraham Stabler Posts: 2,510
    edited 2007-10-24 16:17
    It certainly is Sid, I think I first chatted with you on the forum about that very topic.

    Graham
  • James NewmanJames Newman Posts: 133
    edited 2007-10-24 17:48
    Wow, you've got alot of projects. Reminds me of me, except you've actually made it somewhere with most of them. tongue.gif

    Ouch, less than 6"x2"? the 6 isn't bad imo, but the <2 makes me want to cry.

    My budget is almost non-existent. I have motors, I have all I need to prototype my motor drivers, but getting a physical machine to mount them on has proven to be more expensive than I can afford. Even when I find something I could possibly afford, the shipping kills me. My best bet has been that there is a harbor freight outlet in my city, and they should have this http://www.harborfreight.com/cpi/ctaf/Displayitem.taf?itemnumber=47158.

    However, I've almost thrown the idea away due to my boss telling me that their machines have lots of backlash. I need to go down there and look at them myself...

    I have access to cnc mills and a cnc lathe at work, but I can't even get to a point when they would be usefull to me. I drew up plans for making my own from some scrap metals around the shop, but bearings of different sort raises the price to above mills I could buy. Anyway, starting to sound emo tongue.gif

    Nice projects once again, I've been a bit interested in EDM since I found out such a thing existed, going to go read your page some more now.
Sign In or Register to comment.