Cov txheej txheem:

Clockwork: 7 Cov kauj ruam
Clockwork: 7 Cov kauj ruam

Video: Clockwork: 7 Cov kauj ruam

Video: Clockwork: 7 Cov kauj ruam
Video: Wand Shop | ASMR Roleplay (Harry Potter & Ollivanders inspired, soft spoken) 2024, Hlis ntuj nqeg
Anonim
Clockwork
Clockwork

Cov lus qhia no tau tsim los ua kom tau raws txoj haujlwm xav tau ntawm Makecourse ntawm University of South Florida (www.makecourse.com).

Kauj ruam 1: Tswv yim

Thaum kuv sim tawm tswv yim rau lub tswv yim rau txoj haujlwm no, Kuv txiav txim siab ua qee yam uas siv tau thiab muaj txiaj ntsig zoo rau kuv lub neej txhua hnub. Tsis muaj ntau yam zoo li ntawd tuaj yeem muaj ob qib ntawm kev xav tau kev ywj pheej yog li kuv txiav txim siab ua lub moos yooj yim kom tau raws li qhov xav tau ntxiv nrog rau nws tso rau ntawm kuv lub rooj kom pom lub sijhawm. Keeb kwm lub tswv yim yog los ua lub dab teg, tab sis 3D luam tawm ib feem yuav tsawg dhau thiab cov cav uas tsav lub moos tseem yuav loj dhau rau lub dab teg.

Li no txoj haujlwm no, Kuv pom cov khoom seem nyob ib puag ncig kuv chav tsev thiab txiav txim siab ua haujlwm ntawm qhov no.

Kauj Ruam 2: Qhov Chaw

- 3D luam qhov chaw

- 2 28BYJ-48 5V DC Stepper Tsav

- 2 ULN2003 Stepper Tsav Tsav Tsav Tsheb

- Arduino Ib

- HC-05 Bluetooth Module

Txhua qhov ntawm no yog ua los ntawm kuv tshwj tsis yog lub moos txhais tes. Kuv tsis muaj tswv yim heev. Hauv qab no yog qhov txuas rau nws tus tsim.

www.thingiverse.com/thing: 441809

Kauj Ruam 3: Sib Sau Ua Ke

Sib dhos ntawm Xeem
Sib dhos ntawm Xeem

(1)- Koj yuav tsum tau muab Gear_1 thiab 2 rau lub cav tsav tsheb. Lawv yuav ua kom nruj haum yog li yuav tsum tau siv zog me ntsis kom lawv nyob hauv qhov chaw.

(2)- Base_0 yuav nyob hauv qab ntawm kev sib dhos.

(3)- Base_1 yuav muab tso rau saum SpurGear_1, qhov no yog lub hauv paus tseem ceeb rau feeb feeb. Koj tuaj yeem lo ob qho khoom no ua ke, xyuas kom lub hauv paus nyob saum lub iav.

(4)- Base_2 yuav muab tso rau saum SpurGears_2, qhov no yog lub hauv paus tseem ceeb rau lub sijhawm teev. Tib yam siv rau ntu no raws li theem (3)

(5)- Ob txhais tes ntawm lub moos tuaj yeem ua kua nplaum rau saum Base_1 thiab Base_2, lossis koj tuaj yeem laum lub qhov me me kom lawv haum rau hauv qhov chaw.

(6)- Txhawm rau kom muaj lub iav ntawm feeb feeb sib phim nrog lub zog iav, koj xav tau 1cm lub platform los tso tag nrho lub rooj sib txoos saum toj nrog ib qho ntawm cov tshuab hluav taws xob.

Qhov laj thawj rau qhov no vim tias lub hauv paus tseem ceeb tsis tuaj yeem siab vim tias lwm lub tshuab hluav taws xob stepper yuav tsis tuaj yeem ncav cuag lub iav siab. Txawm li cas los xij, yuav tsum muaj lub platform rau ib qho ntawm cov tshuab hluav taws xob.

Kauj Ruam 4: Tsev qiv ntawv rau Arduino IDE

Cov cai rau txoj haujlwm no yog ua raws lub tsev qiv ntawv los ntawm tyhenry hu ua CheapStepper.h

github.com/tyhenry/CheapStepper

Txhawm rau teeb tsa lub tsev qiv ntawv no rau koj arduino. Nyem clone lossis rub tawm ntawm qhov txuas saum toj no thiab rub nws ua zip file.

Hauv Arduino IDE. Sketch -> Xws li Lub Tsev Qiv Ntawv -> Ntxiv. ZIP Library

Tawm ntawm txhua lub tsev qiv ntawv uas ua haujlwm, qhov no tau siv lub tshuab tsav lub cev zoo tshaj plaws thiab yooj yim heev rau siv.

Kauj Ruam 5: Teeb Breadboard

Teeb Breadboard
Teeb Breadboard
Teeb Breadboard
Teeb Breadboard

Kuv siv daim thaiv Arduino mus nrog kuv Arduino UNO. Nws zoo dua huv si tab sis koj tuaj yeem tau txais daim ntawv me me thiab muab tso rau saum Arduino UNO dua. Ua raws cov xim ntawm cov txheej txheem raws li qee cov xov hlau nyob saum ib leeg. Pins 4-7 yog rau ib tus stepper thiab tus pin 8-11 yog rau tus thib ob stepper.

Bluetooth module yuav tsum tau txuas nrog RX -> TX thiab TX -> RX rau Arduino board.

Cov xov hlau xiav yog kev sib txuas los ntawm Tus Tsav Tsheb mus rau Arduino UNO

Cov xov hlau ntsuab yog RX thiab TX txuas

Cov xov hlau dub yog hauv av.

Cov xov hlau liab yog 5V.

