Cov txheej txheem:

Pom kev pom L3G4200D Gyro txav Nrog Blender: 5 Kauj Ruam
Pom kev pom L3G4200D Gyro txav Nrog Blender: 5 Kauj Ruam

Video: Pom kev pom L3G4200D Gyro txav Nrog Blender: 5 Kauj Ruam

Video: Pom kev pom L3G4200D Gyro txav Nrog Blender: 5 Kauj Ruam
Video: Ntsia tsi pom kev tau zoo | Tswv Cheeb Yaj | Nkauj tawm tshiab 2024, Hlis ntuj nqeg
Anonim
Image
Image

Kuv tau yuav qhov pheej yig dua gyro L3G4200D sensor los ntawm eBay uas tuaj yeem kuaj pom 3 axis kev sib hloov thiab xa nws los ntawm I2C lossis SPI interface. Kuv tau sim siv nws txhawm rau txheeb xyuas kab rov tav thiab ntsug sib hloov hauv lub sijhawm tiag. Qhov no muab tawm nyuaj heev vim kuv tsis tuaj yeem pom dab tsi Gyro tau tso tawm. Kuv xav tau kev pom kev. Kuv xaus nrog siv Blender kom pom lub gyro uas txuas nrog rau Arduino Uno. Nrog kev sib xyaw ua ke no, Kuv tau txais daim ntawv tshaj tawm lub sijhawm tiag tiag uas tau ua tiav zoo nkauj thiab ua pov thawj lub sensor kom raug qhov tseeb ntawm qhov nws ua.

Kauj ruam 1: Kho vajtse

Lub Software
Lub Software

L3G4200D sensor

Arduino Uno (yuav luag txhua Arduino yuav ua nws)

Lub sensor txuas mus rau Arduino li no.

Thiab Arduino txuas rau lub PC.

Kauj ruam 2: Software

Rau qhov pom kev, Kuv siv rab thiab nab nab.

Nov yog qhov pib teeb meem. Peb yuav tsum teeb tsa Blender thiab nab hab sej kom raug. Peb xav tau Blender los sib qhia ib yam li nab hab sej raws li lub kaw lus siv. Txoj hauv kev zoo tshaj plaws yog rub lub Blender tshiab tshaj plaws, Nruab nws. Qhib Blenders sab hauv nab. Ntawm kuv lub khoos phis tawj nws nyob ntawm: C: / Program Files Files Blender Foundation / Blender / 2.78 / python / bin / python.exe Nws qhia txog Python version Blender siv.

Lub taub hau mus rau nplooj Python thiab rub tawm EXACT tib yam nab nab raj mis. https://www.python.org/downloads/Install python tab sis kos rau hauv [Ntxiv Python rau PATH] thaum pib ntawm wizard nruab.

Hloov npe daim nplaub tshev qhov twg nab nab nyob qhov twg siv rab rab kom nws yuav tsis raug lees paub ntxiv los ntawm blender.rename

C: / Program Files Files Blender Foundation / Blender / 2.78 / sej

rau

C: / Program Files Files Blender Foundation / Blender / 2.78 / python_old

Yog tias peb pib tov tam sim no nws yuav tsum tuaj yeem pib yam tsis muaj teeb meem. Yog tias qhov haujlwm poob qis uas txhais tau hais tias cov nab hab sej version tsis zoo ib yam li rab rab siv ua ntej lossis PATH tsis tau hloov kho tshiab.

Tib yam uas ploj lawm tam sim no yog cov tsev qiv ntawv peb yuav siv nrog nab hab sej. Hluav taws tuaj nab nab thiab peb yuav rub tawm lub tsev qiv ntawv ntawv cov lus txib no uas tuaj yeem ua tiav ntawm kab lus hais kom ua:

pib install serial

Lub tsev qiv ntawv no xav tau vim tias nws ua rau nab nab kom tau txais kev sib txuas los ntawm Arduino.

Kauj Ruam 3: Cov Ntawv Sau

Cov Ntawv
Cov Ntawv

Ntawm Arduino, peb yuav tau xa cov ntawv no:

gist.github.com/BoKKeR/ac4b5e14e5dfe0476df7eb5065e98e98#file-l3g4200d-ino

Tsab ntawv no kuv pom thiab hloov kho los ntawm cov xov no ntawm Arduino lub rooj sab laj.

Txoj haujlwm ntawm tsab ntawv no yog kom tau txais cov ntaub ntawv los ntawm L3G4200D sensor thiab xa nws hla qhov teeb tsa COM chaw nres nkoj nrog 115200 baud tus nqi.

Cov piv txwv tso tawm:

X: 38.72 Y: 8.61 Z: -17.66

X: 39.30 Y: 8.37 Z: -18.17

X: 40.07 Y: 8.24 Z: -18.81

X: 40.89 Y: 8.30 Z: -19.46

X: 41.69 Y: 8.41 Z: -20.05

X: 42.42 Y: 8.41 Z: -20.44

Hauv rab phom, peb yuav tsum tau hloov qhov txheej txheem rau Scripting.

Ntawm sab laug, peb yuav tsum nkag mus rau peb tsab ntawv nab nab uas yuav tau txais cov ntaub ntawv thiab ua nws los ntawm lub ntsuas pa thiab hloov COM chaw nres nkoj mus rau qhov chaw nres nkoj uas peb Arduino nyob.

gist.github.com/BoKKeR/edb7cc967938d57c979d856607eaa658#file-blender-py

Kauj ruam 4: Khiav Tsab Ntawv

Khiav Tsab Ntawv
Khiav Tsab Ntawv

Tom qab tsoo Run Script txhua yam yuav tsum ua haujlwm thiab lub voos xwmfab yuav tsum tig raws li lub ntsuas hluav taws xob tig.

Kauj ruam 5: Troubleshooting

Teeb meem
Teeb meem

Yog tias koj ntsib teeb meem nrog kev ua tiav ntawm tsab ntawv koj yuav tsum qhib qhov System console. Nyem Qhov rai -> Toggle System Console los qhia lub console qhov twg qhov ua yuam kev raug qhia.

Qhov ua yuam kev feem ntau yog kev tso cai tsis kam qhib qhov chaw nres nkoj. Txhawm rau kho qhov no sai txuas nrog Arduino thiab txuas nws dua.

Yog tias koj xav tau kev pab ntau dua taub hau rau kuv lub vev xaib rau kev txhawb nqa zoo dua.

tnorbert.com/visualizing-l3g4200d-gyro-movement-with-blender/

Pom zoo: