Close

Help needed driving multiple stepper motors.

A project log for Refreshable Braille Display

A cost effective way to make a refreshable braille display

vijayVijay 06/26/2016 at 07:0216 Comments

We are trying to figure out the best way to drive as many stepper motors simultaneously ( for the actuation system mentioned in the last post ) .

-There are 40 stepper motors in total for a 20 cell braille display, two per each cell. They preferably need to be actuated simultaneously.

-The motors do not require too much current ( unknown amount since there is no datasheet, motors will arrive in a couple of days)

-The motors are 4 wire- Bipolar steppers, with 15 step a rotation.

-it takes roughly 25 rotations of the stepper motor to reach from one end of the linear selector system to another.

Some of the approaches friends have suggested:

-Using many stepper drivers like allegro or TI's solution each connected to a slave MCU like an attiny85, that takes serial input. ( i.e, each braille cell has stepper motor controller and a MCU)

-Using a I2C, SPI port expander connected to a main MCU

-Using an LED driver

Any suggestions for this problem?

Discussions

HTCPCP 418 wrote 06/27/2016 at 14:25 point

You should look into multi channel h-bridges like LV8044LP (QFN), or BU24035GW (BGA). The latter seems like a better fit to your project as you can drive it via SPI.

Both of them can - in theory - drive up to three stepper motors, but it's easiest to use them only for two.

Their advantages over A4988/DRV8825/...:

- they are actually meant to be used with the type of low current (should be around 100mA) motor you are using

- their motor voltage can be 5V instead of 12V => power supply should be easier

- on Digikey, they are about the same price as an A4988, but they allow you at least twice the amount stepper control

- in the case of BU24035GW: SPI control! (You could drive all motors with a single MCU)

Of course, the price of a fully populated and soldered A4988 from China might be lower, but if you ever want to mass produce this, QC get's a lot easier when the parts populated are always the ones you specified. Also, you can save a lot of board space by not using them. For a simple 4-5 axis 3d printer the additional space is not an issue. But in your case, the board would be at least 12*10cm just for the drivers without any connectors.

I think the best solution in your case is a bunch of BU24035GW - that'd set you back 57.58 on Digikey. That's actually less than the A4988 board on Aliexpress (quick search says 40 of them can be had for 67.20) which would be less suited for the task.

A disadvantage of the BU24035GW: it's .4mm BGA. You only have to escape 8 pads from the middle (there's only two rows in total), this might be a challenge when having the PCB produced by one of the usual suspects, though.

  Are you sure? yes | no

Vijay wrote 06/29/2016 at 09:51 point

I think you have solved the most important problem, the price isnt too bad and the drivers are just perfect ! . Ill post an block diagram soon about the different implementations mentioned in this discussion. 

Thanks so much for your help!

  Are you sure? yes | no

HTCPCP 418 wrote 06/29/2016 at 14:13 point

There's also another option you might want to look into: Take a few transistors (or mosfets) to build h-bridges. I.e. you can base your design on the first one on this site: http://www.talkingelectronics.com/projects/H-Bridge/H-Bridge-1.html (Make sure that the transistors you choose can handle at least 100mA continuous to be on the safe side)

Then, take a cheap CPLD with a lot of pins. Since the price usually grows with the amount of pins, it might be best to have more CPLDs with fewer pins. You'll need at least two pins per motor + 1-4 pins for communication per CPLD. In your use case, there's no need for microstepping, so you simply build a step sequence LUT, possibly add a bit of logic for a step generator and then copy that design for each of your motors. Next, add some kind of serial communication and you have an easily controllable array of motors. If you need multiple CPLDs, they can even run exactly the same code.

Depending on the price per transistor, this might be slightly more cost effective. I would estimate 5-10 cent per transistor + about 10 bucks for one big or a few smaller CPLDs, so in total about 20-30 bucks.

Edit:

If you take 100pcs BC846BPDW1T1G (due to the price break, 100 are cheaper than 80), that's about 10 bucks at Digikey or 7 bucks at Mouser. Then add one ICE40HX1K-TQ144 for about 6 bucks (or HX4K for 7) and a strip of let's say 200 220 ohm resistors for the h-bridges (about 1 buck). In total that's probably 20 bucks when you add some capacitors for the FPGA, etc.

Also, there won't be any layout issues and you might even be able to add some type of 8 bit softcore so there would be no need for an external micro.

In that case, you'd only need an additional PL2303HX (connect the ICE40 SPI to GPIOs on the PL2303) to get a very affordable and open system. The PL2303 is supported on Linux, Windows, OS X, and even WinCE and Android. At the same time you don't have FTDI bricking your product because you might have been sold a fake ;)

The ICE40 is supported by the icestorm project (http://www.clifford.at/icestorm/).

  Are you sure? yes | no

HTCPCP 418 wrote 06/30/2016 at 00:10 point

On another note: USB 1-2 usually only give you about 2.5W. Driving 40 of those steppers at the same time will most likely require about 20-40W (see my ULN explanation).

When following these suggestions, you should be able to stay well within the USB power budget:

1. Use full steps! Microsteps don't give you any advantage in your application.

2. Only drive your steppers when they should move. (Requires 1.) This way, resting steppers don't draw any power.

3. Implement some kind of sequencing that makes sure only a few (2-4) steppers move at the same time. It should be possible to do a full refresh in less than half a second.

  Are you sure? yes | no

johnowhitaker wrote 06/26/2016 at 13:43 point

Stepsticks are very cheap drivers, and require STEP and DIRECTION signals. They also have an enable pin. So, you could have a pin to enable each pair of steppers (through shift registers or something if you don't have much IO), and then one pin connected to all the STEPs and another for all the DIRs, i.e. a single global step pin and a single global direction pin. Then, to raise a subset of the cells, simply activate the relevant enable pins, set the direction and then pulse the step pin a few times depending on how much you want to move the motors. This way you drive 20 pairs of motors with 22 pins. It might even be possible to use one step-stick for two motors. You can set the max current with a variable resistor on the boards, which is nice for testing weaker motors and not heating things up too much.

  Are you sure? yes | no

johnowhitaker wrote 06/26/2016 at 13:45 point

  Are you sure? yes | no

Vijay wrote 06/29/2016 at 09:55 point

One idea is to control the step/dir using a shift register so that you use even lesser pins of a microcontroller, and drive everything simultaneously. One issue I see with having enabling one motor at a time would be that it takes a long time to actuate the entire display. 

If there was a way to use only one driver and enable which motor it drives, atleast this implementation saves cost of the drivers. 

 Thanks for the input, let me know what you think :)

  Are you sure? yes | no

deʃhipu wrote 06/26/2016 at 09:46 point

I think the simplest approach is to use a shift register such as 74HC595 to multiplex your io ports. The motors probably don't need a very high-frequency signal, so you should be able to provide signal for a lot of those motors with just a few pins.

  Are you sure? yes | no

Vijay wrote 06/26/2016 at 11:51 point

Thats an efficient idea for the control upstream.

Connecting the outputs of the shift register to the pins of the steppers via a darlington array like the ULN series.

Or a motor driver?

Since the motors are bipolar steppers, is it possible to work with ULN? it would save alot of cost of motor driver IC's if it is.


  Are you sure? yes | no

deʃhipu wrote 06/26/2016 at 11:54 point

Any H-Bridge chip should work. There are chips with dual H-bridges that are good for this, since you get a chip per motor then.

  Are you sure? yes | no

HTCPCP 418 wrote 06/27/2016 at 15:18 point

ULN drivers do work but they are very inefficient (at least when used to drive bipolar steppers).

Assuming you need about 100mA for the steppers (per coil), that same 100mA will be flowing through your resistors. The steppers usually run at 5V, but since don't have a center tap on your coils, you'll need more. Let's say you match the pull-up resistors to the resistance of your coils. You'd need 10V for 5V through the coils.

So we get 2(coils)*100mA*5V or 1W per motor. For 40 motors that's 40W! Even if you get them to run at 50mA, you'd still be wasting 20W.

On another note: You'll have the same problem with any LED driver.

  Are you sure? yes | no

Bharbour wrote 06/27/2016 at 22:21 point

You could use a ULN type driver, but then you need to do the step sequencing in firmware. Probably the biggest benefit of using a dedicated stepper driver chip is that it will give you direct control over the motor current instead of having to dissipate significant amounts of power in current limiting resistors. With as many motors as you are using, power and dissipation will become significant, especially if you wanted to run off batteries.

  Are you sure? yes | no

davedarko wrote 06/26/2016 at 13:38 point

there are also darlington shift registers so you dont have to use uln2003+595s.

  Are you sure? yes | no

Vijay wrote 06/26/2016 at 17:45 point

Awesome, I didnt know that, I will come in use somewhere. 

http://elabz.com/driving-a-bipolar-stepper-motor-with-arduino-and-uln2803ag/

Looks like this approach has some side-effects for driving steppers, a motor driver is probably a better solution. 



  Are you sure? yes | no

BotLawson wrote 06/27/2016 at 21:09 point

I can't find the old BEAM robotics article, but I remember them finding that 74AC logic should be able to do 30-60mA per IO pin at a 1-2 volt drop.  I've personally used 74 cmos logic to drive many 50ohm transmission lines to 5 volts.  My usual driver is 1/2 of a 74AC245 buss driver chip, or a 74AC04 with one gate as buffer to drive the other 5 in parallel.  I've drawn 100-200mA per chip (well beyond spec) and the 74AC logic usually survives brief shorted outputs.  (74LVC is faster with lower output resistance, but fries if Vcc = 5v and you short a pin)  TLDR, use 74AC and parallel 2-3 output pins for each stepper wire.

Alternatively, an external P-fet and N-fet can be wired as a CMOS inverter to boost an output pin up to ~1A continuous current.  It is best if you pick the FETs to minimize shoot-through current.  I.e low gate capacitance and gate thresholds picked for "low" current when half-on.   (the NXP PMGD290UCEAX for instance looks like a good place to start)

  Are you sure? yes | no

K.C. Lee wrote 06/27/2016 at 22:42 point

I recommend reading the Absolute Maximum Rating in the datasheet *carefully* before doing this.  This is the highest current *before* damages and is not what the part is designed to be doing regularly. 

74ACT573 datsheet Absolute Maximum Rating say this:

>DC Output Source or Sink Current (IO) ±50 mA

There ia also a 50mA *total* limit per Vcc or Gnd pin.

Note 1: Absolute maximum ratings are those values beyond which damage
to the device may occur. 

That's something that fine for a hack, but *not* for a product or when someone else depend on it.

If you have to abuse parts, at least use 74FCT parts. They are rated for 64mA per I/O sink and 32mA sourcing.  Sourcing is only at 3.3V level even though they are 5V parts.

  Are you sure? yes | no