Current limiting stepper motor driver using PICAXE DAC

Circuit

Senior Member
I am building a stepper motor driver that will be pulsed and direction-controlled by a PICAXE - probably a 40X2 given the other aspects of the system. The driver is quite straightforward and is based upon an L297 stepper driver and an L298 H-Bridge and works just fine.

The L297/L298 combination permits current-limiting regulation by applying a voltage (1-3 volts) to leg 15 (VRef) of the L297 driver http://www.st.com/st-web-ui/static/active/en/resource/technical/document/datasheet/CD00000063.pdf . This is mostly done by using a straightforward potentiometer and voltage divider from +5V.

My application requires the stepper motor to operate with varying levels of torque; sometimes it will be loaded and require max amps through the windings, but when it is stationary it will not have much of load to resist and therefore could operate with the current quite markedly limited. Therefore I am thinking of using the PICAXE DAC to drive the 1-3 volts needed at VRef of the L297. My question is whether or not this needs an intervening Op. Amp. or whether the DAC output could drive this directly. Obviously I realise that I should look up the parameters for the current requirements of the VRef pin, input impedance etc., but all that I can find is a note that the "comparator bias current (pin 15) = 10uA" . Clearly I could just wire it up and try it, but even if it works I guess that it might be overloading the DAC output and cause damage at some point later.

This seems a perfect application for the PICAXE DAC. Expert technical opinion would be much appreciated.
 

rq3

Senior Member
At 10uA, you should be more than fine. It will be a fascinating experiment, as these drivers generally PWM the motor current based on the Vref level.
As long as your DAC output doesn't go outside the Vref limits, your Picaxe and L297 should both be fine, especially since you'll be current limiting the
DAC pin with your low-pass filter anyway.
 

AllyCat

Senior Member
Hi,

The DAC is basically just a string of 32 x 5 kohm resistors (= 160 kohms) between earth and the supply rail (or FVR or external Reference if selected) with a multiplexer (switch) selecting the tapping point. So you're unlikely to damage it unless the load tries to drag the pin outside the PICaxe's supply rails.

Thus the output impedance is around 40 kohms at the centre and 30k at 25% and 75% levels, so even a load of >> 100k will "offset" the level from the open-circuit value. But you can use READDAC to measure what voltage is actually on the output pin. A 10 uA load current might offset it by up to 400 mV.

The other limitation is that there are only 32 (or 33) available output levels (5 bits) between 0v and the (top) Reference level. If you plan to use a low-pass filter anyway, then filtering a PWM output may be a better choice (1024 potential levels and relatively low output impedance).

Cheers, Alan.
 

rq3

Senior Member
@AllyCat
Alan, thanks for catching that! In my reply I was thinking of a filtered PWM output, rather than the actual DAC. Mea culpa.
While I still think it would work (looks like the L297 Vref input impedance is >300Kohms), a filtered PWM would potentially
give much "finer" Vref control, rather than just the 32 steps of the DAC.
It's been years since I've played with a L297, but the TI stepper chips work in a similar fashion (but have built in power devices),
and my experience with them is that they are VERY sensitive to the Vref input.

The OP may actually be able to directly apply the PWM to the Vref directly. The L297 will likely go nuts trying to track, but ultimately
it's going to PWM the motor coils to regulate current, so he would be PWMing a PWM output. Depending on the Picaxe PWM frequency,
it might actually work, and would be fun to try. If I had an L297 on hand I'd be willing to fry it in the interest of experimentation.

Rip
 

Circuit

Senior Member
Alan, Rip, many thanks - got me thinking...
Alan, your advice regarding measuring the true voltage when connected up is most useful. As far as the number of steps is concerned, I really only need to establish two points; one for running and one for passive hold-fast so the 32 steps are more than ample.
Rip, I note particularly your observation about the sensitivity of the Vref input - I will watch out for that, especially in view of Alan's advice with regard to the expected voltage drop.

Looking around, I see one or two alternative chips which appear to use more modern MOSFETs to form a bridge and controller on one chip; the ST L6228 for example. When I started to search around for others (Rip mentioned TI chips) I came across the issue of packaging; I am looking for through-hole mounts only and I lost the will to live as I searched around for such mounts. Does anyone have any recommendations for a more modern integrated stepper driver chip (non surface-mount) rather than the now somewhat antiquated but still popular L297/298 combination that I am working with?
 

Pongo

Senior Member
I've been very happy with the pre-built DRV8825 module that I bought (very inexpensive on ebay now) and with pin headers installed it mounts as a thru hole component. Although not standard you could remove the current limiting pot and drive the ref pin externally.
 

Puuhaaja

Senior Member
I think Pongo's idea sounds good. I have played with A4988 stepsticks when I adjusted my own made 3d printers current parameters. There are some websites which help how to adjust. Anyways..Those 3d printers stepper drivers are really cheap and some of them may be fake ones??? I don't know if this is a fake but this could be worth testing. http://www.ebay.com/itm/Geeetech-1pcs-DRV8825-StepStick-Stepper-Motor-Driver-Carrier-Reprap-4layer-PCB-/221671470105?pt=LH_DefaultDomain_0&hash=item339ca63419
 

marzan

Senior Member
I think Pongo's idea sounds good. I have played with A4988 stepsticks when I adjusted my own made 3d printers current parameters. There are some websites which help how to adjust. Anyways..Those 3d printers stepper drivers are really cheap and some of them may be fake ones??? I don't know if this is a fake but this could be worth testing. http://www.ebay.com/itm/Geeetech-1pcs-DRV8825-StepStick-Stepper-Motor-Driver-Carrier-Reprap-4layer-PCB-/221671470105?pt=LH_DefaultDomain_0&hash=item339ca63419
It all depends on what you want size motors you are trying to drive. If they are Nema 17 then even the cheap chinese ones are ok. I havent blown one yet, but I dont take them to their limits. I have used at least 20 of them in projects for others. It is so much easier if all you need to do is provide step and direction with your picaxe. those drivers are cheaper than anything you can make yourself. If I use Nema 23 or above I use Gecko drives. They microstep when slow, but then go to full step when hi revs. you pay for them but they aere really hard to kill.

Marz.
 
Last edited:

Pongo

Senior Member
It all depends on what you want size motors you are trying to drive. If they are Nema 17 then even the cheap chinese ones are ok. I havent blown one yet, but I dont take them to their limits. I have used at least 20 of them in projects for others. It is so much easier if all you need to do is provide step and direction with your picaxe. those drivers are cheaper than anything you can make yourself. If I use Nema 23 or above I use Gecko drives. They microstep when slow, but then go to full step when hi revs. you pay for them but they aere really hard to kill.

Marz.
Right! I feel bad about hitting that tiny little 8825 chip so hard but it seems to be pretty well protected and just keeps on trucking :)
 

rq3

Senior Member
Right! I feel bad about hitting that tiny little 8825 chip so hard but it seems to be pretty well protected and just keeps on trucking :)
I have a DRV8825 on a small (2"x3") 4 layer board driving a NEMA 17 motor at 2 amps. The board is sealed into a plastic housing, with no ventilation at all. I've never seen the 8825 issue an over-temp warning, even though its only heat sink is the ground plane of the board.

Rip
 

marzan

Senior Member
I have a DRV8825 on a small (2"x3") 4 layer board driving a NEMA 17 motor at 2 amps. The board is sealed into a plastic housing, with no ventilation at all. I've never seen the 8825 issue an over-temp warning, even though its only heat sink is the ground plane of the board.

Rip
I imagine that you do have a heat sink on the chip? Some sellers don`t supply one.
 

rq3

Senior Member
I imagine that you do have a heat sink on the chip? Some sellers don`t supply one.
No, as I said, the only heat sink is the ground plane of the board itself, to which the center slug of the 8825 is soldered. The board is my own design, based on TI design parameters.

Rip
 

Pongo

Senior Member
I imagine that you do have a heat sink on the chip? Some sellers don`t supply one.
I'm not convinced that those small, top of the package, heatsinks actually add very much. The package is designed to conduct heat out via the metal pad on the bottom, sticking a tiny heatsink on the top that's separated from the chip by a layer of plastic can only add a trivial amount of cooling. The chip's thermal shutdown is set at 150°C/300°F.
 

rq3

Senior Member
I'm not convinced that those small, top of the package, heatsinks actually add very much. The package is designed to conduct heat out via the metal pad on the bottom, sticking a tiny heatsink on the top that's separated from the chip by a layer of plastic can only add a trivial amount of cooling. The chip's thermal shutdown is set at 150°C/300°F.
TI has an excellent ap note regarding thermal sinking of their stepper drivers. It includes top mounted, finned, heatsinks. The conclusion is that they are worthless.

Rip
 

premelec

Senior Member
@rq3 - I looked on the TI site and couldn't find the app note - could you give an an#? I would suppose adding a heat sink to the bottom of the board could help and perhaps they covered that... thanks...
 

premelec

Senior Member
Thanks rq3 - looks interesting! I've seen some circuit boards with seemingly incredible power handling capabilty...
 

rq3

Senior Member
Thanks rq3 - looks interesting! I've seen some circuit boards with seemingly incredible power handling capabilty...
In the case of the DRV8825, almost all of the heat is the MOSFETS in the H-bridge. With the very low MOSFET on resistance, the chip barely gets warm even
when pushed to it's 2.5 Amp limit when properly soldered to a small ground plane heat sink. My board runs a NEMA 17 motor at 2 Amps with a 14 volt supply.
After several days of continuous operation, the chip can be touched comfortably. The motor actually gets hotter, but most steppers are designed to run at pretty
high temps.
 

Pongo

Senior Member
I would suppose adding a heat sink to the bottom of the board could help
That's was my backup plan. I was thinking of thermal epoxying a short length of square section solid copper to the pad on the bottom of the board and connecting it to the metal box - but it wasn't necessary.
 
Top