Cov txheej txheem:

EF 230 ntes lub Hnub: 6 Kauj Ruam
EF 230 ntes lub Hnub: 6 Kauj Ruam

Video: EF 230 ntes lub Hnub: 6 Kauj Ruam

Video: EF 230 ntes lub Hnub: 6 Kauj Ruam
Video: china vs india || mathematics challenge || 馃槀馃槀馃ぃ馃槄 2024, Kaum ib hlis
Anonim
EF 230 ntes lub Hnub
EF 230 ntes lub Hnub

Cov lus qhia no yuav piav qhia yuav siv Arduino cov khoom siv/khoom siv hluav taws xob li cas thiab MATLAB los tsim cov qauv kev siv hluav taws xob hauv tsev uas tsom mus rau kev nrhiav cua thiab hnub ci zog. Nrog cov ntaub ntawv tsim nyog thiab los ntawm kev siv cov cai/teeb tsa, koj tuaj yeem ua rau koj tus kheej me me, kev sau cov zog ntsuab.

Txoj haujlwm no tau tsim los ntawm cov tub ntxhais kawm hauv Tickle College of Engineering ntawm University of Tennessee, Knoxville.

Kauj Ruam 1: Cov Ntaub Ntawv Xav Tau

Cov Ntaub Ntawv Xav Tau
Cov Ntaub Ntawv Xav Tau

1) Lub khoos phis tawj nrog MATLAB teeb tsa.

2) Siv qhov txuas no rub tawm Arduino pob txhawb nqa:

3) Koj tseem yuav xav tau Arduino micro-controller khoom siv.

4) Lub platform tsim nyog los teeb tsa DC lub cav. Hauv qhov piv txwv muab, txiav ntoo tau siv los txhawb nqa lub cav servo thiab nce DC lub cav rau saum.

5) Qhov txuas no tuaj yeem siv rau 3D luam tawm lub kiv cua uas tuaj yeem txuas rau ntawm lub tshuab DC txuas:

Kauj Ruam 2: Txoj Cai Tshooj 1: Kev teeb tsa hloov pauv

Txoj Cai Tshooj 1: Teeb Tsis Txaus
Txoj Cai Tshooj 1: Teeb Tsis Txaus

Txoj cai no yog qhov tseem ceeb rau kev tshaj tawm thawj zaug sib txawv.

clc; tshem tag nrho;

%Tshaj tawm Cov Khoom Zoo li Pins thiab Arduino a = arduino ('com3', 'uno'); s1 = servo (a, 'D9', 'MinPulseDuration', 1e-3, 'MaxPulseDuration', 2e-3); s2 = servo (a, 'D10', 'MinPulseDuration', 1e-3, 'MaxPulseDuration', 2e-3); configurePin (a, 'A0', 'Analoginput'); configurePin (a, 'A1', 'Analoginput'); configurePin (a, 'A2', 'Analoginput'); configurePin (a, 'A3', 'Analoginput') b = 0; i = 0.1 daim duab

Kauj Ruam 3: Txoj Cai Tshooj 2: Turbine Code

Txoj Cai Tshooj 2: Txoj Cai Turbine
Txoj Cai Tshooj 2: Txoj Cai Turbine

thaum kuv <10;

%Turbine Tshooj potval = readVoltage (a, 'A0') servoval = potval./5 writePosition (s1, servoval)

Kauj Ruam 4: Txoj Cai Tshooj 3: Hnub Ci Vaj Huam Sib Luag Cai thiab Plot

Txoj cai no yuav tso cai rau koj siv ob daim duab-tiv thaiv kom txav cov servo raws li lub hnub txav. Txoj cai tseem yuav npaj ib daim duab qhia txog huab cua ntawm kev taw qhia lub sijhawm rau cua tshuab cua.

%Hnub Ci Vaj Huam Sib Luag Tshooj

photoval1 = readVoltage (a, 'A1'); photoval2 = readVoltage (a, 'A2'); qhov txawv = photoval1-photoval2 absdiff = abs (sib txawv) yog qhov sib txawv> 1.5 writePosition (s2, 0); elseif qhov txawv> 1.25 writePosition (s2, 0.3); elseif absdiff <1 writePosition (s2, 0.5); elseif qhov txawv <(-1) writePosition (s2, 0.7); elseif qhov txawv <(-1.25) writePosition (s2, 1); lwm qhov kawg i = i+0.1 theta = (potval/5).*(2*pi) polarscatter (theta, i) tuav ntawm qhov kawg

Kauj Ruam 5: Txoj Cai Tshooj 4: Email

Hloov 'piv txwv email' mus rau qhov chaw nyob uas xav tau kom tau txais email zoo nrog rau cov ntaub ntawv phiaj xwm.

Tshooj Email

title ('Wind Direction vs. Time') saveas (gcf, 'Turbine.png') %txuag daim duab setpref ('Internet', 'SMTP_Server', 'smtp.gmail.com'); setpref ('Internet', 'E_mail', '[email protected]'); % xa nyiaj xa los ntawm setpref ('Internet', 'SMTP_Username', '[email protected]'); % xa cov neeg siv lub npe setpref ('Internet', 'SMTP_Password', 'gssegsse'); % Cov neeg xa tus lej password = java.lang. System.getProperties; props.setProperty ('mail.smtp.auth', 'tseeb'); props.setProperty ('mail.smtp.socketFactory.class', 'javax.net.ssl. SSLSocketFactory'); props.setProperty ('mail.smtp.socketFactory.port', '465'); xa ntawv ('piv txwv email', 'Turbine Data', 'Qhov no yog koj cov ntaub ntawv turbine. Ua tsaug rau txuag lub ntiaj chaw!', 'Turbine.png') disp ('email xa')

Kauj Ruam 6: Kev Pab Ntxiv

Kev Pab Ntxiv
Kev Pab Ntxiv

Koj tuaj yeem xa mus rau SIK Phau Ntawv Qhia uas txuas nrog Arduino micro tswj cov khoom siv rau kev pab ntxiv hauv kev teeb tsa koj lub rooj tsav xwm hauv Circuit. MathWorks lub vev xaib kuj tseem tuaj yeem pab tau zoo rau MATLAB txhawb nqa.

Pom zoo: