Sei sulla pagina 1di 4

M LNM O LNO

^ J j == h

Main Site Blog Playground Forum Labs Store Help | Sign in or Register

search

Buy

Download

Getting Started

Learning

Reference

Hardware

FAQ

Learning Examples | Foundations | Hacking | Links Examples > Stepper Library Step p er M otor Knob Stepper motors, due to their unique design, can be controlled to a high degree of accuracy without any feedback mechanisms. The shaft of a stepper, mounted with a series of magnets, is controlled by a series of electromagnetic coils that are charged positively and negatively in a specific sequence, precisely moving it forward or backward in small "steps". There are two types of steppers, Unipolars and Bipolars, and it is very important to know which type you are working with. For more information about the differences of the two types, and about the circuits that must be built to control a stepper, please take a look at T om Igoe's page on stepper motors. In this example, the turns of a potentiometer (or other sensor) on analog input 0 are used to control the movement of a stepper motor while using the Arduino Stepper Library. The unipolar or bipolar stepper is controlled by using digital pins 8, 9, 10, and 11 in conjunction with either a U2004 Darlington Array (for unipolar steppers) or a SN754410NE HBridge (for bipolars). Hardware Required Arduino Board potentiometer stepper motor U2004 Darlington Array (if using a unipolar stepper) SN754410ne H-Bridge (if using a bipolar stepper) power supply appropriate for your particular stepper breadboard hookup wire C ircuits Below you'll find circuits for both unipolar and bipolar steppers. In either case, it is best to power your stepper motors from an external supply, as they draw too much to be powered directly from your Arduino board. In both circuits, connect a 10k pot to power and ground, with it's wiper outputting to analog pin 0. Note: Both circuits below are four wire configurations. Two wire configurations will not work with the code provided.

~ LLq ~ K Lj h

NLQ

M LNM O LNO

^ J j == h

Unipolar Stepper Circuit

im age dev eloped using Fritzing. For m ore circuit exam ples, see the Fritzing project page

Unipolar Circuit Schematic

Bipolar Stepper Circuit

im age dev eloped using Fritzing. For m ore circuit exam ples, see the Fritzing project page

Bipolar Stepper Schematic

~ LLq ~ K Lj h

O LQ

C ode (o bt crut) fr oh icis


/ * *Mtrnb ooKo * *Aseprmtrflostetrso aptnimtr tpe oo olw h un f oetoee *(rohrsno)o aao ipt0 o te esr n nlg nu . * *ht:/w.run.ce/eeec/tpe tp/wwadioc/nRfrneSepr *Ti eapecd i i tepbi dmi. hs xml oe s n h ulc oan * / #nld <tpe.> icue Seprh / cag ti t tenme o seso yu mtr / hne hs o h ubr f tp n or oo #eieSES10 dfn TP 0 / cet a isac o teseprcas seiyn / rae n ntne f h tpe ls, pcfig / tenme o seso temtradtepn i' / h ubr f tp f h oo n h is ts / atce t / tahd o SeprseprSES 8 9 1,1) tpe tpe(TP, , , 0 1; / tepeiu raigfo teaao ipt / h rvos edn rm h nlg nu itpeiu =0 n rvos ; vi stp) od eu( { / sttesedo temtrt 3 RM / e h pe f h oo o 0 Ps seprstpe(0; tpe.eSed3) } vi lo( od op) { / gttesno vle / e h esr au itvl=aaoRa() n a nlged0; / mv anme o seseult tecag i te / oe ubr f tp qa o h hne n h / sno raig / esr edn seprse(a -peiu) tpe.tpvl rvos; / rmme tepeiu vleo tesno / eebr h rvos au f h esr peiu =vl rvos a; [e Cd] Gt oe

See also
SeprmSepr=Seprses pn,pn,pn,pn) tpe ytpe tpe(tp, i1 i2 i3 i4 seprstpe( tpe.eSed) seprse( tpe.tp)

Stepper library reference Sweep - sweep the shaft of a servo motor back and forth. Knob - control the position of a servo with a potentiometer.

M LNM O LNO

^ J j == h

Share |

Arduino | Edit Page | Page History | Printable View | All Recent Site Changes

~ LLq ~ K Lj h

Q LQ

Potrebbero piacerti anche