Cov txheej txheem:
- Kauj Ruam 1: Yuav Tsum Kho Vajtse:
- Kauj ruam 2: Khoos phis tawj sib txuas:
- Kauj Ruam 3: Txoj Cai rau Tsab Ntawv Teev Npe:
- Kauj Ruam 4: Cov ntawv thov:
Video: Motion Tracking Siv MPU-6000 thiab Raspberry Pi: 4 Cov Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:25
MPU-6000 yog 6-Axis Motion Tracking Sensor uas muaj 3-Axis accelerometer thiab 3-Axis gyroscope kos rau hauv. Qhov ntsuas no muaj peev xwm taug qab qhov tseeb ntawm qhov chaw thiab qhov chaw ntawm ib yam khoom hauv lub dav hlau 3-dimensional. Nws tuaj yeem ua haujlwm hauv cov kab ke uas xav tau kev tshuaj xyuas txoj haujlwm mus rau qhov siab tshaj plaws.
Hauv qhov kev qhia no kev cuam tshuam ntawm MPU-6000 sensor module nrog raspberry pi tau piav qhia. Txhawm rau nyeem qhov tseem ceeb ntawm kev nrawm thiab tig lub kaum ntse ntse, peb tau siv raspberry pi nrog I2c adapter. Qhov I2C adapter ua rau kev txuas mus rau lub ntsuas qhov ntsuas tau yooj yim thiab ntseeg tau ntau dua.
Kauj Ruam 1: Yuav Tsum Kho Vajtse:
Cov ntaub ntawv uas peb xav tau kom ua tiav peb lub hom phiaj suav nrog cov khoom siv hauv qab no:
1. MPU-6000
2. Raspberry Pi
3. I2C Cable
4. I2C Shield rau raspberry pi
5. Ethernet cable
Kauj ruam 2: Khoos phis tawj sib txuas:
Tshooj khoos phis tawj sib txuas ntu piav qhia qhov txuas txuas uas xav tau ntawm lub ntsuas cua thiab raspberry pi. Ua kom muaj kev sib txuas raug yog qhov tseem ceeb xav tau thaum ua haujlwm ntawm ib qho system rau qhov xav tau cov zis. Yog li, qhov xav tau kev sib txuas yog raws li hauv qab no:
MPU-6000 yuav ua haujlwm dhau I2C. Nov yog qhov piv txwv kab hluav taws xob daim duab, qhia txog yuav ua li cas xaim txhua lub interface ntawm lub sensor.
Tawm-ntawm-lub thawv, lub rooj tsavxwm tau teeb tsa rau I2C interface, zoo li peb pom zoo siv qhov kev sib txuas no yog tias koj tsis ntseeg lwm yam.
Txhua yam koj xav tau yog plaub lub xov hlau! Tsuas yog plaub qhov kev sib txuas xav tau Vcc, Gnd, SCL thiab SDA tus pin thiab cov no txuas nrog kev pab ntawm I2C cable.
Cov kev sib txuas no tau qhia hauv cov duab saum toj no.
Kauj Ruam 3: Txoj Cai rau Tsab Ntawv Teev Npe:
Qhov zoo ntawm kev siv raspberry pi yog, uas muab rau koj hloov pauv ntawm cov lus programming uas koj xav tau los teeb tsa lub rooj tsav xwm txhawm rau txhawm rau cuam tshuam lub sensor nrog nws. Kev siv cov txiaj ntsig zoo ntawm pawg thawj coj no, peb tab tom qhia ntawm no nws cov phiaj xwm hauv nab hab sej. Nab hab sej yog ib qho ntawm cov lus yooj yim programming nrog cov lus yooj yim tshaj plaws. Cov nab npawb nab npawb rau MPU-6000 tuaj yeem rub tawm los ntawm peb cov zej zog GitHub uas yog Dcube Store
Ntxiv rau qhov yooj yim ntawm cov neeg siv, peb tab tom piav qhia cov cai ntawm no thiab:
Raws li thawj kauj ruam ntawm kev sau npe, koj yuav tsum rub tawm SMBus lub tsev qiv ntawv thaum muaj nab nab vim tias lub tsev qiv ntawv no txhawb nqa cov haujlwm siv hauv txoj cai. Yog li, txhawm rau rub lub tsev qiv ntawv koj tuaj yeem mus ntsib qhov txuas hauv qab no:
pypi.python.org/pypi/smbus-cffi/0.5.1
Koj tuaj yeem luam cov cai ua haujlwm los ntawm no kuj:
ntshuam smbus
lub sij hawm ntshuam
# Tau I2C busbus = smbus. SMBus (1)
# MPU-6000 chaw nyob, 0x68 (104)
# Xaiv gyroscope teeb tsa sau npe, 0x1B (27)
# 0x18 (24) Qhov ntsuas tag nrho = 2000 dps
bus.write_byte_data (0x68, 0x1B, 0x18)
# MPU-6000 chaw nyob, 0x68 (104)
# Xaiv cov ntawv teev npe kev ntsuas tus ntsuas, 0x1C (28)
# 0x18 (24) Qhov ntsuas tag nrho = +/- 16g
bus.write_byte_data (0x68, 0x1C, 0x18)
# MPU-6000 chaw nyob, 0x68 (104)
# Xaiv lub zog tswj kev sau npe1, 0x6B (107)
# 0x01 (01) PLL nrog xGyro siv
bus.write_byte_data (0x68, 0x6B, 0x01)
sijhawm.s pw (0.8)
# MPU-6000 chaw nyob, 0x68 (104)
# Nyeem cov ntaub ntawv rov qab los ntawm 0x3B (59), 6 bytes
# Accelerometer X-Axis MSB, X-Axis LSB, Y-Axis MSB, Y-Axis LSB, Z-Axis MSB, Z-Axis LSB
cov ntaub ntawv = bus.read_i2c_block_data (0x68, 0x3B, 6)
# Hloov cov ntaub ntawv
xAccl = cov ntaub ntawv [0] * 256 + cov ntaub ntawv [1]
Yog tias xAccl> 32767:
xAccl -= 65536
yAccl = cov ntaub ntawv [2] * 256 + cov ntaub ntawv [3]
Yog tias yAccl> 32767:
yAccl -= 65536
zAccl = cov ntaub ntawv [4] * 256 + cov ntaub ntawv [5]
yog zAccl> 32767:
zAccl -= 65536
# MPU-6000 chaw nyob, 0x68 (104)
# Nyeem cov ntaub ntawv rov qab los ntawm 0x43 (67), 6 bytes
# Gyrometer X-Axis MSB, X-Axis LSB, Y-Axis MSB, Y-Axis LSB, Z-Axis MSB, Z-Axis LSB
cov ntaub ntawv = bus.read_i2c_block_data (0x68, 0x43, 6)
# Hloov cov ntaub ntawv
xGyro = cov ntaub ntawv [0] * 256 + cov ntaub ntawv [1]
yog xGyro> 32767:
xwm -65536
yGyro = cov ntaub ntawv [2] * 256 + cov ntaub ntawv [3]
Yog tias yGyro> 32767:
yGyro -= 65536
zGyro = cov ntaub ntawv [4] * 256 + cov ntaub ntawv [5]
yog zGyro> 32767:
zGyro -= 65536
# Cov ntaub ntawv tso tawm rau lub vijtsam
luam "Kev nrawm hauv X-Axis: %d" %xAccl
luam "Kev nrawm hauv Y-Axis: %d" %yAccl
luam "Kev nrawm hauv Z-Axis: %d" %zAccl
luam "X-Axis ntawm Kev Hloov: %d" %xGyro
luam "Y-Axis ntawm Kev Hloov: %d" %yGyro
luam "Z-Axis ntawm Kev Hloov: %d" %zGyro
Txoj cai tau ua tiav siv cov lus txib hauv qab no:
$> nab nab MPU-6000.py gt; nab hab sej MPU-6000.py
Cov zis ntawm lub ntsuas tau pom hauv daim duab saum toj no rau kev siv ntawm tus neeg siv.
Kauj Ruam 4: Cov ntawv thov:
MPU-6000 yog lub suab ntsuas lub suab ntsuas, uas pom nws daim ntawv thov hauv kev sib cuam tshuam ntawm cov xov tooj ntawm tes thiab ntsiav tshuaj. Hauv cov xov tooj ntawm tes cov cuab yeej no tuaj yeem ua haujlwm hauv cov ntawv thov xws li kev hais lus taw tes rau kev siv thiab tswj lub xov tooj, txhim kho kev ua si, ua kom muaj kev muaj tiag, ua kom pom cov duab pom thiab pom, thiab taug kev thiab tsheb nqaj hlau. MotionTracking thev naus laus zis tuaj yeem hloov kho lub xov tooj thiab cov ntsiav tshuaj rau hauv cov cuab yeej ntse 3D uas tuaj yeem siv rau hauv cov ntawv thov xws li kev saib xyuas kev noj qab haus huv thiab kev tawm dag zog mus rau cov kev pabcuam raws qhov chaw.
Pom zoo:
Cov Hais Lus Ua Los Ntawm Cov Khoom Siv Rov Los thiab Rov Siv Dua: 6 Cov Kauj Ruam
Cov Hais Lus Ua Los Ntawm Cov Khoom Siv Rov Los thiab Rov Los Siv Rov Los: " Suab paj nruag yog cov lus thoob ntiaj teb ntawm tib neeg. Thiab qhov zoo tshaj plaws-lawv tsis tau them kuv ib dime. Txhua yam nyob rau hauv no pr
Txawb Xov Tooj Siv Yooj Yim Siv STM32F407 Cov Khoom Siv Tshawb Pom thiab GSM A6 Module: 14 Cov Kauj Ruam (nrog Duab)
Kev Siv Xov Tooj Ntawm Lub Xov Tooj Siv STM32F407 Cov Khoom Siv Tshawb Pom thiab GSM A6 Module: Koj puas tau xav tsim qhov kev ua kom txias txias? Yog tias yog, ua li cas txog kev tsim ib qho ntawm cov neeg nyiam tshaj plaws thiab txhua tus nyiam cov khoom siv xws li Lub Xov Tooj Txawb !!!. Hauv Cov Lus Qhia no, Kuv yuav qhia koj yuav tsim lub xov tooj txawb yooj yim siv STM li cas
Arduino Neeg Hlau Nrog Kev Nyob, Kev Qhia thiab Qib Kev Sib Hloov (Sab Hnub Poob, Sab Hnub Poob, Sab Qaum Teb, Sab Qab Teb) Tswj los ntawm Lub Suab Siv Bluetooth Module thiab Kev Siv Tus Neeg Siv Hluav Taws Xob: 6 Kauj Ruam
Arduino Neeg Hlau Nrog Kev Nyob, Kev Qhia thiab Qib Kev Sib Hloov (Sab Hnub Poob, Sab Hnub Poob, Sab Qaum Teb, Sab Qab Teb) Tswj los ntawm Lub Suab Siv Bluetooth Module thiab Kev Siv Tus Neeg Siv Hluav Taws Xob: Cov lus qhia no piav qhia yuav ua li cas thiaj tsim tau Arduino Robot uas tuaj yeem txav mus raws qhov xav tau (Forward, Backward) , Sab laug, Txoj Cai, Sab Hnub Poob, Sab Hnub Poob, Sab Qaum Teb, Sab Qab Teb) xav tau Kev nrug deb hauv Centimeters siv lub suab hais kom ua. Neeg hlau kuj tseem tuaj yeem txav tau tus kheej
Nkag Mus Cov Ntaub Ntawv thiab Npaj Cov Duab Online Siv NodeMCU, MySQL, PHP thiab Chartjs.org: 4 Cov Kauj Ruam
Nkag Mus Cov Ntaub Ntawv thiab Npaj Cov Duab Online Siv NodeMCU, MySQL, PHP thiab Chartjs.org: Cov lus qhia no piav qhia yuav ua li cas peb tuaj yeem siv Node MCU pawg thawj coj los sau cov ntaub ntawv los ntawm ntau lub ntsuas, xa cov ntaub ntawv no mus rau tus tswv PHP cov ntaub ntawv uas tom qab ntawd ntxiv cov ntaub ntawv rau MySQL database. Cov ntaub ntawv tuaj yeem pom online hauv kab ntawv, siv chart.js.A ba
Cov Cuab Yeej Siv Hluav Taws Xob thiab Cov Cuam Tshuam Xov: Ua LED Zaub thiab Npuag Hluav Taws Xob uas Rolls Up: 7 Cov Kauj Ruam (nrog Duab)
Cov Cuab Yeej Siv Hluav Taws Xob thiab Cov Cuam Tshuam: Ua kom pom LED thiab Cov Khoom Siv Hluav Taws Xob uas Rolls Up: Ua rau koj tus kheej cov ntaub ua hluav taws xob, xov, kua nplaum, thiab kab xev, thiab siv lawv los ua lub zog ntsuas hluav taws xob, tiv thaiv, hloov pauv, LED cov lus qhia thiab siv hluav taws xob. thiab cov xov hluav taws xob koj tuaj yeem ua cov lus qhia LED thiab cov kab hluav taws xob ntawm ib qho ntaub uas hloov pauv tau