Kauj ruam 6: Code

Hauv qab no yog cov cai rau txoj haujlwm no.

Kev piav qhia ntawm txoj cai yuav nyob ntawm no.

CheapStepper stepper (8, 9, 10, 11); CheapStepper stepper_2 (4, 5, 6, 7);

boolean moveClockwise = muaj tseeb;

//37.5 min = 4096;

// 1 feeb = 106.7;

5 feeb = 533.3;

15 feeb = 1603;

30 feeb = 3206;

60 feeb = 6412;

tag nrho = 4096;

int ib nrab = puv/2; 2048 ib

ntab full_time = 6412; // 1 teev

ntab ib nrab_ sijhawm = puv sijhawm/2; 30 feeb 3026

ntab fif_time = half_time/2; 15 feeb 1603

ntab ib_ sijhawm = puv sijhawm/60; 1 feeb 106

ntab tsib_ sijhawm = ib zaug*5; 5 feeb 534.3

ntab ib_sec = one_time/60; 1 vib nas this 1.78

// peb tuaj yeem ua 30 feeb txhua los ntawm kev hloov lub cav 3206 thiab rov pib dua

Nov yog qhov kev suav tseem ceeb rau txoj haujlwm no. Tus stepper yuav siv 4096 cov kauj ruam txhawm rau tig 360 degree tag nrho, tab sis vim tias lub zog spur loj dua li lub zog txuas rau tus stepper yog li nws yuav siv sijhawm ntau ntxiv rau kev sib hloov tag nrho. Raws li cov iav spur yog lub hauv paus tseem ceeb uas tig ob txhais tes. Kuv yuav tsum ua ntau yam kev sim kom ntseeg tau tias qhov txiaj ntsig raug.

full_time yog qhov sib txawv uas kuv tau muab rau kev sib hloov ntawm tes. Qhov no zoo ib yam tab sis raws li cov kauj ruam tau faib los ntawm 2 kom tau txais kev txav mus los, tus nqi ntab tau me dua, uas ua rau nws nyuaj rau tus neeg tsav tsheb ua nws txoj haujlwm.

MoveClockwise = muaj tseeb; yog ua kom lub tshuab hluav taws xob txav mus los raws lub moos, tab sis vim tias nws tau tig lub cav iav tig rov qab, peb yuav tsum ua kom cov boolean dag hauv kev teeb tsa. Koj tseem tuaj yeem tshaj tawm nws cuav thaum pib tab sis qhov no yog piav qhia nws ua haujlwm li cas.

teeb tsa tsis muaj dab tsi () {Serial.begin (9600);

Serial.println ("Npaj pib txav mus!");

pos = ib_ sijhawm; tau = 900; piv = 60;

moveClockwise = tsis tseeb; }

Nov yog qhov uas kuv tshaj tawm qhov moveClockwise boolean cuav. pos yuav yog tus lej ntawm cov kauj ruam, del yuav yog qhov qeeb, thiab qhov sib piv yog rau feeb/sec = 60 lossis teev/min = 12

Peb tswj tes nrog Bluetooth module. Ua ntej, koj xav tau lub davhlau ya nyob twg Bluetooth los ntawm koj lub Android ntaus ntawv. Txuas mus rau Hc-05 nrog tus lej PIN 0000 lossis 1234. Koj tuaj yeem siv qee qhov piv txwv piv txwv los ntawm Arduino IDE kom pom tias nws ua haujlwm raug. Thaum nws txuas nrog nws yuav tsum ntsais qeeb qeeb es tsis txhob nrawm thaum nws tsis txuas nrog.

void loop () {xeev = 0;

yog (Serial.available ()> 0) {

lub xeev = Serial.read (); }

rau (ntab s = 0; s <(pos); s ++) {

stepper.step (txavClockwise); }

rau (ntab s = 0; s <(pos/piv); s ++) {

stepper_2.step (txavClockwise); }

ncua (del);

Serial.available ()> 0 yog qhov tseem ceeb vim nws yog koj li Bluetooth module ua haujlwm li cas. Qhov no yog cov lus yuav muaj tseeb thaum muaj kev sib txuas lus ntawm Arduino thiab koj lub cuab yeej. Lub xeev sib txawv yuav txiav txim siab 3 lwm qhov kev hloov pauv uas kuv tshaj tawm saum toj ntawm teeb tsa (), nws tseem yuav luam tawm cov haujlwm uas tus lej tau ua haujlwm. Ob qhov rau lub voj yog lub luag haujlwm tseem ceeb uas ua rau lub zog theem yuav txav mus li cas.

yog (xeev == '1') {

pos = ib_ sijhawm; del = 0; piv = 12;

Serial.println ("Kev Ua Haujlwm 1: Tsis Ncua Sijhawm"); }

Nov yog ib qho piv txwv ntawm kev siv cov tswv yim los ntawm koj lub cuab yeej Bluetooth txhawm rau hloov kev ua haujlwm li cas. Koj tuaj yeem hloov kho qhov hloov pauv no txawm li cas los xij koj nyiam tswj tes.

Kauj ruam 7: Demo thiab xaus

Image
Image
Demo thiab Xaus
Demo thiab Xaus

Nov yog qhov ua piv txwv ntawm qhov system, qhia tias nws ua haujlwm li cas. Rau lub thawv ntawv koj tuaj yeem siv txhua yam uas yuav haum rau txhua yam khoom siv sab hauv. Txoj haujlwm no yooj yim thiab lom zem vim nws yog thawj zaug kuv luam tawm 3D. Bluetooth module tau lom zem los xam thiab siv. Muaj qee qhov yuam kev kuv tau ua uas lig dhau los hloov pauv tab sis cov khoom kawg yog qhov zoo.

Pom zoo: