Cov txheej txheem:

Raspberry Pi, Python, thiab TB6600 Stepper Motor Driver: 9 Kauj Ruam
Raspberry Pi, Python, thiab TB6600 Stepper Motor Driver: 9 Kauj Ruam

Video: Raspberry Pi, Python, thiab TB6600 Stepper Motor Driver: 9 Kauj Ruam

Video: Raspberry Pi, Python, thiab TB6600 Stepper Motor Driver: 9 Kauj Ruam
Video: Creating a Python Virtual Environment! 2024, Kaum ib hlis
Anonim
Raspberry Pi, Python, thiab TB6600 Stepper Motor Driver
Raspberry Pi, Python, thiab TB6600 Stepper Motor Driver

Cov Lus Qhia no ua raws cov kauj ruam kuv coj mus txuas rau Raspberry Pi 3b rau TB6600 Stepper Motor Controller, 24 VDC Fais Fab Khoom, thiab 6 hlau Stepper lub cev muaj zog.

Kuv tej zaum zoo li ntau ntawm koj thiab tshwm sim muaj "lub hnab ntim khoom" ntawm cov khoom seem ntawm ntau qhov haujlwm qub.. Hauv kuv qhov kev sau kuv muaj 6 hlau stepper lub cev muaj zog, thiab txiav txim siab tias nws yog lub sijhawm los kawm me ntsis ntau ntxiv txog yuav ua li cas kuv tuaj yeem cuam tshuam qhov no rau Raspberry Pi qauv 3B.

Raws li qhov tsis lees paub me ntsis, Kuv tsis tau tsim lub log ntawm no, Kuv tsuas yog rub ua ke ib pawg ntawm cov ntaub ntawv npaj tau muaj nyob hauv Web, ntxiv kuv qhov me ntsis rau nws, thiab sim ua kom nws ua haujlwm.

Lub hom phiaj ntawm no yog tiag tiag txhawm rau rub ob peb yam ua ke (ntawm tus nqi qis), sau qee qhov sej code rau kuv Raspberry Pi, thiab ua kom lub cev muaj zog tig. Nov yog qhov kuv tswj kom ua tiav.

Yog li cia peb pib…

Kauj Ruam 1: Raspberry Pi

Raspberry Pi
Raspberry Pi

Raws li rau Raspberry Pi, Kuv siv peb tus qauv GPIO pins yog li qhov no yuav tsum ua haujlwm (Kuv tsis tau sim) nrog ib qho Pi, lossis pawg thawj coj txiv kab ntxwv, Tinker board lossis clones uas muaj nyob rau ntawd. Koj tuaj yeem (thiab yuav tsum tau) zuag kuv cov lus hais ntau dhau Python code thiab xaiv GPIO tus lej sib txawv yog tias koj siv tus txheej txheem sib txawv, lossis tsuas yog xav hloov pauv ib puag ncig me ntsis.

Thov nco ntsoov tias kuv tau txuas ncaj qha rau GPIO pins ntawm RPi, yog li kuv txwv qhov hluav taws xob uas GPIO pins pom rau 3.3volts.

Kauj Ruam 2: TB6600 Stepper Motor Driver / Controller

TB6600 Stepper Tsav Tsav / Tswj
TB6600 Stepper Tsav Tsav / Tswj

Raws li kuv tau sau tseg yav dhau los, Kuv tau xaiv siv TB6600 Stepper Motor Driver / Controller.

Tus maub los no yog:

  • Npaj tau yooj yim (tshawb nrhiav eBay, Amazon, Ali Express lossis ntau lwm tus).
  • Kev teeb tsa tau yooj yim nrog kev nkag tau yooj yim.
  • Kev teeb tsa thiab cov ntsiab lus ntawm cov xov hlau yog tshuaj xyuas ntawm rooj plaub.
  • Cov tswv yim hluav taws xob ntau ntawm 9 VDC txog 40 VDC
  • Muaj peev xwm txog 4 amp tsav lub zog tsav.
  • Muaj lub kiv cua txias sab hauv thiab lub dab dej kub zoo.
  • Yog nruab nrog 3 qhov txuas txuas tshem tau.
  • Muaj tus hneev taw me me,
  • Yooj yim rau mount.

Tab sis tus nqi qis rau kev yuav yog tiag tiag dab tsi kaw qhov kev pom zoo ntawm qhov no.

Kauj Ruam 3: Stepper Motor…

Stepper Tsav…
Stepper Tsav…

Stepper lub cev muaj zog kuv siv yog qhov me me ntawm qhov tsis paub.. Kuv tau muaj nws ntau xyoo, thiab tsis nco qab keeb kwm ntawm qhov kuv tau txais nws lossis qhov nws tau siv yav dhau los yog dab tsi.

Hauv Cov Lus Qhia no Kuv yuav tsis piav qhia yuav ua li cas thiaj paub nws lub peev xwm - Kuv tsis muaj lub neej tiag tiag siv rau nws (uas tsis yog kev sim) yog li kuv yuav hla qhov ntawd.

Kuv siv lub dav dav dav dav dav dav. Kuv tau siv sijhawm me ntsis hauv YouTube thiab ntawm no ntawm Cov Lus Qhia los sim thiab txiav txim siab cov xov hlau los ntawm nws.

Kuv lub cev muaj 6 lub xov hlau rau nws … Hauv daim ntawv thov no, kuv tau tso ob lub "Center Tap" xov hlau thaiv thiab tsis txuas nrog.

Yog tias koj muaj qhov zoo sib xws "hom" hom stepper motor, Kuv paub tseeb tias nrog Ohm Meter thiab lub sijhawm me ntsis koj kuj tuaj yeem txiav txim siab qhov thaiv thiab ua kom nws ua haujlwm zoo li no. Muaj ntau ntau cov yeeb yaj kiab YouTube uas yuav coj koj mus yooj yim txheeb koj tus kheej lub cev.

Kauj Ruam 4: Cov Khoom Siv Hluav Taws Xob thiab Cov Hluav Taws Xob

Cov Khoom Siv Hluav Taws Xob thiab Cov Hluav Taws Xob
Cov Khoom Siv Hluav Taws Xob thiab Cov Hluav Taws Xob

Ceev faj yuav tsum tau muab ntawm no…

Nyob ntawm koj qhov kev tsim, koj yuav xav tau txuas rau Kab Voltages (lub zog hauv tsev). Nco ntsoov siv txhua qhov kev tiv thaiv kev nyab xeeb uas tsim nyog:

  • TSIS TXHOB sim txuas hluav taws xob kom muaj zog nyob.
  • TSIS siv cov fuses loj tsim nyog thiab cov khoom siv hluav taws xob
  • TSIS siv lub hwj chim hloov pauv rau koj lub PSU (qhov no yuav ua rau nws yooj yim cais cov khoom siv hluav taws xob los ntawm cov kab hluav taws xob nyob).
  • Ua kom tiav tag nrho cov xov hlau thiab ua kom muaj kev sib txuas zoo. Tsis txhob siv cov clip, lossis cov xov tsis sib txuas, lossis cov khoom sib txuas tsis zoo.
  • TSIS TXHOB siv Hluav Taws Xob Daim Kab Xev ua cov rwb thaiv tsev

Kuv siv 24 VDC (5 Amp) Lub hwj chim muab rau lub zog Stepper Tsav Tsav Tsheb Tswj. Kuv kuj tseem siv cov khoom siv hluav taws xob zoo ib yam no los tsav DC rau DC Buck PSU txhawm rau txhawm rau tsim 3.3 volts los siv ua lub hauv paus rau ENA, PUL thiab DIR cov cim (saib cov kab hluav taws xob daim duab)

TSIS TXHOB sim siv RPi kom ntws tam sim no los ntawm 5.0 VDC qhov chaw.

Kuv tsis pom zoo kom sim muab cov " +" ob sab ntawm PUL, DIR thiab ENA teeb liab nrog 3.3 VDC los ntawm RPI.

Kauj Ruam 5: Kev Tiv Thaiv Circuit …

Nco ntsoov tias hauv daim duab kab hluav taws xob uas ua raws hauv qab no, Kuv tsis hais txog yuav ua li cas txuas lub zog hluav taws xob mus rau "AC Fais Fab", lossis teev cov hluav taws xob hluav taws xob rau nws. Yog tias koj mob siab rau tsim kev sim ua haujlwm zoo ib yam li qhov no, koj yuav tsum tau siv sijhawm los txheeb xyuas Circuit Breaker thiab Fuse uas yuav phim cov khoom siv hluav taws xob (ies) uas koj yuav siv. Feem ntau cov khoom siv hluav taws xob niaj hnub no muaj qhov hluav taws xob thiab cov yam ntxwv tshwj xeeb uas tau teev tseg hauv lawv. Cov no yuav tsum tau ua raws, thiab tsim nyog tiv thaiv kev tiv thaiv Circuit Court.

Thov … Tsis txhob hla cov kauj ruam tseem ceeb no.

Kauj Ruam 6: Daim Kab Xev

Daim Kab Xev
Daim Kab Xev

Cov Khoom Siv Hluav Taws Xob

Qhov tso tawm ntawm 24 VDC lub hwj chim muab fuse nrog 5 Amp fuse thiab tom qab ntawd xa mus rau:

  • TB6600 Stepper Motor Driver / Controller "VCC" tus pin (RED xaim hauv daim duab).
  • Nws kuj tseem raug xa mus rau 3.3 VDC "DC rau DC Converter" (dua ib txoj kab liab hauv daim duab).

Qhov tso tawm ntawm 3.3 VDC "DC rau DC Converter" raug xa mus rau tus pin "2", "4" thiab "6" ntawm TB6600 Stepper Motor Driver / Controller (BLUE xaim hauv daim duab).

NCO TSEG - tus tswj nws tus kheej cim cov pins no "5V".. Nws yuav ua haujlwm yog tias 5V tau muab rau cov pins, tab sis vim tias qhov ntsuas hluav taws xob ntawm GPIO pins ntawm RPI, Kuv tau xaiv txwv qhov Voltage rau 3.3 VDC.

NCO TSEG - Kuv tsis pom zoo kom muab cov " +" sab ntawm PUL, DIR thiab ENA teeb liab nrog 3.3 VDC los ntawm RPI.

GPIO Kav Xwm

GPIO Mapping GPIO 17 PUL PINK xaim hauv daim duab GPIO27 DIR ORANGE xaim hauv daim duab GPIO22 ENA GREEN xaim hauv daim duab

Kauj ruam 7: Kev ua haujlwm

Kev ua haujlwm
Kev ua haujlwm

Yeej, Raspberry Pi kho vajtse tswj peb lub cim:

GPIO Mapping GPIO 17 PUL GPIO27 DIR GPIO22 ENA

GPIO22 - ENA - Pab lossis lov tes taw kev ua haujlwm ntawm Stepper Motor Driver / Controller.

Thaum LOW, tus maub los yog DISABLED. Qhov no txhais tau tias yog txoj kab no HIGH lossis TSIS txuas nrog, tom qab ntawd TB6600 tau pib ua haujlwm, thiab yog tias siv cov cim qhia tau zoo, lub tshuab yuav tig.

GPIO27 - DIR - Teem lub cav kiv cua.

Thaum HIGH lossis Tsis Txuas, lub cav yuav tig rau hauv ib qho kev taw qhia. Hauv hom no, yog tias lub cav tsis tig rau hauv txoj kev koj xav tau, koj tuaj yeem sib pauv ob lub cav A txuas nrog ib leeg, lossis ob lub B lub cav txuas nrog ib leeg. Ua qhov no ntawm cov txuas ntsuab ntawm TB6600.

Thaum tus pin no LOW, TB6600 yuav hloov lub transistors sab hauv, thiab lub cav kev taw qhia yuav hloov.

GPIO10 - PUL - Pulses los ntawm RPI uas qhia rau TB6600 Stepper Tsav Tsheb / Tus Tswj Xyuas nrawm npaum li cas.

Thov xa mus rau cov duab txuas rau kev teeb tsa Stepper Motor Driver / Controller hloov txoj haujlwm uas kuv tau siv.

Kauj Ruam 8: Python Code

Txuas nrog yog kuv cov lus tshaj tawm cov cai.

Xav tias dawb siv thiab kho qhov no raws li koj xav tau.. Kuv pom qee qhov ntawm nws hauv lub vev xaib, thiab ntxiv nws rau kev sim thiab ntsuas lub hom phiaj.

== == ==

Kauj ruam 9: Synopsis

Nws ua haujlwm.. muaj ntau chav rau kev txhim kho, thiab cov cai tuaj yeem ua kom huv, tab sis OK.

Kuv zoo siab tau hnov koj cov lus qhia tswv yim thiab ntawm ib qho kev hloov pauv / hloov tshiab uas koj ua.

Ua tsaug.

Pom zoo: