2024年1月3日 星期三

ESP32 Grbl Controller

Purpose:
利用在網路上分享的Git連結 Grbl_ESP32 code upload 到自己的ESP32, 來進行將G 代碼從配備 USB 連接埠的電腦傳輸到數控機床(例如3D 列印機或雷射切割機)的步進馬達控制器.

Use the Git link shared on the Internet to upload the Grbl_ESP32 code to your own ESP32 to transfer the G-code from a computer equipped with a USB port to the stepper motor controller of a CNC machine tool (such as a 3D printer or laser cutting machine) .

Circuit:
Y axis set and Z axis set are the same method


#define MACHINE_NAME            "ESP32_V4"

#define X_STEP_PIN              GPIO_NUM_12
#define X_DIRECTION_PIN         GPIO_NUM_14
#define Y_STEP_PIN              GPIO_NUM_26
#define Y_DIRECTION_PIN         GPIO_NUM_15
#define Z_STEP_PIN              GPIO_NUM_27
#define Z_DIRECTION_PIN         GPIO_NUM_33

#define X_LIMIT_PIN             GPIO_NUM_17
#define Y_LIMIT_PIN             GPIO_NUM_4
#define Z_LIMIT_PIN             GPIO_NUM_16


// OK to comment out to use pin for other features
#define STEPPERS_DISABLE_PIN    GPIO_NUM_13

#define SPINDLE_TYPE            SpindleType::PWM
#define SPINDLE_OUTPUT_PIN      GPIO_NUM_2   // labeled SpinPWM
#define SPINDLE_ENABLE_PIN      GPIO_NUM_22  // labeled SpinEnbl

#define COOLANT_MIST_PIN        GPIO_NUM_21  // labeled Mist
#define COOLANT_FLOOD_PIN       GPIO_NUM_25  // labeled Flood
#define PROBE_PIN               GPIO_NUM_32  // labeled Probe


Fundamental:

在之前的文章中Arduino應用之3D印表機改裝成繪圖機是利用 Arduino Mega2560自己去寫控制步進馬達的部分, 最近看網路文章發現有神人把Grbl(Grbl是一款針對Arduino/AVR328晶片的嵌入式G代碼編譯和運動控制器。)放進ESP32裡面, 所以就來試試!! 網路Git連結Grbl_ESP32, 詳細說明如下連結Grbl_Esp32 Wiki介紹得很清楚!!

圖一:運作流程圖
Inkscape
Inkscape is professional quality vector graphics software which runs on Linux, Mac OS X and Windows desktop computers.

Universal Gcode Sender

A free and full featured gcode platform used for interfacing with advanced CNC controllers like GRBL , TinyG, g2core and Smoothieware. Universal Gcode Sender is a self-contained Java application which includes all external dependencies and can be used on most computers running Windows, MacOSX or Linux.
圖二:UGS 操作畫面

Reference the previous article link on blog:
ESP32 control stepper motor
ESP32 3-axis controller
三軸辨識系統-馬達篇


ESP32 Code:
https://github.com/bdring/Grbl_Esp32


YouTube Demo:



沒有留言:

張貼留言