Welcome! Log In Create A New Profile

Advanced

Easy and simple DIY L297/298 based stepper driver

Posted by nschaefe 
Easy and simple DIY L297/298 based stepper driver
May 16, 2013 11:28AM
Hello everyone. So I am new to the rep-rap and 3D printing in general, but have wanted one for a few years now. I have slowly been collecting parts to piece together my own 3D printer. Being limited to a college budget, I have been looking for the cheapest solutions when possible, and came up with this simple way to make my stepper drivers. Not sure if this has been done before, but I didn't see anything after a quick search so I thought I would post my method.

The circuit is a combination of the ST L297/298. While I'm sure the 297/8 is nothing new, I didn't feel like laying out my own PCB, and came up this simple way to piece together a driver from existing components. There are numerous L298 boards on ebay complete with heatsink, diodes, capacitors, and 5v regulators that look like this:


The downside to these boards is that they do not include a sense resistor for current control via a L297. However, this is fixed by simply cutting the correct traces and soldering in your own sense resistor.


Then simply solder the L297 to another board, make the appropriate connections to the L298, add a resistor and capacitor to set the chopping frequency, two resistors as a voltage divider for the current sensing reference voltage, and wala! A quick and easy motor driver.




I was able to buy 5 pcs of the L298 board off ebay for ~$20, and 5pcs of the L297 for $1.29, for a grand total of $4.26 per driver (minus component/circuit board costs). Not too shabby!

I have tested the circuit at 12v, but plan to run it at 24v. The L297 can easily be set for full or half steps, but I believe it does not support microstepping. Regardless, this was a cheap and easy approach to a DIY stepper driver. Any comments/suggestions welcome

Edited 1 time(s). Last edit at 05/16/2013 11:29AM by nschaefe.
Re: Easy and simple DIY L297/298 based stepper driver
May 20, 2013 09:54AM
hi, nice driver, i was exactly looking fo something like this... cause i find the stepstick drivers too expensive when you know they can hardly drive 2amp.
it seems that the l297/l298 was used for 1.0 1.1 and 1.2 stepper drivers here.
But i never understood what was the use of the l297 in this combo? if you could explain this to me it would be awesome!
Re: Easy and simple DIY L297/298 based stepper driver
May 21, 2013 06:36PM
Sure, its pretty straight forward. However, the L298 is also limited to 2 amps. If you want to drive a larger stepper motor, you will need a H Bridge with a higher current rating, or according to the datasheet you can put multiple L298's in parrallel for higher output current (i.e. you can get up to 3 amps driving each coil with its own 298).

Here is a diagram of the connections between the L297/298 for reference:


The L297 performs two actions. First it translates step and direction input into the correct sequence to drive the H Bride (L298). If you look at this timing diagram:



The clock signal represents a "step" command from your microcontroller, and the ABCD lines represent the translated output from the L297 to the L298. Its possible to use a microcontroller to control the ABCD lines directly, but it just complicates things.

Second, and more importantly, the L297 controls the current flowing through the motor coils. Essentially, the coils have a very low resistance, so you would have to use a very low voltage power supply if you were to drive them directly. For example, I have some stepper motors rated at 2.3 volts and .7 amps, which means the coil resistance is likely 3.29 ohms(3.2/.7). If I were to drive them with 12 volts directly, the current would be 3.65 Amps (12/3.29), way too high and the motor would almost certainly overheat and die.

So why not just use a low voltage power supply? The motor coils also have significant inductance, which simply put means that when a voltage is applied, the current will lag the voltage/ it will take time for the current to reach its maximum value. This is an issue, as the current, not voltage, is responsible for creating the magnetic field that drives the motor. The solution to this is to use a high voltage supply, so that the the current increases more quickly. Then, by sensing the current going through the motor, the motor current is shut off, or "chopped", when the current reaches a set value.

The job of the sense resistors in the schematic are to monitor the current flowing through the motor, and then the L297 performs the chopping action, essentially limiting the current going through the coils.

This is a simplified explanation, and I'm a mechanical engineer not an electrical, but hope it clears things up a bit. The connections from the 297 to the 298 are relatively easy, if you have any questions about how you would connect everything I'll try to answer them
Re: Easy and simple DIY L297/298 based stepper driver
May 21, 2013 11:09PM
If you want microstepping, more sophisticated decay control, but with big motor - there are chips like LS8292 that offers such advanced feature, yet designed to be used with external MOSFET or L298.
Re: Easy and simple DIY L297/298 based stepper driver
May 22, 2013 01:37PM
I knew there must have been an alternative translator that could handle micro stepping, ill have to give that a one a try when I decide to upgrade. Thanks for posting
hello.

can you give me the another pict view about that, im intresting this method for build my DIY cnc router , smileys with beer
and what part list should i buy?
Re: Easy and simple DIY L297/298 based stepper driver
February 05, 2014 11:41PM
hey nschaefe!!!

nice work man,

i want to ask one thing.
>what rating of power supply should i use with these drivers?

>kindly also visit the following link.
[reprap.org]

is reprap stepper motor driver 1.2 are perfect to use?
Sorry, only registered users may post in this forum.

Click here to login