Cov txheej txheem:

Tshawb Pom Tsab Ntawv thiab Ua Kom Rhuav Lub Hom Phiaj! Autonomous DIY Project: 5 Kauj Ruam
Tshawb Pom Tsab Ntawv thiab Ua Kom Rhuav Lub Hom Phiaj! Autonomous DIY Project: 5 Kauj Ruam

Video: Tshawb Pom Tsab Ntawv thiab Ua Kom Rhuav Lub Hom Phiaj! Autonomous DIY Project: 5 Kauj Ruam

Video: Tshawb Pom Tsab Ntawv thiab Ua Kom Rhuav Lub Hom Phiaj! Autonomous DIY Project: 5 Kauj Ruam
Video: Технический разговор TUDev с профессором Борой Озкан - Финтех и будущее финансов 2024, Kaum ib hlis
Anonim
Tshawb Pom Tsab Ntawv thiab Ua Kom Rhuav Lub Hom Phiaj! Autonomous DIY Project
Tshawb Pom Tsab Ntawv thiab Ua Kom Rhuav Lub Hom Phiaj! Autonomous DIY Project

Tshawb Pom Tsab Ntawv thiab Ua Kom Rhuav Lub Hom Phiaj

Hauv cov vis dis aus no kuv qhia koj yuav tsim li cas DIY lub suab taug qab qhov project nrog Raspberry Pi 3. Txoj haujlwm yog tus kheej yog li nws txav mus thiab tua phom thaum nws pom cov lus tsa suab. Kuv siv lub tshuab laser rau txoj haujlwm no, tab sis koj tuaj yeem hloov pauv qhov kev tsim kho no kom siv Nerf hloov pauv.

Txoj haujlwm no tso cai rau koj txheeb xyuas thiab taug qab tus neeg nrog OpenCV thiab tom qab ntawd ua rau lub cuab yeej siv (xws li laser lossis phom).

Kauj Ruam 1: Tutorial Video - Step by Step

Image
Image

Kho vajtse Cheebtsam

Koj tuaj yeem ncav cuag cov cuab yeej siv hauv txoj haujlwm los ntawm qhov txuas hauv qab no:

Raspberry Pi 3 Qauv B+

Raspberry Pi Adapter

Stepper Tsav HAT

Adapter 12V rau Lub Hwjchim HAT

Relay Module

Pi Fan 5V

Pi V2 Lub Koob Yees Duab lossis Lub Koob Yees Duab Webcam PC

Laser Module 5V lossis Nerf Gun

Stepper Pulley

Nplaum

M3 Ntsia Hlau

L Cov Duab Txuas

Ncej Coupling

Tawm Rail Qws

Txoj hlua khi

MDF Ntawv

Txau Xim

Kauj Ruam 2: Daim duab Circuit Court

Nruab Phau Ntawv Qhia - OpenCV thiab Pip
Nruab Phau Ntawv Qhia - OpenCV thiab Pip

Koj tuaj yeem ua tiav koj cov kev sib txuas raws li kab lus saum toj no. GPIO22 tus pin tau siv rau kev tswj hwm txuas ntxiv hauv txoj cai.

RELAY_PIN = 22

Kauj Ruam 3: Teeb Qhia - OpenCV thiab Pip

1. Xyuas kom tseeb tias pip tau teeb tsa

sudo apt-tau nruab python pip

www.pyimagesearch.com/2018/09/19/pip-install-opencv/

2. Nruab OpenCV 3. Ua raws txhua kauj ruam rau nab nab 3 qhia

www.pyimagesearch.com/2016/04/18/install-guide-raspberry-pi-3-raspbian-jessie-opencv-3/

3. Teeb I2C ntawm koj li Raspberry Pi

learn.adafruit.com/adafruits-raspberry-pi-lesson-4-gpio-setup/configuring-i2c

4. Nruab Adafruit stepper motor HAT library

sudo pip nruab git+https://github.com/adafruit/Adafruit-Motor-HAT-Python-Library

5. I2C Chaw Nyob

Yog tias koj siv Raspberry Pi Stepper Motor Expansion Board uas tsis yog Adafruit Stepper Motor HAT (ib yam li hauv daim vis dis aus), tom qab ntawd hloov kho I2C chaw nyob lossis tus lej zaus nrog rau hauv qab no. (Qhov chaw nyob no tsuas yog sib xws nrog lub rooj tsavxwm hauv daim vis dis aus, tus nqi tsis raug yog Adafruit Stepper Motor HAT)

self.mh = Adafruit_MotorHAT ()

rau

self.mh = Adafruit_MotorHAT (0x6F)

hauv qhov chaws (mertracking.py)

rau cov ncauj lus kom ntxaws:

6. Nco ntsoov tsim koj lub chaw virtual nrog tus chij ntxiv

mkvirtualenv cv-system-site-packages -p python3

7. Qhib Terminal thiab Qhib koj lub chaw virtual

siv cv

8. Clone qhov chaw cia khoom no

git clone [email protected]: MertArduino/RaspberryPi-Mertracking.git

9. Mus rau phau ntawv teev npe

cd RaspberryPi-Mertracking

10. Txhim kho kev vam khom rau koj ib puag ncig virtual

pip nruab imutils RPi. GPIO

11. Khiav Txoj Cai

nab hab sej mertracking.py

Kauj Ruam 4: Teeb Parameter

Teem Parameters
Teem Parameters

mertracking.py muaj ob peb yam uas koj tuaj yeem teeb tsa:

MOTOR_X_REVERSED = Cuav

MOTOR_Y_REVERSED = Cuav MAX_STEPS_X = 20 MAX_STEPS_Y = 10 RELAY_PIN = 22

I2C Chaw Nyob lossis Zaus

self.mh = Adafruit_MotorHAT (0x6f)

Ceev ntawm Stepper Motors

tus kheej.sm_x.setSpeed (5)

tus kheej.sm_y.setSpeed (5)

Cov Kauj Ruam/Rev ntawm Stepper Motors

self.sm_x = self.mh.getStepper (200, 1)

self.sm_y = self.mh.getStepper (200, 1)

Ncua Sijhawm rau Kev Tshawb Fawb

sijhawm.sleep (1)

Koj tuaj yeem hloov qib qib nrog cov lus txib hauv qab no

Adafruit_MotorHAT. MICROSTEP

MICROSTEP - TSEEM CEEB - DOUBLE - INTERLEAVE

Kauj ruam 5: Source Code

Qhov Code
Qhov Code

Tau txais Txoj Cai los ntawm GitHub -

Clone qhov chaw cia khoom no:

git clone [email protected]: MertArduino/RaspberryPi-Mertracking.git

Pom zoo: