Cov txheej txheem:

Tsav lub Stepper Motor Nrog AVR Microprocessor: 8 Kauj Ruam
Tsav lub Stepper Motor Nrog AVR Microprocessor: 8 Kauj Ruam

Video: Tsav lub Stepper Motor Nrog AVR Microprocessor: 8 Kauj Ruam

Video: Tsav lub Stepper Motor Nrog AVR Microprocessor: 8 Kauj Ruam
Video: Nrog na ej nkauj qhua mu yuav tsheb ViGo nawb 6-2-2020 2024, Hlis ntuj nqeg
Anonim
Tsav lub Stepper Motor Nrog AVR Microprocessor
Tsav lub Stepper Motor Nrog AVR Microprocessor

Tau txais qee qhov scavenged stepper motors los ntawm tshuab luam ntawv/disk tsav/lwm yam dag ib puag ncig?

Qee qhov kev soj ntsuam nrog ohmeter, ua raws los ntawm qee tus lej tsav yooj yim ntawm koj lub microprocessor thiab koj yuav tau nqis tes ua.

Kauj Ruam 1: Paub Paub Steppers

Paub Paub Steppers
Paub Paub Steppers
Paub Paub Steppers
Paub Paub Steppers

Yeej, koj yuav tsum tau txheeb xyuas qhov twg tag nrho cov xov hlau me mus.

Thawj kauj ruam yog txhawm rau txheeb xyuas yog tias nws yog lub cev tsis muaj zog lossis bipolar. Saib Jones ntawm Steppers rau qee qhov keeb kwm yav dhau los, tom qab ntawd ntawm Ian Harries 'Site rau txoj hauv kev yooj yim los txheeb xyuas lub cav tsis paub. Nyeem me ntsis, tom qab ntawv koom nrog kuv taug kev ntawm lub cav no kuv tau txais pheej yig. (Lawv tau muag rau $ 0.99 tam sim no. Lawv me me, lub teeb me me, tab sis tsis muaj lub zog ntau. Tsis paub nws yuav zoo li cas tam sim no.)

Kauj Ruam 2: Nrhiav Cov Hauv Paus

Nrhiav Cov Av
Nrhiav Cov Av
Nrhiav Cov Av
Nrhiav Cov Av

Yog li koj tau txais tsib (lossis plaub, lossis rau) xov hlau. Koj lub cav yuav muaj ob ntu, thiab koj tuaj yeem tuaj yeem qhia txawm tias yog saib sab twg txhua tus xaim yog.

Yog tias koj tsuas yog saib plaub lub xov hlau, koj muaj hmoo - nws yog lub cev muaj zog bipolar. Txhua yam koj yuav tsum ua yog xam seb ob khub ntawm cov xov hlau mus ua ke. Yog tias koj tau txais lub cev muaj zog unipolar, lossis ntau dua 4 xov hlau, koj yuav tsum tau tshem tawm koj lub ohmeter. Dab tsi koj tab tom nrhiav yog cov xaim (hauv av) rau txhua ib nrab. Koj tuaj yeem qhia qhov twg yog qhov av hauv lub cev muaj zog bipolar vim tias nws muaj ib nrab qhov kev tiv thaiv rau ib qho ntawm tus ncej dua li tus ncej hla hla lawv tus kheej. Daim duab yog kuv cov ntawv sau los ntawm kev txuas cov xov hlau mus rau xov hlau thiab ceeb toom qhov tsis kam (lossis yog tias lawv txuas nrog txhua). Koj tuaj yeem pom tias Dawb yog av rau hauv qab trio b/c nws muaj ib nrab tiv rau Liab lossis Xiav uas lawv muaj rau ib leeg. (Lub cav no coj txawv txawv thiab tsis muaj lub kais nruab nrab ntawm cov hlau nplaum sab saum toj. Nws zoo li nws yog ib nrab-bipolar, ib nrab-unipolar. coil tau tsav.)

Kauj Ruam 3: Txheeb Tawm Qhov Kev Txiav Txim Siab

Xam Tawm Txoj Cai Txiav Txim
Xam Tawm Txoj Cai Txiav Txim

Kuv tab tom tsav lub cav no ua ib qho kev puas siab puas ntsws, yog li kuv tsis quav ntsej cov xov hlau dawb hauv av. Kuv tsuas muaj plaub txoj xov los txhawj txog.

Tej zaum koj yuav xav khiav koj lub cev tsis muaj zog li bipolar ib qho ntxiv, vim tias nws siv tag nrho cov kauj hauv ob theem tsis hloov ntawm ob ntu ib nrab ntawm txhua lub kauj. Ntau kauj = ntau lub zog. Khiav tam sim no los ntawm ib khub (sau tseg qhov sib txawv uas koj tau xaiv) thiab tom qab ntawd khiav tam sim no los ntawm lwm khub tib lub sijhawm. Thaum koj txuas tus khub thib ob, saib txoj kev twg lub cav tig mus. Sau qhov no. Tam sim no thim rov qab polarity ntawm thawj khub koj xaiv. Tom qab ntawd nqes tus khub thib ob ntxiv nrog lawv cov polarity kuj thim rov qab. Nco ntsoov cov lus qhia. Los ntawm qhov no koj yuav tsum tuaj yeem txiav txim siab qhov ua ntu zus rau kev hloov lub cav hauv ob qho tib si. Hauv kuv qhov piv txwv, ob qho tag nrho tig rov qab rau lub moos, yog li nqis los ua ntu zus hauv tib txoj kev uas kuv tau xaiv yuav nqis tes ua lub cav CCW.

Kauj Ruam 4: Siv Lub Cev Tsav Tsheb rau Kev Xeem Tsav Tsheb

Siv Lub Cev Tsav Tsheb rau Kev Xeem Tsav
Siv Lub Cev Tsav Tsheb rau Kev Xeem Tsav

Yog tias koj tseem tsis tau npaj rau microprocessor programming, koj tuaj yeem ua phem dua li Ghetto Development Kit lossis ib qho ntawm ntau yam PIC programmers. Nqa cov xov hlau ncaj qha mus rau koj lub microproc thiab hlawv nws nrog cov cai hauv qab no:

/* Ua si nrog kom tau txais lub zog me me stepper tsav. */

/ * Suav nrog ncua sijhawm */ #define F_CPU 1000000UL #include/ * Pin defs rau ATTiny2313 *// * Clockwise order */ #define BLUE _BV (PB0) #define BLACK _BV (PB1) #define RED _BV (PB2) #define YELLOW _BV (PB3) #define DELAY 200 / * milliseconds between steps * / int main (void) {DDRB = 0xff; / * Pab kom tso zis rau txhua tus B pins */ PORTB = 0x00; / * Teeb lawv txhua tus rau 0v */ thaum (1) {/ * lub ntsiab lus nyob ntawm no */ PORTB = XIAV; _delay_ms (DELAY); PORTB = LOJ; _delay_ms (DELAY); PORTB = liab; _delay_ms (DELAY); PORTB = YELLOW; _delay_ms (DELAY); }} Txoj cai ntawd yooj yim npaum li cas? Yooj yim heev. Txhua yam nws ua yog ua qee cov ntsiab lus zoo yog li kuv tuaj yeem xa mus rau cov xov hlau los ntawm cov xim ntau dua li lawv tus pin-npe, thiab tom qab ntawd nws toggles lawv nyob rau hauv ib ntu nrog qhov hloov kho ncua nyob nruab nrab. Txog qhov pib, Kuv tau xaiv ib nrab-ob ncua sijhawm ntawm cov kauj ruam. Saib cov vis dis aus luv luv rau cov txiaj ntsig. Yog tias koj nyob ntawm koj qhov kev ua si tiag tiag, suav tus naj npawb ntawm cov kauj ruam hauv ib lub hlis txhawm rau txiav txim siab lub cev muaj zog ib leeg-kauj ruam kev daws teeb meem. (Auj yog. PS. Tsav tsis muaj thauj khoom ntawm 3.6v yooj yim. Saib cov roj teeb hauv video.)

Kauj Ruam 5: Viav Vias Nws Rov Qab thiab Mus Ntxiv

Yog li koj tau txais nws ua haujlwm raws clockwise. Puas muaj lwm yam nthuav? Me ntsis code-ntxuav, thiab peb tuaj yeem khiav nws rov qab los. Kuv muab cov lej sib dhos ua ntu zus rau hauv kab lus kom koj tuaj yeem hla dhau cov theem nrog qhov yooj yim rau lub voj. Tam sim no koj tuaj yeem khiav lub voj nce lossis nqis kom mus raws lub moos los yog rov qab.

int lub ntsiab (tsis muaj dab tsi) {const uint8_t ncua = 50; const uint8_t clockwise = {XEEB, DUB, Liab, YELLOW}; uint8_t kuv; DDRB = 0xff; / * Pab kom tso zis rau txhua tus B pins */ PORTB = 0x00; / * Teeb lawv txhua tus rau 0v */ thaum (1) {/ * lub ntsiab lus nyob ntawm no */ rau (i = 0; kuv <= 3; i ++) {/ * nqis los ntawm cov xim clockwise */ PORTB = clockwise ; _delay_ms (ncua); } rau (i = 3; i> = 0; i-) { / * nqis los ntawm cov xim ccw * / PORTB = clockwise ; _delay_ms (ncua); }}} Saib cov vis dis aus tsis txaus ntseeg rau sab nraub qaum thiab txhua yam.

Kauj Ruam 6: Kuv Tsis Yeej Ib Nrab Kauj Ruam, Vim Kuv Tsis Yog Ib Ntej Ib Leeg …

Quest lyric ib sab, ib nrab-kauj ruam koj lub cav yog qhov uas nws nyob. Koj tau txais qhov siab tshaj tam sim no, ntau lub zog tam sim, thiab ob zaug qhov kev daws teeb meem kaum. Ib nrab ntawm kev nqis tes ua: Hloov Xiav, Dub, Liab, Daj, koj tsav lub cav nrog Xiav, Xiav+Dub, Dub, Dub+Liab, Liab, Liab+Liab, Daj, Daj+Daj. Qhov tshwm sim yog qhov rau ib nrab ntawm lub sijhawm koj tau koom nrog ob lub hlau nplaum ib zaug. Thiab thaum lub sijhawm uas ob qho teeb tsa tau koom nrog, lub cav taw tes ib nrab ntawm ob qho, nqaim lub kaum sab xis ntawm "cov kauj ruam" thiab ua kom lub cav tig tau zoo dua. Koj puas tuaj yeem qhia los ntawm daim vis dis aus? Kuv tsis paub tseeb … Tam sim no ib feem ntawm cov cai uas ua ib nrab-kauj ruam zoo li no:

void halfStepping (uint16_t ncua, uint8_t kev qhia ) {uint8_t kuv; rau (i = 0; kuv <= 3; i ++) {PORTB = kev qhia ; / * ib leeg-kauj ib feem */ _delay_ms (ncua); PORTB | = kev qhia [i+1]; / * ntxiv hauv ib nrab-kauj ruam */ _delay_ms (ncua); }} Thawj PORTB cov lus txib teeb tsa ib tus ncej rau qhov zoo thiab txhua qhov so rau qhov tsis zoo. Ces nws tos. Tom qab ntawv PORTB qhov lus txib thib ob teeb tsa tus ncej thib ob (ntawm lwm qhov cua) kom zoo, koom nrog ob txoj hlua rau 1.4x lub zog (thiab 2x tam sim no). Ib daim ntawv teev npe tag nrho cov program tau txuas hauv qab no. Ob arrays tam sim no tau piav qhia (clockwise, counterclockwise) thiab ob qho tib si muaj 5 lub ntsiab lus txhua qhov kom tso cai rau i+1 nkag mus rau hauv ib nrab ua haujlwm.

Kauj Ruam 7: Ntxiv Tsav Tsheb

Ntxiv Tsav Tsheb
Ntxiv Tsav Tsheb
Ntxiv Tsav Tsheb
Ntxiv Tsav Tsheb
Ntxiv Tsav Tsheb
Ntxiv Tsav Tsheb

Txog tam sim no zoo heev.

Tsuas yog teeb meem yog lub cav tsis zoo li muaj tag nrho lub zog ntau, uas tuaj yeem yog vim qhov tseeb tias microprocessor tsuas yog tso tawm ~ 50mA rau tus pin. Cov kauj ruam tom ntej pom tseeb yuav yog nqes nws mus rau tus tsav tsheb kom muab nws nrog kua txiv ntau dua. Tab sis tom qab ntawd xav me ntsis: Kuv tsuas yog tsav nws nrog 5v, thiab cov kauj-winding tsis kam yog ~ 125 ohms. Uas txhais tau tias lub cav tsuas yog kos 40mA rau tus pin, thiab nws yuav tsum tau tsav kom zoo los ntawm (nqaij nyug!) AVR nti. Yog li kom tau txais qhov hluav taws xob ntau dua tsav lub cav, Kuv nqes nws mus rau SN754410 H-choj nti. Lub voj voog yog yooj yim zoo nkauj. Txhua tus pin los ntawm AVR mus rau lub tswv yim, thiab cov khoom sib txuas sib txuas mus rau lub cev muaj zog. Cov nti xav tau 5v rau ntu kev xav, thiab tuaj yeem siv hluav taws xob ntau ntxiv hauv ntu lub cev muaj zog. Khiav nws ntawm 11.25v (peb lub roj teeb 3.6v) tau pab me ntsis. Pom tau ntau lub zog rau kuv tus ntiv tes, tab sis nws tseem tsis yog lub zog loj. Tsis phem rau lub cav uas me dua li npib tsib xee, ho. Thiab tam sim no lub Circuit Court dhau los ua lub hom phiaj dav dav bipolar stepper lub cev muaj zog tsav tsheb. Ntxiv Nov 29: Khiav lub cav nag hmo ntawm 12v ib pliag thiab nws pib kub. Kuv tsis paub tseeb tias nws yog qhov teeb meem cuam tshuam ntau zaus lossis yog tias nws yooj yim heev rau tam sim no rau qhov cua. Ua li cas los xij, ua tib zoo saib me ntsis yog tias koj tab tom tsav lub cav me me no nrog cov hluav taws xob loj dua.

Kauj Ruam 8: Qhov Kawg

Yog li kuv tau kawm dab tsi? Tsav tus tsav tsheb nrog AVR (thiab H-choj nti) yog qhov yooj yim zoo nkauj, txawm tias nyob hauv "zoo nkauj" ib nrab-kauj ruam hom.

Tsis paub meej tias kuv yuav ua dab tsi nrog lub cav me me stepper tseem tsis tau, txawm li cas los xij. Cov lus qhia?

Pom zoo: