Cov txheej txheem:

WiBot: 10 Kauj Ruam (nrog Duab)
WiBot: 10 Kauj Ruam (nrog Duab)

Video: WiBot: 10 Kauj Ruam (nrog Duab)

Video: WiBot: 10 Kauj Ruam (nrog Duab)
Video: 10 самых АТМОСФЕРНЫХ мест Дагестана. БОЛЬШОЙ ВЫПУСК #Дагестан #ПутешествиеПоДагестану 2024, Hlis ntuj nqeg
Anonim
WiBot
WiBot

Cov lus qhia no qhia ntxaws txog txheej txheem tsim lub Wi-Fi neeg hlau ntawm ZYBO platform. Txoj haujlwm no siv lub sijhawm ua haujlwm tiag tiag rau kev txheeb xyuas qhov khoom, ntsuas nrug deb, thiab tswj kev teb. Phau ntawv qhia no yuav hais txog kev cuam tshuam nrog ZYBO nrog cov khoom siv ib sab, khiav kev cai firmware, thiab sib txuas lus ntawm Java daim ntawv thov. Cov hauv qab no yog cov npe ntawm txhua qhov tseem ceeb xav tau rau txoj haujlwm no:

  • 1 ZYBO Development Board
  • 1 TL-WR802N Wireless Router
  • 1 Duab Ntxoo Chassis
  • 2 65mm Log
  • 2 140 rpm Gearmotors
  • 2 Log Encoders
  • 1 HC-SR04 Ultrasonic Sensor
  • 1 BSS138 Logic Level Converter
  • 1 L293 H-Choj Tsav Tsav Tsheb
  • 1 12V rau 5V DC/DC Converter
  • 1 2200mAh LiPo Roj teeb
  • 1 Ethernet Cable
  • 1 USB Micro-B Cable
  • 1 Poj niam XT60 Connector
  • 2 Txiv neej-rau-Poj Niam Jumper Xov
  • 30 Txiv neej-rau-Txiv Neej Jumper Xov
  • 2 10kΩ Resistors
  • 1 Cov qhob cij

Ib qho ntxiv, cov software hauv qab no yuav tsum tau teeb tsa ntawm lub khoos phis tawj lub hom phiaj:

  • Xilinx Vivado Design Suite 2018.2
  • Digilent Adept 2.19.2
  • FreeRTOS 10.1.1
  • Java SE Kev Txhim Kho Khoom Siv 8.191

Kauj Ruam 1: Sib Sau Cov Neeg Hlau Chassis

Sib dhos Neeg Hlau Chassis
Sib dhos Neeg Hlau Chassis
Sib dhos Neeg Hlau Chassis
Sib dhos Neeg Hlau Chassis
Sib dhos Neeg Hlau Chassis
Sib dhos Neeg Hlau Chassis

Sib sau ua ke cov duab ntxoov ntxoo thiab muab cov iav tsom iav thiab tus lej nkag mus rau hauv qab. ZYBO, daim ntawv qhia zaub mov, thiab lub ntsuas hluav taws xob ultrasonic tuaj yeem teeb tsa nrog cov khoom siv uas tuaj yeem luam tawm 3D thiab tsau rau lub chassis siv kev kaw thiab ob daim kab xev. hauv qab ntas. Mount lub router ze rau ZYBO thiab DC/DC hloov pauv ze rau ntawm lub khob cij. Txuas lub log rau lub tshuab hluav taws xob kawg.

Kauj Ruam 2: Hlau Hluav Taws Xob

Hlau Electronics
Hlau Electronics
Hlau Electronics
Hlau Electronics
Hlau Electronics
Hlau Electronics

Txuas cov tswv yim thiab tso tawm ntawm DC/DC hloov pauv mus rau ob lub zog ntsia ntawm lub khob cij. Cov no yuav ua haujlwm li 12V thiab 5V cov khoom siv rau lub kaw lus. Txuas ZYBO mus rau 5V txoj kev tsheb ciav hlau raws li qhia hauv daim duab. Siv USB Micro-B muab xov txuas rau lub router rau 5V kev tsheb nqaj hlau ib yam. XT60 cable yuav tsum txuas rau 12V tsheb nqaj hlau. Tsis txhob ntsaws lub roj teeb kom txog thaum cov khoom siv hluav taws xob tau txuas kom raug. Lub ntsuas hluav taws xob ultrasonic yuav tsum tau txuas rau 5V txoj kev tsheb nqaj hlau. Tsim kom muaj 3.3V txoj kev tsheb nqaj hlau siv tus pin 6 ntawm Pmod chaw nres nkoj JC ntawm ZYBO. Qhov siab qhov hluav taws xob nkag ntawm lub cav hloov pauv yuav tsum tau txuas rau 5V kev tsheb nqaj hlau thaum qhov hluav taws xob qis ntawm lub logic hloov pauv yuav tsum tau txuas mus rau 3.3V kev tsheb nqaj hlau. Xaim lub tshuab ntsuas hluav taws xob mus rau 3.3V kev tsheb nqaj hlau. Txuas VCC1 ntawm tus tsav tsheb mus rau 5V kev tsheb nqaj hlau thiab txuas VCC2 rau 12V tsheb nqaj hlau. Tie tag nrho EN pins rau 5V thiab hauv av tag nrho GND pins.

Txuas TRIG thiab ECHO pins ntawm lub ntsuas hluav taws xob ultrasonic mus rau HV1 thiab HV2 ntawm lub logic hloov pauv feem. LV1 yuav tsum tau txuas rau JC4 thiab LV2 yuav tsum tau txuas rau JC3. Xa mus rau kab ntawv rau Pmod pinouts. Txuas cov motors rau tus tsav tsheb. Y1 yuav tsum txuas nrog lub davhlau ya nyob twg zoo ntawm lub cev muaj zog thiab Y2 yuav tsum txuas nrog lub davhlau ya nyob twg tsis zoo ntawm txoj cai lub cev. Ib yam li ntawd, Y3 yuav tsum txuas nrog lub davhlau ya nyob twg zoo ntawm lub tshuab laug thiab Y4 yuav tsum txuas nrog lub davhlau ya nyob twg tsis zoo ntawm lub tshuab laug. A1, A2, A3, thiab A4 yuav tsum tau kos rau JB2, JB1, JB4, thiab JB3 feem. Xa mus rau schematic rau tus lej tus lej. Hlau JC2 rau sab xis encoder thiab JC1 rau sab laug encoder. Xyuas kom rub tawm cov neeg tawm tsam tau siv los khi cov cim no rau 3.3V kev tsheb nqaj hlau. Thaum kawg, siv ethernet cable txuas ZYBO rau lub router.

Kauj Ruam 3: Tsim Block Diagram hauv Vivado

Tsim Thaiv Duab Duab hauv Vivado
Tsim Thaiv Duab Duab hauv Vivado

Tsim txoj haujlwm RTL tshiab hauv Vivado. Nco ntsoov tsis qhia meej txog cov peev txheej ntawm lub sijhawm no. Tshawb nrhiav "xc7z010clg400-1" thiab ntaus kom tiav. Rub tawm encoder_driver.sv thiab ultrasonic_driver.sv. Muab lawv tso rau hauv lawv tus kheej cov ntawv. Qhib IP Packager hauv qab "Cov Cuab Yeej" thiab xaiv kom ntim cov npe teev tseg. Muab tshuaj txhuam txoj hauv kev rau daim nplaub tshev uas muaj tus tsav tsheb nkag thiab ntaus "Tom ntej". Nyem "pob IP" thiab rov ua cov txheej txheem rau tus neeg tsav tsheb ultrasonic sensor. Tom qab ntawv, mus rau tus thawj tswj chaw cia khoom hauv qab ntu IP hauv cov ntawv qhia zaub mov. Ntxiv txoj hauv kev rau cov ntawv tsav tsheb thiab ntaus thov kom suav nrog lawv hauv IP tsev qiv ntawv.

Tsim daim duab thaiv tshiab thiab ntxiv "ZYNQ7 Txheej Txheem Txheej Txheem". Nyem ob npaug rau qhov thaiv thiab ntshuam ZYBO_zynq_def.xml cov ntaub ntawv muab. Hauv qab "MIO Configuration", qhib Timer 0 thiab GPIO MIO. ntaus "OK" kom txuag lub teeb tsa. Ntxiv 3 "AXI GPIO" blocks thiab 4 "AXI Timer" blocks. Khiav block automation ua raws los ntawm kev sib txuas automation rau S_AXI. Ob npaug nias rau GPIO thaiv kom teeb tsa lawv. Ib qho thaiv yuav tsum yog ob channel nrog 4-ntsis nkag thiab 4-ntsis tso zis. Ua cov kev sib txuas sab nraud thiab sau lawv SW rau cov tswv yim thiab LED rau cov zis. Qhov thaiv thib ob kuj yuav tsum yog ob channel nrog 2 32-ntsis cov tswv yim. Qhov kawg GPIO thaiv yuav yog ib qho 32-ntsis nkag. Ua tus pwm0 tso tawm los ntawm txhua lub sijhawm thaiv sab nraud. Label them PWM0, PWM1, PWM2, and PWM3.

Ntxiv tus tsav tsheb nkag mus rau daim duab thaiv thiab txuas CLK rau FCLK_CLK0. Txuas OD0 thiab OD1 mus rau qhov nkag nkag ntawm qhov thib ob GPIO thaiv. Ua ENC sab nraud thiab hloov npe ENC_0 rau ENC. Ntxiv cov ntsuas ultrasonic ntsuas thiab txuas CLK rau FCLK_CLK0. Ua TRIG thiab ECHO sab nraud thiab hloov npe TRIG_0 rau TRIG thiab ECHO_0 rau ECHO. Txuas RF mus rau qhov thib peb GPIO thaiv. Xa mus rau daim duab qhia chaw uas muab rau siv.

Txoj cai nyem rau ntawm koj daim duab kab ntawv thaiv hauv Cov Chaw pane thiab tsim HDL qhwv. Nco ntsoov tso cai rau cov neeg siv kho. Ntxiv qhov muab ZYBO_Master.xdc cov ntaub ntawv raws li kev txwv. Ntaus "Tsim Bitstream" thiab so kas fes.

Kauj Ruam 4: Teeb Software Txhim Kho Ib puag ncig

Mus hauv qab "Cov Ntaub Ntawv" xa cov khoom kho vajtse mus rau Vivado SDK. Nco ntsoov suav nrog cov bitstream. Ntshuam RTOSDemo txoj haujlwm sab hauv "CORTEX_A9_Zynq_ZC702". Nws yuav nyob hauv FreeRTOS installation cov npe. Tsim lub Rooj Tswjhwm Saib Xyuas Kev Pabcuam tshiab xaiv lub tsev qiv ntawv lwip202. Hloov qhov hais txog BSP hauv RTOSDemo txoj haujlwm rau BSP koj nyuam qhuav tsim*.

*Thaum lub sijhawm sau Cov Lus Qhia no, FreeRTOS zoo li muaj kab laum nrog hais txog qhov tseeb BSP. Txhawm rau kho qhov no, tsim BSP tshiab nrog rau cov teeb tsa zoo ib yam li thawj zaug. Hloov pauv BSP hais txog mus rau qhov tshiab thiab tom qab ntawd hloov nws rov mus rau qhov qub tom qab nws ua tsis tiav. FreeRTOS yuav tsum tam sim no suav sau yam tsis muaj qhov yuam kev. Xav tias dawb los tshem tawm qhov tsis siv BSP.

Kauj Ruam 5: Hloov kho qhov Demo Program

Tsim daim nplaub tshev tshiab hu ua "tsav tsheb" hauv qab "src" cov npe ntawm RTOSDemo. Luam qhov muab gpio.h. gpio.c, pwm.h, pwm.c, odometer.h, odometer.c, rangefinder.c, rangefinder.h, motor.h, thiab motor.c cov ntaub ntawv rau hauv cov npe "tsav tsheb".

Qhib main.c thiab teeb tsa mainSELECTED_APPLICATION rau 2. Hloov main_lwIP.c hauv qab "lwIP_Demo" nrog hloov kho tshiab. BasicSocketCommandServer.c hauv qab "lwIP_Demo/apps/BasicSocketCommandServer" kuj yuav tsum tau hloov kho nrog tus tshiab. Thaum kawg, txav mus rau "FreeRTOSv10.1.1/FreeRTOS-Plus/Demo/Common/FreeRTOS_Plus_CLI_Demos" thiab hloov Sample-CLI-commands.c nrog cov muab. Tsim txoj haujlwm thiab ua kom txhua yam ua ke ua tiav.

Kauj Ruam 6: Nyem Firmware rau QSPI

Flash Firmware rau QSPI
Flash Firmware rau QSPI
Flash Firmware rau QSPI
Flash Firmware rau QSPI
Flash Firmware rau QSPI
Flash Firmware rau QSPI

Tsim ib Daim Ntawv Thov Tshiab hu ua "FSBL" siv "Zynq FSBL" tus qauv. Tom qab suav cov phiaj xwm FSBL, tsim cov duab khau raj ntawm RTOSDemo project. Nco ntsoov "FSBL/Debug/FSBL.elf" raug xaiv ua tus bootloader hauv qab "Boot image partitions". Ua tus kheej ntxiv txoj hauv kev rau cov ntawv no yog tias nws tsis muaj npe.

Tsiv lub JP5 jumper ntawm ZYBO mus rau "JTAG". Siv USB Micro-B cable txuas koj lub computer rau ZYBO. Txuas lub roj teeb thiab qhib ZYBO. Khiav Adept kom paub tseeb tias ZYBO raug txheeb xyuas los ntawm lub khoos phis tawj. Nyem "Program Flash" hauv Vivado SDK thiab muab txoj hauv kev rau BOOT.bin cov ntaub ntawv hauv RTOSDemo thiab FSBL.elf cov ntaub ntawv hauv FSBL. Nco ntsoov xaiv "Txheeb xyuas tom qab nyem" ua ntej tsoo "Program". Saib lub console kom ntseeg tau tias kev ua haujlwm flashing ua tiav. Tom qab ntawd, fais fab ZYBO tawm thiab txuas lub USB cable. Tsiv lub JP5 jumper mus rau "QSPI".

Kauj Ruam 7: Txhim Kho Wireless Access Point

Nrog lub roj teeb tseem txuas nrog, txuas rau lub router Wi-nkaus network. Lub hauv paus SSID thiab tus password yuav tsum nyob hauv qab ntawm tus router. Tom qab ntawv, mus rau https://tplinkwifi.net thiab nkag mus siv "admin" rau lub npe siv thiab tus password. Khiav tus txheej txheem teeb tsa sai los teeb tsa lub router hauv hom kev nkag nrog DHCP qhib. Nco ntsoov hloov kho lub npe siv tsis raug thiab tus password rau lub cuab yeej ib yam. Lub router yuav tsum rov pib dua rau hauv hom kev nkag mus tom qab koj ua tiav.

Fais fab ntawm ZYBO thiab txuas rau lub router siv SSID uas koj tau txais. Lub router yuav zoo li tuaj ntawm IP chaw nyob 192.168.0.100 lossis 192.160.0.101. ZYBO yuav raug xaiv qhov twg los xij qhov chaw nyob tsis muaj tus router. Txhawm rau txiav txim siab tus IP chaw nyob ntawm tus router sai, koj tuaj yeem khiav "ipconfig" los ntawm kev hais kom ua sai sai hauv windows lossis "ifconfig" los ntawm lub davhlau ya nyob twg hauv Linux lossis MacOS. Yog tias koj tseem txuas nrog lub router, koj yuav pom nws tus IP chaw nyob tom ntej ntawm koj lub wireless txuas. Siv cov ntaub ntawv no los txiav txim tus IP chaw nyob ntawm ZYBO. Txhawm rau lees paub tus IP chaw nyob ntawm ZYBO, koj tuaj yeem ping nws los ntawm kab hais kom ua lossis txuas rau nws ntawm telnet.

Kauj ruam 8: Khiav Java Program

Khiav Java Program
Khiav Java Program

Rub tawm RobotClient.java thiab suav cov ntaub ntawv siv qhov hais kom ua "javac RobotClient.java" los ntawm kab hais kom ua. Khiav cov lus txib "java RobotClient" qhov twg "ip_address" yog IP chaw nyob ntawm ZYBO. Kev tswj GUI yuav tshwm tuaj yog tias kev sib txuas tau ua tiav tau tsim los ntawm lub khoos phis tawj thiab ZYBO. Tom qab tsom mus rau lub qhov rais, tus neeg hlau yuav tsum tswj tau siv cov xub tuav ntawm cov keyboard. Nias lub khawm khiav kom xaus qhov kev sib tham thiab txiav tawm ntawm tus neeg hlau.

GUI yuav hais txog cov yuam sij uas tau nias thiab qhia lub cev muaj zog tso rau sab xis saum toj. Qhov ntsuas nrug deb ntawm sab laug sau ib kab txhua txhua 2 meters mus txog qhov siab tshaj 10 meters.

Kauj Ruam 9: Calibrate Rangefinder

Cov hloov pauv ntawm lub nkoj ZYBO tuaj yeem siv los teeb tsa lub onboard rangefinder. Qhov tsawg kawg nrhiav kom tau nrug d yog muab ua lub luag haujlwm ntawm kev hloov pauv kuv:

d = 50i + 250

Cov tswv yim tuaj yeem sib txawv ntawm 0 txog 15 hauv cov kauj ruam ua ke. Qhov no txhais mus rau qhov nrug deb ntawm 0.25 meters txog 1 meter. Ntawm qhov tsawg kawg nrug, thawj LED yuav pib ntsais muag. Cov naj npawb ntawm LEDs uas nquag siv yog sib piv rau qhov sib thooj ntawm cov khoom.

Kauj ruam 10: Kev nkag tau yooj yim

Tus neeg hlau no nkag tau yooj yim heev. Vim yog qhov yooj yim ntawm nws txoj kev tswj hwm, nws tuaj yeem tswj tau nrog ib tus ntiv tes nkaus xwb. Txhawm rau txhim kho kev nkag tau yooj yim, kev txhawb nqa rau cov khoom siv ntxiv tuaj yeem muab ntxiv. Qhov no tuaj yeem tso cai rau cov neeg xiam oob khab siv los tswj cov neeg hlau nrog qhov sib txawv ntawm lawv lub cev.

Pom zoo: