Cov txheej txheem:

Tej thaj chaw deb CNC Nres thiab Saib Xyuas: 11 Cov Kauj Ruam (nrog Duab)
Tej thaj chaw deb CNC Nres thiab Saib Xyuas: 11 Cov Kauj Ruam (nrog Duab)

Video: Tej thaj chaw deb CNC Nres thiab Saib Xyuas: 11 Cov Kauj Ruam (nrog Duab)

Video: Tej thaj chaw deb CNC Nres thiab Saib Xyuas: 11 Cov Kauj Ruam (nrog Duab)
Video: Yuav ua li cas thiaj khiav dim lub ntiajteb no 2024, Hlis ntuj nqeg
Anonim
Tej thaj chaw deb CNC Nres thiab Saib Xyuas
Tej thaj chaw deb CNC Nres thiab Saib Xyuas
Tej thaj chaw deb CNC Nres thiab Saib Xyuas
Tej thaj chaw deb CNC Nres thiab Saib Xyuas
Tej thaj chaw deb CNC Nres thiab Saib Xyuas
Tej thaj chaw deb CNC Nres thiab Saib Xyuas

Txoj haujlwm no muab txoj hauv kev pheej yig ntawm kev ua haujlwm STOP (ALT+S) mus rau Mach3. Qhov no ua tiav nrog Raspberry Pi (RPi) + Lub koob yees duab txuas nrog lub PC ntawm USB cable. Kev saib xyuas thiab qhib kev Nres ntawm CNC tau ua tiav nrog daim vis dis aus web daim ntawv thov khiav ntawm RPi. Kev siv cov tshuaj no yuav tsum ua tiav ntawm koj tus kheej txoj kev pheej hmoo. Kuv pom zoo kom hu rau lub chaw tsim khoom ntawm koj lub CNC, thiab yuav thiab teeb tsa qhov kev pom zoo thaum muaj xwm ceev nres nres tshwj xeeb.

Faj seeb: Qhov no tsis zoo ib yam li Qhov Kev Ceev Xwm Ceev (EStop) txuas rau hauv koj lub CNC tswj vaj huam sib luag, tab sis kev ua tiav ntawm cov hotkey los ua STOP ntawm Mach3.

Kauj Ruam 1: Qhov Chaw

Qhov
Qhov
  1. Raspberry Pi Zero W.
  2. Raspberry Pi Zero 1.3 Lub Koob Yees Duab Cable
  3. Raspberry Pi Lub Koob Yees Duab (Nco tseg: USB Webcams tsis txhawb)
  4. Case rau Raspberry Pi thiab Lub Koob Yees Duab
  5. micro SD daim npav 16 GB
  6. USB cable

Kauj Ruam 2: Sib sau Lub Koob Yees Duab thiab Txhim Kho Raspbian

Sib dhos Lub Koob Yees Duab thiab Txhim Kho Raspbian
Sib dhos Lub Koob Yees Duab thiab Txhim Kho Raspbian
Sib dhos Lub Koob Yees Duab thiab Txhim Kho Raspbian
Sib dhos Lub Koob Yees Duab thiab Txhim Kho Raspbian
Sib dhos Lub Koob Yees Duab thiab Txhim Kho Raspbian
Sib dhos Lub Koob Yees Duab thiab Txhim Kho Raspbian
Sib dhos Lub Koob Yees Duab thiab Txhim Kho Raspbian
Sib dhos Lub Koob Yees Duab thiab Txhim Kho Raspbian

Sib sau RPi Lub Koob Yees Duab, cable thiab RPi ua ke raws li cov lus qhia pom ntawm Yuav ua li cas txuas Raspberry Pi lub koob yees duab module rau Raspberry Pi Zero W thiab cov ntaub ntawv raug cai. Nco tseg: USB Webcams tsis txhawb nqa.

Nruab qhov hloov tshiab ntawm Raspbian ntawm Raspberry Pi Zero W. Kuv pom zoo ua raws cov lus qhia ib qib zuj zus tuaj yeem pom ntawm Adafruit's Raspberry Pi Zero Headless Quick Start.

Ua qhov txuas SSH rau RPi, raws li tau hais hauv cov lus qhia saum toj no, thiab pib ua ib qho kev teeb tsa dav dav los ntawm kev ua haujlwm pabcuam raspi-teeb tsa.

sudo raspi-teeb tsa

Kauj Ruam 3: Pab Koob Yees Duab

Pab Koob Yees Duab
Pab Koob Yees Duab
Pab Koob Yees Duab
Pab Koob Yees Duab
Pab Koob Yees Duab
Pab Koob Yees Duab
Pab Koob Yees Duab
Pab Koob Yees Duab

Hauv raspi -teeb tsa lub qhov rai tseem ceeb xaiv tus lej 5. Kev sib cuam tshuam kev xaiv - teeb tsa kev sib txuas rau cov khoom siv sab nraud. Hauv lub qhov rai tom ntej, xaiv P1. Lub Koob Yees Duab - Pab/Disable txuas rau Raspberry Pi Lub Koob Yees Duab. Lub qhov rai tom ntej no yuav nug Koj puas xav kom lub koob yees duab interface qhib? Xaiv thiab ntaus Enter. Lub vijtsam kawg yuav qhia tias lub koob yees duab interface tau qhib, thiab nias Enter rau. Qhov no yuav rov qab koj mus rau lub qhov rai tseem ceeb ntawm raspi-teeb tsa.

Kauj Ruam 4: Nthuav Tawm Cov Ntaub Ntawv

Nthuav Filesystem
Nthuav Filesystem
Nthuav Filesystem
Nthuav Filesystem
Nthuav Filesystem
Nthuav Filesystem

Hauv raspi -teeb tsa lub qhov rai loj xaiv tus lej 7. Advanced Options - Configure advanced settings. Hauv lub qhov rai tom ntej, xaiv A1. Nthuav Cov Ntaub Ntawv - Ua kom ntseeg tau tias txhua daim npav SD tau siv. Tom qab xaiv cov khoom no lub qhov rai yuav tshwm uas qhia tias faib hauv paus tau raug hloov pauv. Cov filesystem yuav nthuav dav thaum rov pib dua tom ntej. Ntaus tus yuam sij nkag mus xaiv. Qhov no yuav rov qab koj lub qhov rais raspi-teeb tsa lub ntsiab.

Kauj ruam 5: Boot Options

Kev xaiv khau raj
Kev xaiv khau raj
Kev xaiv khau raj
Kev xaiv khau raj
Kev xaiv khau raj
Kev xaiv khau raj

Hauv raspi-teeb tsa lub qhov rai loj xaiv tus lej 3. Boot Options-Kho cov kev xaiv rau kev pib. Hauv qhov screen tom ntej, xaiv B1. Desktop / CLI - Xaiv seb puas yuav khau raj rau hauv lub desktop ib puag ncig. Qhov no yuav coj koj mus rau lub qhov rai kawg, thiab xaiv B1. Console - Text console, xav kom tus neeg siv nkag mus. Xaiv qhov no yuav coj koj rov qab mus rau raspi-teeb tsa lub qhov rai loj.

Koj tuaj yeem tawm ntawm raspi-teeb tsa los ntawm kev xaiv, uas tej zaum yuav xav tau rov pib dua. Ua kom rov pib dua, thiab SSH rov qab rau hauv RPi.

Kauj Ruam 6: Kho RPi Rau Hauv USB Keyboard (HID)

Kho RPi Rau Hauv USB Keyboard (HID)
Kho RPi Rau Hauv USB Keyboard (HID)

STOP yog tsim los ntawm kev xa tus lej ALT+s ntawm tus RPi mus rau PC khiav Mach3. Raws li qhov tshwm sim, RPi xav tau teeb tsa kom pom thiab ua haujlwm li USB Keyboard rau lub PC. Qhov no tso cai rau nws xa cov lus txib hotkeys xws li ALT+s rau PC. Cov lus qhia rau teeb tsa RPi muaj nyob ntawm Turn Raspberry Pi Zero rau hauv USB Keyboard (HID).

Tom qab rov pib dua, sau cov lus txib hauv qab no:

ls -l /dev /zais*

Koj yuav tsum pom lub cuab yeej /dev /hidg0 tshwm nyob rau hauv cov npe raws li pom saum toj no. Cov pab pawg nkag thiab nyeem thiab sau nkag mus rau lub cuab yeej no yuav raug hloov pauv hauv cov kauj ruam ua raws.

Kauj Ruam 7: Nruab RPi-Cam-Web-Interface

Nruab RPi-Cam-Web-Interface
Nruab RPi-Cam-Web-Interface
Nruab RPi-Cam-Web-Interface
Nruab RPi-Cam-Web-Interface

Txhim kho cov vis dis aus thiab web server software raws li cov lus qhia ntawm RPi-Cam-Web-Interface.

Thaum lub sijhawm teeb tsa koj yuav raug nug cov Kev Xaiv Cov Txheej Txheem hauv qab no:

  • Cam subfolder: html
  • Autostart: (yog/tsis yog) yog
  • Neeg rau zaub mov: (apache/nginx/lighttpd) apache
  • Webport: 80 NPE
  • Tus neeg siv: (blank = nologin) admin (piv txwv)
  • Lo lus zais: #34By97Zz (piv txwv)
  • jpglink: (yog/tsis) tsis yog
  • phpversion: (5/7) 7

Kuv tau xaiv lub tswv yim pib ua kom yooj yim rau kev teeb tsa, tab sis ntxiv Tus Neeg Siv thiab Password kom ruaj ntseg RPi Web Page. Xaiv thiab txuas ntxiv nrog kev teeb tsa. Thaum kawg koj yuav raug nug kom Pib Lub Koob Yees Duab System Tam sim no xaiv thiab txuas ntxiv mus. Yog tias ua tiav, koj yuav raug coj mus rau qhov hais kom sai.

Txuas rau RPi lub vev xaib

Kauj Ruam 8: Muab Www-cov ntaub ntawv nkag mus rau ntaus ntawv /dev /hidg0

Muab Www-cov ntaub ntawv nkag mus rau ntaus ntawv /dev /hidg0
Muab Www-cov ntaub ntawv nkag mus rau ntaus ntawv /dev /hidg0

Tam sim no tias txhua daim ntawv thov thiab kho vajtse tau teeb tsa qhov kawg tweaks tuaj yeem ua kom tiav qhov kev teeb tsa. Lub hom phiaj hauv theem no yog txhawm rau muab cov neeg siv www-cov ntaub ntawv nkag mus rau USB Keyboard ntaus ntawv /dev /hidg0.

Ua ntej, tsim ib pab pawg hu ua zais thiab ntxiv www-data rau pawg:

sudo addgroup zais

sudo adduser www-cov ntaub ntawv zais

Tom ntej no, qhib /etc/rc.local nrog cov lus txib no (dua):

sudo nano /etc/rc.local

Ntxiv cov hauv qab no ua ntej kab uas muaj tawm 0, tab sis hauv qab kab koj ntxiv hauv Configure RPi Into USB Keyboard (HID) Kauj Ruam:

sudo chown hauv paus: nkaum /dev /hidg0sudo chmod 660 /dev /hidg0

Cov lus txib saum toj no yuav muab kev nkag mus rau lub cuab yeej /dev /hidg0 rau cov neeg siv www-data. Tom qab cov kev hloov kho saum toj no tau ua thiab rov pib dua koj pom lub /dev /hidg0 ntaus ntawv nrog cov lus txib hauv qab no:

ls -l /dev /zais*

Ceeb toom pab pawg rau cov cuab yeej no tam sim no tau nkaum thiab pab pawg tau nyeem thiab sau ntawv nkag.

======================================

Tsis teb los tau: Yog tias koj xav siv cov ntawv sau uas nkag mus rau GPIO, I2C thiab/lossis SPI ntawm RPi Lub Vev Xaib, koj yuav xav tau los ua kom muaj kev cuam tshuam no hauv raspi-teeb tsa. Qhov thib ob, koj yuav tsum tau muab cov neeg siv www-cov ntaub ntawv nkag mus rau cov cuam tshuam no.

sudo usermod -a -G gpio, i2c, spi www -data

Kauj ruam 9: Kho lub Web Interface

Kho qhov Web Interface
Kho qhov Web Interface

Hloov cov ntaub ntawv userbuttons.txt pom hauv qab no rau koj li RPi tsev qhia chaw '/home/pi/'.

Los ntawm koj cov npe hauv tsev, theej userbuttons.txt to folder '/var/www/html/':

cd ~ sudo cp userbuttons.txt/var/www/html/userbutton

Hloov cov tswv cuab thiab kev tso cai rau cov neeg siv khawm:

sudo chown www-data: www-data/var/www/html/userbutton

Tsim cov ntawv stop_cnc.sh plhaub:

sudo nano /var/www/html/macros/stop_cnc.sh

Luam thiab muab cov ntawv hauv qab no rau hauv cov ntawv no:

#!/bin/bashfunction write_report {ncho -ne $ 1>/dev/hidg0}# CTRL = x10 SHIFT = x20 ALT = x40# ALT + swrite_report "\ x40 / 0 / x16 / 0 / 0 / 0 / 0 / 0" # Nullwrite_report "\ 0 / 0 / 0 / 0 / 0 / 0 / 0 / 0" #echo "STOP CNC" >> /var/www/html/macros/testmacro.txt

Tom qab txuag /var/www/html/macros/stop_cnc.sh, muab cov kev tso cai tsim nyog rau cov ntawv nrog cov lus txib no:

sudo chown www-data: www-data /var/www/html/macros/stop_cnc.shsudo chmod 764 /var/www/html/macros/stop_cnc.sh

====================================== Yeem: Yog tias koj xav kom muaj cov nyees khawm rau CYCLE START thiab FEED HOLD, koj tuaj yeem ntxiv cov nyees khawm hauv qab no rau/var/www/html/userbuttons:

sudo nano/var/www/html/userbuttons

Nrhiav thiab tshem tawm # los ntawm cov kab hauv qab no hauv cov ntaub ntawv userbuttons:

#FEED HOLD, feed_hold.sh, btn btn-ceeb toom btn-lg, style = "dav: 50%"#CYCLE START, cycle_start.sh, btn btn-vam meej btn-lg, style = "dav: 50%"

Tsim lub voj voog_start.sh plhaub tsab ntawv:

sudo nano /var/www/html/macros/cycle_start.sh

Luam thiab muab cov ntawv hauv qab no rau hauv cov ntawv no:

#!/bin/bashfunction write_report {ncho -ne $ 1>/dev/hidg0}# CTRL = x10 SHIFT = x20 ALT = x40# ALT + r - CYCLE STARTwrite_report "\ x40 / 0 / x15 / 0 / 0 / 0 / 0 / 0 / 0 "# Nullwrite_report" / 0 / 0 / 0 / 0 / 0 / 0 / 0 / 0 "#echo" CYCLE START ">> /var/www/html/macros/cycle_start.txt

Tsim cov ntawv feed_hold.sh plhaub:

sudo nano /var/www/html/macros/feed_hold.sh

Luam thiab muab cov ntawv hauv qab no rau hauv cov ntawv no:

#!/bin/bashfunction write_report {ncho -ne $ 1>/dev/hidg0} # CTRL = x10 SHIFT = x20 ALT = x40 # SPACE - FEED HOLD write_report "\ 0 / 0 / x2c / 0 / 0 / 0 / 0 / 0 / 0 " # Null write_report" / 0 / 0 / 0 / 0 / 0 / 0 / 0 / 0 "#echo" FEED HOLD ">> /var/www/html/macros/feed_hold.txt

Hloov cov tswv cuab thiab kev tso cai ntawm cov ntawv sau plhaub:

sudo chown www-data: www-data /var/www/html/macros/cycle_start.shsudo chown www-data: www-data /var/www/html/macros/feed_hold.shsudo chmod 764/var/www/html/ macros/cycle_start.shsudo chmod 764 /var/www/html/macros/feed_hold.sh

Kauj Ruam 10: Kho lub Vev Xaib Zoo Li Cas

Customize Web Appearance
Customize Web Appearance
Customize Web Appearance
Customize Web Appearance

Ua ntej rau cov kauj ruam dhau los, Lub Vev Xaib tau tshwm sim zoo li 'Ua ntej' duab qhia saum toj no. Tom qab cov kev hloov kho hauv STOP khawm yuav tshwm. Qee qhov kev pom zoo hloov pauv hauv Lub Koob Yees Duab Chaw:

  • Kev daws teeb meem: Saib Max 972p 4: 3
  • Annotation (max 127 characters): Text: CNC Cam%Y.%M.%D_%h:%m:%s
  • Saib ua ntej zoo (1… 100) Default 10: 50Width (128… 1024) Default 512: 1024Divider (1-16) Default 1: 1

Lub npe bar lub npe thiab lub npe 'RPi Cam Control v6.4.34: mycam@raspberrypi' tuaj yeem hloov kho los ntawm kev hloov kho /var/www/html/config.php cov ntaub ntawv.

sudo nano /var/www/html/config.php

Hloov kho 'RPi Cam Control' yog tias koj xav hloov Lub Npe Lub Npe:

// lub npe ntawm daim ntawv thov no txhais ('APP_NAME', 'RPi Cam Control');

Hauv ntu 'System' teeb tsa koj tuaj yeem hloov Cov Qauv rau Hmo Ntuj thiab nyem OK kom tig lub keeb kwm yav dhau dub.

Kauj Ruam 11: Xeem thiab Siv

Xeem thiab Siv
Xeem thiab Siv
Xeem thiab Siv
Xeem thiab Siv

Txuas lub USB cable rau USB chaw nres nkoj ntawm RPi (tsis yog PWR USB), thiab txuas rau lwm qhov kawg rau lub PC uas ua haujlwm Mach3. Cov kab no yuav ua rau lub zog RPi ntxiv rau tswj Mach3 ntawm lub PC. Yog li, TSIS TXHOB txuas lub zog hluav taws xob sab nraud rau PWR USB ntawm RPi. Qhov no yuav ua rau PC lossis RPi puas tsuaj.

ua kom pom tseeb - Lub qhov rais uas tam sim no muaj cov keyboard ua kom pom tseeb. Txhua qhov yuam kev los ntawm cov keyboard yuav tshwm sim hauv lub qhov rai no.

Raws li tau hais ua ntej, RPi's USB xa ALT+s hotkey rau USB ntawm lub PC txuas. Txhawm rau ntsuas qhov teeb tsa (tsis muaj Mach3), qhib daim ntawv thov (tshwj xeeb tshaj yog cov ntawv sau) uas muaj Ntawv Qhia Ntawv xaiv uas pib nrog S, raws li pom saum toj no hauv Notepad ++ daim ntawv thov. Daim ntawv ceeb toom tias S tau sau tseg hauv Cov Ntawv Qhia zaub mov qhia tias ALT+s keystroke yuav qhib cov ntawv qhia zaub mov. Koj tuaj yeem sim nws nrog cov keyboard PCs txhawm rau ntsuas cov txiaj ntsig. Raws li nyob rau hauv qhov piv txwv saum toj no, Tshawb nrhiav zaub mov tau tshwm sim. Koj cov txiaj ntsig yuav txawv, nyob ntawm daim ntawv thov uas koj qhib nrog Cov Ntawv Qhia uas muaj kev xaiv nrog S. Teeb lub hom phiaj ntawm tib daim ntawv thov ua ntej, thiab nkag mus rau Web daim ntawv thov RPi los ntawm lwm lub cuab yeej. Koj tseem tuaj yeem siv lub xov tooj ntse nkag mus rau RPi. Nyem rau STOP khawm ntawm Lub Vev Xaib, thiab Cov Ntawv Qhia Zoo ib yam yuav tsum poob qis ib yam li ua ntej.

Yog tias koj qhov kev xeem ua tiav, koj npaj tau siv qhov no nrog Mach3. Kuv siv Mach3 2010 Screenset, thiab nws ua haujlwm tau zoo.

Nco ntsoov tias Mach3 yog tsom mus rau PCs cov keyboard nkag. Kov lub npe kab ntawm Mach3 txaus txaus los ua pov thawj qhov no yog qhov xwm txheej. Mach3 yuav tsum yog daim ntawv thov nkaus xwb uas khiav ntawm Desktop ntawm PC.

Siv txoj hauv kev no yuav tsum ua tiav ntawm koj tus kheej txoj kev pheej hmoo.

Pom zoo: