Instruction manuals

45-better-stepper-driver

Description
better stepper driver
Published
of 11
All materials on our website are shared by users. If you have any questions about copyright issues, please report us to resolve them. We are always happy to assist you.
Related Documents
Share
Transcript
  http://www.instructables.com/id/45-better-stepper-driver/  Food   Living   Outside   Play   Technology   Workshop $4.5 better stepper driver by jduffy54  on November 18, 2013 Table of Contents $4.5 better stepper driver ........................................................................................................1 Intro: $4.5 better stepper driver ................................................................................................2 Step 1: What you need: ......................................................................................................2 Step 2: An L2619, what is that? ................................................................................................3 Step 3: Pre-software ........................................................................................................3 Step 4: Software. That thing that makes stuff do stuff. ...............................................................................4 Step 5: Final wiring. Finally. ...................................................................................................6 Related Instructables ........................................................................................................7 Advertisements ...............................................................................................................7 Comments ................................................................................................................7  http://www.instructables.com/id/45-better-stepper-driver/  Author: jduffy54 Yes, more projects are coming, always. I work on anything in my spare time, usually electronics, but sometimes hardware, and increasingly software. Intro: $4.5 better stepper driver In the last few years, 3D printers, personal CNC machines, and plotters have gained enormous popularity in the DIY community. The powerhouse begind these is thestepper motor, which is capable of precise movement, and can be salvaged easily for next to nothing. Driving these motors, however, is more complicated than almostany other motor, and though many options exist, a few stepper drivers can cost upwards of $40. Enough to run a 3D printer can be the more expensive athan any otherpart.After I made a very cheap driver using the L293 and attiny 85 (http://www.instructables.com/id/5-stepper-driver/  ), I thought I had a good solution, but I quickly becamedissatisfied with the speed, tendancy to lose steps, and lack of current regulation. This stepper driver seeks to fix these issues, and for even less than the srcinal project. Image Notes 1. input and logic power terminals2. speaker housing used for the completed driver3. main power input4. stepper outputs in the back Step 1: What you need: Most of the parts can be bought from Jameco.com, or most electronics suppliers. The L6219 cannot, but more on that later.1xAttiny 2313 (or any arduino-compatable with at least 16 IO pins and 2 interrupts. An uno or leonardo will work, but an attiny is just $3 from Jameco.com, roughly onetenth the cost of a normal arduino. The 8 pin attinies (attinys?), such as the 85 will not work)2xL62198x820pf capacitor4x1k resistor4x1ohm resistor4x30K-60K resistor4x100nf capacitors2x100+uf capacitors(I didn't use the last two as my power supply already has some big caps on it. A good electronicist would put at least the 100nf caps on, but I just forgot to)  http://www.instructables.com/id/45-better-stepper-driver/  Image Notes 1. The L2619.2. 1k resistors.3. 29K resistors. Anything about 30K-60K should work, but 56K is recommended. If this gets too high, it will lower the pwm frequency, possibly to within humanhearing.4. 820pf caps. Anything from 1000pf to 600pf should work. Large capacitors and resistors will result in a lower clock fequency, which may become audible at highervalues.5. 1 ohm resistors. The value of these determines current, so do not use other values. The wattage is small, so 1/4W resistors are fine. Step 2: An L2619, what is that? The L2619 is a rather unusual part, and is seldom used by hobbyists, despite several advantages it has over more common motor drivers. It does require a smallammount of circuitry (though just 10 common components), but when operating correctly, it can regulate current, requires little or no heatsink, takes phase/current input,and doesn't make a high-pitched whine whenever the steppers are running.Hook up all the parts as shown on page 6 of the datasheet here: http://pdf.datasheetcatalog.com/datasheet/SGSThomsonMicroelectronics/mXsqwuv.pdfTest it first with some LEDs with 1k resistors, at 9V on Vs (Vss MUST remain at 5V), and note that the I0 and I1 pins set current, phase sets polarity, and that itrecoginizes low signal (ground) as active. Once you have established that it operates correctly, hook it up to a DC motor on each output, and connect the I0 and I1 pinsseparately. The motor should speed up when you connect both and slow down (but not stop) when one pin is connected. If it all checks out, then solder it, check it again,and make another one.When you have finially made it past the trials of the electronics gods and have two functional motor drivers, we move to the fun part. Software. Image Notes 1. Not actually a freakishly large knob. It's just a freakishly large knob. Step 3: Pre-software I lied. No software yet. Soon. First, you need to set up that blue thingy with a magic thingy on it to get the magic stuff to the magic black caterpillar thingy. Or you couldsetup your arduino to send code to the attiny. Either way.This has been written about something around ten billion times since the cores were released a few years ago, so just follow the directions here:http://www.instructables.com/id/Arduino-ATtiny2313-Programming-Shield/#intro You can just use a breadboard, as you only need to send the code once, thoughattiny2313s are great, so I would make a more permanent programmer for other projects. Make sure you are using an arduino software of 1.0.3 or earlier, as 1.5+ doesnot work.Once you have an LED blinking on your attiny, or some other bit of test code, it's time to move to the fun part. Image Notes 1. I don't actually have anything important to put here, so here's some pictures of some other random sketches.  http://www.instructables.com/id/45-better-stepper-driver/  Step 4: Software. That thing that makes stuff do stuff. Now, just copy and paste the software below to the IDE and click on...tools?Yes, tools. Then go to board and select attiny2313 @ 8Mhz . Yes, I know the other instrucable said to set it to 1MHz earlier. This uses 8MHz becuase it makes it run 8times faster, with absolutely no modification, software or otherwise. Making sure than your normal arduino is configured to send programs to the attiny (it may wreck thearduino if it is not), click tools>Burn Bootloader . Some lights should blink, and then it should say done burning bootloader . If it did not return an error, then just uploadthe code normally. When the blinky lights stop, disconnect the arduino, pull out the attiny, and break out your breadboard once more. //attiny 2313 stepper driver by Jduffy. Full instructions on instrucatables.const byte I011=1;//the pins for each function.const byte I111=2;//names ending in 1 are for stepper 1const byte dr11=3;const byte I021=8;const byte I121=9;const byte dr21=10;const byte I012=11;//same for stepper 2const byte I112=12;const byte dr12=13;const byte I022=14;const byte I122=15;const byte dr22=16;//for all of the following, 0 represents on on pin // as the 2619 registers low as active. //lists like this are used because they take very little of the //chips memory, which for the attiny2313, is in short supply (just 2k!) //It also greatly simplifies the code below.boolean stp10[]={1,0,1,0,1,0,1,0,1,0,1,0};//output to LSB current limiting 1boolean stp11[]={1,1,0,0,0,1,1,1,0,0,0,1};//output to MSB current limiting 1boolean stpd1[]={1,1,1,1,1,1,0,0,0,0,0,0};//output to direction 1boolean stp20[]={0,1,0,1,0,1,0,1,0,1,0,1};//output to LSB current limiting 2boolean stp21[]={0,0,1,1,1,0,0,0,1,1,1,0};//output to MSB current limiting 2boolean stpd2[]={0,0,0,1,1,1,1,1,1,0,0,0};//output to direction 2byte stepp1;//step part for stepper 1long pos1;// actual position of stepper 1long dpos1;//desired position of stepper 1byte in1=6;//direction input pin for stepper 1byte stepp2;//same stuff for stepper 2long pos2;long dpos2;byte in2=7;void setup(){DDRB = B11111111;//This is very important, as this is theDDRD = B1000011;//same as pinMode();, but takes very little space. //If you use anything other than an attiny 2313, then you must change all of these to //the standard pinMode(); command.DDRA = B011;//if you use pins 6 or 7 as outputs, you MUST change these lines //  //If you don't know what these lines mean, there is an //explanation at http://arduino.cc/en/Reference/PortManipulationattachInterrupt(0,step1,RISING);//ALWAYS on digital 4 or 5 (0=4, 1=5), the interrupts cannot beattachInterrupt(1,step2,RISING);//on ANY other pins, unless you use pcinterrupts, which offers little}//to no advantage. The 0 and 1 are same for all avr boards, though the pin number itself will be differentvoid loop(){if (pos1!=dpos1){//if the stepper isn't where it should be...if (pos1<dpos1){//and it needs to go foward...stepfwd1();//go foward!}else{//otherwisestepbck1();//go backward!}}if (pos2!=dpos2){//do the same thing for stepper 2if (pos2<dpos2){stepfwd2();}else{stepbck2();}}delayMicroseconds(3); //wait a little bit}void step1(){//if the step pin for stepper 1 was brought highif(digitalRead(in1)==LOW){//and the direction pin is lowdpos1++;//tell the loop to step foward 1}else{//otherwiredpos1--;//step back 1}}void step2(){//same for stepper 2if(digitalRead(in2)==LOW){dpos2++;}else{dpos2--;}

readme.pdf

Jul 22, 2017
We Need Your Support
Thank you for visiting our website and your interest in our free products and services. We are nonprofit website to share and download documents. To the running of this website, we need your help to support us.

Thanks to everyone for your continued support.

No, Thanks
SAVE OUR EARTH

We need your sign to support Project to invent "SMART AND CONTROLLABLE REFLECTIVE BALLOONS" to cover the Sun and Save Our Earth.

More details...

Sign Now!

We are very appreciated for your Prompt Action!

x