cheap simple tiny48 stepper motor driver

May 13, 2009 at 7:59 pm (Uncategorized)

The idea of this project is to create cheap and simple bipolar stepper motor driver with current chopper. The design is nothing new and is used in most of today’s drivers (very similar to internals of popular l297/l298 pair), the difference, however, is in the price.
This board is my first SMD project (first SMD design and my first SMD soldering). I managed to solder all of the parts without the need of any expensive equipment(old soldering iron with blunt tip  and chinese tweezers). So if you have never soldered SMD, this is a good project to start (just make sure you get a good tweezers and thin enough solder).

board_tiny48_stepper L297 is replaced by using dirt cheap microcontroller (ATTINY48 – cca 1,6€) , two lm358 dual op-amps (cca 0.15€ each) and couple of discrete components -> much cheaper than overpriced l297 (8€).
The power part consists of logic level mosfets and power diodes to protect them from power spikes. Mosfets can be replaced with any other logic level mosfet, as long as they can handle enough current. I chose NTD3055L104G (12A, 60V) mostly due to its price (0,44€).
The driver can produce full (with two energized coils at the same time) or half steps and is capable of following frequencies up to around 30 kHz. Power part should be able to handle up to around 3A without additional cooling and up to 10A (MOSFETs are rated 12A so high currents should be used with caution) with heat sinks placed across MOSFETs and power diodes.
Current limiting is done via current chopper, consisting of sensing resistor and two op-amps. In first stage of op-amp sensed voltage is amplified app 10x times. Second stage is used as a voltage comparator. The desired current is set via potentiometer acting as a voltage divider. If recommended 0.1 ohm resistor is used than 1V on the pot should correspond to app 1A on coil. Logical AND gate is not used, as it is realized in microcontroller’s firmware.
Current sensing resistors should be 0.1 ohm with power rating at least 2,5W (5W recommended), however different value can be used.schematic_tiny48_stepperPCB is designed for toner transfer (or other homemade techniques) and is single sided with minimum trace width 0.16mil. All the bridges are done via 0ohm 1206 resistors. Most of the components are SMD (resistor 603, capacitors 1206 (603 fit as well), with exception of microcontroller (so it can be programmed of board) and power resistors.

Source code is completly written in C and compiled using WinAVR (gcc).

Note that is project was made mostly for my education and as a fundation for next stepper controller (rev2) wich will include microstepping and fixed frequency current chopper.

Download project files:

DOWNLOAD

Permalink Leave a Comment

MakeController Tweeter library

May 5, 2009 at 10:30 pm (Uncategorized)

Here it is, a Tweeter library for MakeControler.

Why? Well, it seemed like a good idea couse it has built in network support, so there wasn’t to much work.

The library might be (is?) a bit buggy and should be used with caution. Feel free to modify code (and do not forget to send me a copy 🙂 ).

Functions are well explained in the header file, still here is a quick copy (to make post look longer 😉 ):


int Twitter_PostUpdate(char* tweet, char* user);
/*
** Used to post update to Tweeter. This is NOT THREAD SAFE. Function will pause execution of current program/thread until it is able to post.
** Parameters:
** – tweet: text to post, make sure it does not exceed 140 chars.
** – user: base64 encoded username:password (search online for info on how to encode your user/pass)
** Returns:
** – ERROR_SOCKET if socket can not be opend
** – ERROR_POST if it was not possible to send all data
** – 0 if everything went ok 🙂
*/

int Twitter_GetUpdate(char* username, char* output);
/*
** Used to get LAST update from desired user
** Parameters:
** – username: name of the user (eg. jelengar)
** – output: pointer to char array into wich output gets posted (make sure it is large enough -> 140)
** Returns:
** – ERROR_SOCKET if socket can not be opend
** – 0 if everything went ok 🙂
*/

Download

If you decide to use this library in your own project please let me know about it.

Tweet away 🙂

PS: feel free to folow me on http://twitter.com/jelengar

Permalink 6 Comments