Last chance to enter The Hackaday Prize.

High speed stepper driving: 25k steps per second

Stepper motors are pretty easy to control with a microcontroller. But if you’re looking to run then at a high number of revolutions per second things get tricky pretty quickly. [Uwe's] been learning about and building stepper drivers for years, and recently he decided to build a high-performance driver based on a MicroChip reference design.

As with the reference design, his board uses a dsPIC33. But instead of using a series of discrete MOSFETS to switch the signals to the motor, he sourced an L298N motor driver. That’s it sticking up next to the large capacitor. When driven hard it needs its own heat sink, which [Uwe] cut from a larger CPU heat sink. During development, he decided to use interrupt-based PWM rather than the hardware PWM offered by the dsPIC. It works, but he would go the other route if doing it again.

For the pedestrian, the video after the break has all the details you need. For those that really want to dive in, [Uwe's] multi-paged write-up is worth bookmarking.

Comments

  1. Max says:

    I can’t help feeling that it would be a lot less noisy and difficult to just use a normal motor and PWM drive. I would have thought the advantage of steppers is that you can step to a particular point rather than that you can make them go fast. It does look pretty cool though! Nicely done.

    • biozz says:

      with this to go from step lets say 5 to 200,000 instead of making the slow transisiton you can make a fast transition and slow it down ahead so it stops at 200,000
      it has to be slow or else you can skip steps and that can be desastiours if your doing persision work

      its a fine alternative to the harder to use belt and encoder designs (like in inkjets)

      if you want something to simply move fast yeah a motor will do best

      but at 5000 RPM (correct me if my math is wrong) and the persision of 1.2* i dont think u can get much better!

    • oomwat says:

      The advantage of using a stepper motor over a standard is that they are able to provide much higher torque.

  2. biozz says:

    WOW amazing … i need this for my CNC … the damn thing is so painfully slow

    • amishx64 says:

      What is your voltage supply? TPI of the machine?
      Increasing the voltage gives you a lot of room for speed improvements.

    • macona says:

      That is most likely because of you configuration, not the motor driver if you are using good drivers. Run the motors as high as a voltage as your drivers will allow. Voltage=speed and current=torque. Limited voltage is limited speed.

  3. casainho says:

    I got 58k steps per second with ARM Cortex-M3 @ 100MHz on a RepRap Mendel 3D Printer:

    http://www.3dprinting-r2c2.com/?q=content/r2c2-running-reprap-mendel-his-maximum-speed-725mms

  4. tim says:

    It’s a pitty to still see those olds bipolars L298
    when there are so much newer MOSFET drivers around.
    And with tons of features and protections.
    And of course, no heat.

  5. roboman2444 says:

    anyone notice the weird sounds coming from the motor when it accelerated? sounded like a sterotypical radio tuning sound.

  6. Trav says:

    Does it have any torque at that speed? It looks like it skip steps by the thousands. He can’t even get to full speed on the second motor at no load.

    The whole purpose of steppers is accuracy in movement, I see no accuracy here at all except for possibly exact RPM’s. Is there a point I’m missing? I always thought stepper speed limitations was on the motor itself and not on the drivers.

    Also, I bet that thing gives tons of back current when it goes from full speed to stop.

    • Deano says:

      I don’t know about torque but it does look accurate. The first stepper seems to at least start and stop at the exact same location.

    • macona says:

      I doubt it. The torque fall off is great on steppers. If you want high speed accuracy, use a servo. If you want low speed accuracy, use a servo. Or do as I do and use servos whenever I can.

      25khz in 4 microsteps is only 1875 RPM. Not much. All of my servos will do that. I have some Mitsubishi servos that will do up to 4500 RPM and max resolution of 131,072 steps per rev, current model servos are 262,144 steps per rev.

  7. hojo says:

    now for the real test: Attach it to an encoder and see if it the number of steps moved is the same as the number generated.

  8. ino says:

    I do agree with the previous commenters. You can not state a result until you’ve got a feedback to prove it.
    BTW, the heatsink should be turned 90°, otherwise it’s not that efficient.

  9. j_at_chaperon says:

    I am no expert in steppers, but I find it sounds cool and powerful. I might use something like that for my video games !

  10. Stan says:

    I love the 298n. I use it for all my stepper projects. It saves board space, has thermal protection, current sense, shutdown mode, breaking and it’s rugged. It’s also impossible to have both transistors on at the same time – using internal logic. The staggered pins prevents easy insertion into a proto board though. It also lacks internal protection diodes that you need.

    • tim says:

      298 has a VCEsat total of nearly 5V, with 2A that will give you 10W of heat,

      A mosfet driver has a total RDSon below 1ohm, so less than 2W of heat with the same current.Of course,diodes are inside

      Foreget yesterday chips, would you put Windows 3.1on your new laptop ?
      Chips designers are doing a very good job these days, give them some reward.

  11. donov4n says:

    I like the Pacman-like sounds that it makes during the ramp-down ; THUMBS UP for using old school drivers like the L29x ;)

    Besides to that I don’t see any use in this thing, because at high rpms the steploss will be unpredictable with minimal load changes…

  12. Roger Wolff says:

    The trick to fast-stepper-driving is that you will need a current source. Don’t just put 3V over the coil, but put 30V over it and cut down on the voltage if the current comes above what is normal at 3V. (taking that small 3V stepper as an example).

  13. Cristi Neagu says:

    Why go to all that trouble to program a MCU, when you could use a L297 to generate the steps? In theory, you could use a 2MHz clock for stepping with it.

  14. Zee says:

    The big question: is this accurate or does it skip steps?

  15. Robert says:

    I think what should have been mentioned is that this DSP uses feedback (current) from the stepper in such a way that the driver is in sync with the motor and therefore cannot overstep or miss steps.

    You could (as someone mentioned) just work out the limits and program them into another driver but this design doesn’t need that as it ‘feels’ the limits of the motor in no-load or load conditions. Also other factors such as increasing friction on an aging machine don’t have to be compensated for. It will simply slow down itself.

    The other point that seems to be confusing people is that this is a linear driver and not a digital driver as such. It is using PWM. Yes MOSFET’s could be used but you need complementary pairs to drive bi-polar.

    The torque / speed curves are different between bi-polar and uni-polar.

    If it helps, here is a basic idea of how it works. At the start of a step the current drawn is highest. At the step position the current falls to zero and will then invert. By monitoring the current it can determined when the first moment is that you can make the next step.

    Also by varying the voltage so that there is very little drive as it comes to the step position you reduce the effect of inductance (back EMF) which allows you to step faster rather than waiting for the back EMF to subside.

    I am impressed with this and I am going to try to make it work with low cost 8 Bit PIC chips in assembly code.

  16. David Huang says:

    How can I get on of this? I am designing an engine, which need stepper motor just like this.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 91,201 other followers