Cov txheej txheem:

Txheeb xyuas Obstacles Asynchronously Nrog Ultrasounds: 4 Cov Kauj Ruam
Txheeb xyuas Obstacles Asynchronously Nrog Ultrasounds: 4 Cov Kauj Ruam

Video: Txheeb xyuas Obstacles Asynchronously Nrog Ultrasounds: 4 Cov Kauj Ruam

Video: Txheeb xyuas Obstacles Asynchronously Nrog Ultrasounds: 4 Cov Kauj Ruam
Video: Linguan Yang, Univ. of Waterloo, Carousel: Low-latency Transaction Processing 2024, Kaum ib hlis
Anonim
Txheeb xyuas Obstacles Asynchronously Nrog Ultrasound
Txheeb xyuas Obstacles Asynchronously Nrog Ultrasound

Kuv tab tom tsim kom muaj kev lom zem neeg hlau uas kuv xav txav mus los hauv ib lub tsev.

Nws yog haujlwm ntev thiab kuv tab tom ua ib qib zuj zus.

Cov lus qhia no tsom mus rau qhov teeb meem pom nrog Arduino Mega

Ultrasonic sensors HC-SR04 vs. Kuv xav kom khiav teeb meem nrhiav kom tau nyob rau hauv txoj kev asynchronous.

_

Kuv twb tau tshaj tawm 3 cov lus qhia qhia txog cov yam ntxwv ntawm tus neeg hlau no:

  • Ua koj lub log log
  • Ua koj li WIFI Rooj vag
  • Siv Inertial Module Unit

Thiab cov ntaub ntawv hais txog kev sib txuas nrog kev txawj ntse txawj ntse thiab cov duab hluav taws xob txhawm rau txheeb xyuas cov neeg hlau.

Kauj Ruam 1: Dab Tsi Yog Qhov Teeb Meem Nrog Ultrasonic Sensors thiab Microcontrollers?

Dab Tsi Yog Qhov Teeb Meem Nrog Ultrasonic Sensors thiab Microcontrollers?
Dab Tsi Yog Qhov Teeb Meem Nrog Ultrasonic Sensors thiab Microcontrollers?
Dab Tsi Yog Qhov Teeb Meem Nrog Ultrasonic Sensors thiab Microcontrollers?
Dab Tsi Yog Qhov Teeb Meem Nrog Ultrasonic Sensors thiab Microcontrollers?

Synchronous tos thiab Arduino cov kev txwv

Microcontrollers code khiav hauv lub voj thiab tsis txhawb nqa ntau txoj xov. Ultrasonic sensors yog raws lub sijhawm teeb liab. Lub sijhawm no ntev txog 30 m s uas ntev heev tos rau hauv lub voj thaum cov microcontrollers yuav tsum tau ua nrog ntau lub cav thiab cov ntsuas (piv txwv li servo thiab DC motors nrog log encoders).

Yog li kuv xav txhim kho cov khoom uas ua haujlwm tsis sib xws.

Kauj Ruam 2: Nws Ua Haujlwm Li Cas?

Nws Ua Haujlwm Li Cas?
Nws Ua Haujlwm Li Cas?

Nws tau tsim los rau Atmega rau kev nrhiav teeb meem. Nws txhawb nqa txog 4 lub ntsuas ultrasonic.

Ua tsaug rau kev ncua sijhawm ib ntus, lub kaw lus tuaj yeem saib xyuas txog 4 lub tshuab ntsuas ultrasonic. Txoj cai tseem ceeb tsuas yog yuav tsum txiav txim siab lub sensor twg kom qhib nrog qhov xwm txheej thiab qhov pib. Qhov tseem ceeb yuav cuam tshuam tsuas yog nyob rau hauv rooj plaub (mob, qhov pib) tshwm sim.

Lub luag haujlwm tseem ceeb yog:

  • Kev ceeb toom yog lub hauv paus teeb meem pom thiab muab kev cuam tshuam yog yam tsawg kawg ntawm 1 ntawm 4 lub ntsuas pom pom qhov deb nyob hauv qab nws qhov pib
  • Saib xyuas yog qhov ua haujlwm txuas ntxiv uas muab kev cuam tshuam ntawm kev sib koom ua ke ntawm qhov xwm txheej nrug deb txog li 4 lub cim. Cov xwm txheej uas tau ua dhau los, hauv qab, sib npaug lossis tsis sib npaug rau qhov pib.

Kauj Ruam 3: Cov Lus Qhia Paub

Siv timer4 yog li tus pin 6 7 8 tsis tuaj yeem siv ua PWM.

Rau txhua qhov ntsuas qhov khoom xav tau tus lej PIN thiab cuam tshuam tus lej PIN.

Nyob rau sab saum toj ntawm cov ntsuas cuam tshuam tus lej PIN cov khoom xav tau lwm tus cuam tshuam tus lej PIN rau kev siv software.

Kauj Ruam 4: Yuav Siv Li Cas?

Yuav Ua Li Cas?
Yuav Ua Li Cas?

Txuas cov sensors raws li saud

Rub tawm los ntawm GitHub qhov chaw cia khoom no

  • EchoObstacleDetection.cpp,
  • EchoObstacleDetection.h
  • Piv txwvEchoObstacleDetection.ino

Tsim EchoObstacleDetection cov npe hauv koj lub tsev qiv ntawv IDE thiab txav mus.cpp thiab.h

Kuaj nws

Qhib Piv TxwvEchoObstacleDetection.ino.

Nov yog qhov yooj yim teeb meem nrhiav pom piv txwv khiav nrog 2 lub ntsuas hluav taws xob ultrasonic.

Cov zis yog qhia ncaj qha ntawm tus saib xyuas. Thaum xub thawj nws yuav luam tawm qhov ntsuas pom los ntawm 2 lub tshuab ntsuas thiab tom qab ntawv ceeb toom nyob ntawm qhov kev ncua deb hauv qab qhov pib.

Pom zoo: