Cov txheej txheem:

PID Kab Follower Atmega328P: 4 Kauj Ruam
PID Kab Follower Atmega328P: 4 Kauj Ruam

Video: PID Kab Follower Atmega328P: 4 Kauj Ruam

Video: PID Kab Follower Atmega328P: 4 Kauj Ruam
Video: DIY Radar With Ultrasonic Sensor And Chat-GPT Generated Arduino Code | Coders Cafe 2024, Hlis ntuj nqeg
Anonim
Image
Image

QHIA

Cov lus qhia no yog hais txog kev ua kom muaj txiaj ntsig thiab ntseeg tau Kab Follower nrog PID (qhov sib piv-ib feem-sib piv) Kev Tswj (Lej) ua haujlwm sab hauv nws lub hlwb (Atmega328P).

Cov kab hauv qab yog tus neeg hlau tsis siv neeg uas ua raws kab dub hauv dawb yog lossis kab dawb hauv thaj chaw dub. Neeg hlau yuav tsum muaj peev xwm txheeb xyuas kab tshwj xeeb thiab ua raws nws.

Yog li yuav muaj ob peb ntu/qib los ua LINE FOLLOWER Kuv yuav tham txog txhua tus ntawm lawv ib qib zuj zus.

  1. Sensor (Qhov muag kom pom kab)
  2. Microcontroller (Lub hlwb ua qee qhov kev suav)
  3. Tsav Tsheb (Lub Hwj Huam Muaj Zog)
  4. Tsav Tsheb
  5. Chassis
  6. Roj teeb (Lub Zog Zog)
  7. Log
  8. Lwm yam

Nov yog VIDEO KAWM NTAWV QHOV TSEEB LINE LIAB

Hauv cov kauj ruam tom ntej Kuv yuav tham hauv cov ncauj lus kom ntxaws txog txhua qhov kev sib tham

Kauj Ruam 1: Sensor (Qhov Muag) QTR 8RC

Sensor (Qhov Muag) QTR 8RC
Sensor (Qhov Muag) QTR 8RC
Sensor (Qhov Muag) QTR 8RC
Sensor (Qhov Muag) QTR 8RC
Sensor (Qhov Muag) QTR 8RC
Sensor (Qhov Muag) QTR 8RC

Ua tsaug rau Pololu rau kev tsim lub ntsej muag txaus.

Tus qauv yog tus thauj khoom yooj yim rau yim IR emitter thiab tus txais (phototransistor) khub sib npaug sib nrug ntawm qhov sib nrug ntawm 0.375 (9.525 mm). Txhawm rau siv lub ntsuas, koj yuav tsum xub them tus nqi tso tawm (Them lub capacitor) los ntawm kev siv qhov hluav taws xob rau Koj tuaj yeem nyeem qhov kev xav rov qab los ntawm kev rho tawm sab nrauv muab qhov hluav taws xob thiab sijhawm ntev npaum li cas nws yuav siv qhov hluav taws xob tso tawm mus rau qhov lwj vim qhov sib xyaw phototransistor. tshwj xeeb tshaj yog thaum ua ke nrog lub peev xwm ntawm QTR-8RC module kom tua hluav taws xob LED:

  • Tsis xav tau analog-rau-digital converter (ADC).
  • Txhim kho qhov rhiab heev tshaj qhov hluav taws xob-faib cov analog analog tso tawm.
  • Parallel nyeem ntawv ntawm ntau yam sensors tau nrog feem ntau microcontrollers.
  • Parallel nyeem ntawv pom zoo siv LED zog pab xaiv

Kev qhia tshwj xeeb

  • Qhov ntev: 2.95 "x 0.5" x 0.125 "(tsis muaj tus pin header ntsia)
  • Kev siv hluav taws xob: 3.3-5.0 V
  • Muab khoom tam sim no: 100 mA
  • Hom ntawv tso tawm: 8 digital I/O-tshaj tawm cov cim uas tuaj yeem nyeem tau raws li lub sijhawm ua haujlwm siab
  • Kev pom kev pom kev deb: 0.125 "(3 hli) Qhov siab tshaj plaws pom kev deb: 0.375" (9.5 hli)
  • Qhov hnyav yam tsis muaj lub hau taub hau: 0.11 oz (3.09 g)

Sib cuam tshuam QTR-8RC Cov Khoom Siv rau Digital I/O Kab

QTR-8RC tus qauv muaj yim qhov ntsuas qhov ntsuas zoo ib yam uas, zoo li Parallax QTI, xav tau cov kab I/O digital uas muaj peev xwm tsav cov kab hluav taws xob siab thiab tom qab ntsuas lub sijhawm rau qhov hluav taws xob tso tawm kom lwj. Cov xwm txheej ib txwm siv rau kev nyeem lub sensor yog:

  1. Qhib IR LEDs (xaiv tau).
  2. Teem kab I/O rau qhov tso tawm thiab tsav nws siab.
  3. Tso cai tsawg kawg 10 μs rau lub ntsuas qhov ntsuas kom nce.
  4. Ua rau kab I/O cov tswv yim (siab impedance).
  5. Ntsuas lub sijhawm kom qhov hluav taws xob tawg los ntawm kev tos rau kab I/O kom qis.
  6. Tua IR LEDs (xaiv tau).

Cov kauj ruam no feem ntau tuaj yeem ua tiav ua ke ntawm ntau kab I/O.

Nrog kev xav zoo, lub sij hawm lwj tuaj yeem qis li ob peb lub kaum os microseconds; tsis muaj kev xav rov qab, lub sij hawm lwj tuaj yeem mus txog ob peb milliseconds. Lub sijhawm tseeb ntawm kev lwj yog nyob ntawm koj tus microcontroller's I/O kab yam ntxwv. Cov txiaj ntsig muaj txiaj ntsig tuaj yeem muaj nyob hauv 1 ms hauv cov xwm txheej ib txwm muaj (piv txwv li thaum tsis tau sim ntsuas qhov sib txawv me ntsis hauv qhov xwm txheej xav tau qis), tso cai txog li 1 kHz piv txwv ntawm txhua 8 lub ntsuas. Yog tias kev ntsuas qis dua yog txaus, kev txuag hluav taws xob ntau tuaj yeem paub los ntawm kev tua cov LEDs. Piv txwv li, yog tias 100 Hz kev ntsuas tus lej tuaj yeem siv tau, LEDs tuaj yeem tawm 90% ntawm lub sijhawm, txo qhov nruab nrab kev siv tam sim no los ntawm 100 mA txog 10 mA.

Kauj Ruam 2: Microcontroller (Lub Hlwb) Atmega328P

Microcontroller (Lub Hlwb) Atmega328P
Microcontroller (Lub Hlwb) Atmega328P
Microcontroller (Lub Hlwb) Atmega328P
Microcontroller (Lub Hlwb) Atmega328P

Ua tsaug rau Atmel CorporationFor Manufacturing no Awesome Microcontroller AKA Atmega328.

Cov ntsiab lus tseem ceeb rau ATmega328P

Parameter Tus Nqi

  • Flash (Kbytes): 32 Kbytes
  • Tus lej Pin: 32
  • Max. Kev khiav hauj lwm Freq. (MHz): 20 MHz
  • CPU: 8-ntsis AVR
  • Max I/O Pins: 23
  • Kev cuam tshuam ntau: 24
  • PIB: 2
  • TWI (I2C): 1
  • UAS: 1
  • ADC raws: 8
  • ADC Kev daws teeb meem (khoom): 10
  • SRAM (Kbytes): 2
  • EEPROM (Bytes): 1024
  • I/O Supply Class: 1.8 txog 5.5
  • Kev Siv Hluav Taws Xob (Vcc): 1.8 txog 5.5
  • Sijhawm: 3

Rau Cov Lus Qhia Kom Txaus Mus dhau ntawm Datasheet ntawm Atmega328P.

Hauv qhov haujlwm no kuv siv Atmega328P rau Qhov Tseeb Tseeb

  1. Pheej yig
  2. Muaj RAM txaus rau kev suav
  3. Txaus I/O Pins rau Txoj Haujlwm no
  4. Atmega328P tau siv Hauv Arduino…. Koj tuaj yeem pom hauv Daim Duab thiab Yees Duab Arduino Uno tab sis tsaus ntuj Kuv tab tom siv Arduino IDE lossis Ib qho Arduino.. Kuv tau Siv Tsuas yog kho vajtse ua pawg tswj hwm kev cuam tshuam. Kuv tau lwv lub bootloader thiab siv USB ASP rau Programming lub nti.

Rau Kev Sau Ntawv Chip Kuv tau siv Atmel Studio 6

Txhua ZOO TSHAJ PLAWS YOG IN GitHub Rub Tawm Nws thiab Tshawb xyuas cov ntaub ntawv test.c.

Txhawm rau Sau cov pob no koj yuav tsum rub tawm thiab teeb tsa Lub POLOLU AVR LIBRARY SETUP Txheeb Xyuas Cov Txuas Ntxiv …

Kuv tseem tab tom rub tawm Atmega328P Pawg Neeg Saib Xyuas Kev Txhim Kho Txhim Kho thiab Cov Ntaub Ntawv … koj tuaj yeem tsim nws los ntawm koj tus kheej …

Kauj Ruam 3: Tsav Tsheb thiab Tsav Tsheb

Tsav Tsheb thiab Tsav Tsheb
Tsav Tsheb thiab Tsav Tsheb
Tsav Tsheb thiab Tsav Tsheb
Tsav Tsheb thiab Tsav Tsheb
Tsav Tsheb thiab Tsav Tsheb
Tsav Tsheb thiab Tsav Tsheb

Kuv tau Siv 350RPM 12V BO Hom Geared DC lub cev muaj zog ua tus tsav. Kom paub ntau ntxiv … MOTOR LINK

Raws li tus tsav tsheb kuv tau siv L293D H- choj IC.

Kuv tab tom txuas Schematic thiab Board File rau tib yam.

Kauj Ruam 4: Chassis thiab Lwm Yam

Chassis thiab Lwm Yam
Chassis thiab Lwm Yam
Chassis thiab Lwm Yam
Chassis thiab Lwm Yam
Chassis thiab Lwm Yam
Chassis thiab Lwm Yam

Lub Bot yog ua los ntawm Ply Ntoo Ntawm 6mm Thickness.

Pom zoo: