Contact me: hankecnc@gmail.com

串行通信仅在测试驱动中 #416

推推 grbl 3年前 (2023-01-30) 223次浏览
关闭
wayneosdias 打开了这个问题 2020 年 5 月 31 日 · 6条评论
关闭

串行通信仅在测试驱动中#416

wayneosdias 打开了这个问题 2020 年 5 月 31 日 · 6条评论

注释

串行通信仅在测试驱动中 #416

我在让串行通信工作时遇到问题,因为机器定义了 test_drive.h 以外的任何内容。当测试驱动 tx rx 工作时使用一般的 GRBL 命令。在机器文件夹和 ESP32 中使用 Machines/3axis_v4.h 或任何其他变体,仅在硬重置时发送板属性。该模块似乎不接收命令。我对 Arduino IDE 没有经验,也不太关心它。

有人可以帮我滚吗。在使用一对用于控制继电器的低频 gpio 进行 4 轴设置后,开关频率并不重要。有人可以共享工作机器文件吗?

串行通信仅在测试驱动中 #416
所有者

我们没有信息可以帮助我们调试此问题。请在回复中粘贴您的启动文本。
https://github.com/bdring/Grbl_Esp32/wiki/FAQ#submitting-bug-information

您将 ESP32 连接到什么硬件?您正在使用的机器定义文件需要连接特定的硬件,否则浮动开关输入可能会锁定 ESP32。

串行通信仅在测试驱动中 #416

嗨,巴特,
抱歉,我使用的是原版 Espressif 板“ESP32_Core_board_V2”,并在 ESP-WROVER-KIT V3 板上复制了这个问题。回复底部附加的启动文本

我取得了一些进展,并且在修改后的 3axis_v4.h 文件上有完整的 TX RX 工作。我首先注释掉所有内容,重新编译并依次取消注释每一行。我得到了所有 step/dir gpio 未注释的完整 TX RX。通信正常,但我还没有检查 gpio 硬件。最终应用是带有 Clearpath 伺服系统的 CNC 路由器。

我将继续讨论未注释的 ifdef,但首先我想尝试弄清楚如何使用 Arduino IDE。现在我正在使用 Visual Studio 修改 Arduino 文件,但无法单步执行,它花费的时间太长,而且很难通过……

硬重置启动文本;
ets 2016 年 6 月 8 日 00:22:57

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
ets 2016 年 6 月 8 日 00:22:57

rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip:0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
时钟模式:DIO 1
load:0x3fff0018,len:4
load:0x3fff001c,len:1216
ho 0 tail 12 room 4
load:0x40078000,len:9720
ho 0 tail 12 room 4
load:0x40080400,len:6352
entry 0x400806b8

[MSG:Grbl_ESP32 Ver 1.2a Date 20200514]
[MSG:Compiled with ESP32 SDK:v3.2.3-14-gd3e562907]
[MSG:Using machine:ESP32_V4]
[MSG:Axis count 3]
[MSG:RMT Steps]
[MSG:警告:主轴输出引脚未定义]

[MSG:Local access point GRBL_ESP started, 192.168.0.1]
[MSG:Captive Portal Started]
[MSG:HTTP Started]
[MSG:TELNET Started 23]

Grbl 1.2a [‘$’寻求帮助]

串行通信仅在测试驱动中 #416
所有者

你没有回答我的问题,但看起来你没有将 ESP32 连接到 CNC 控制器板上。

在您进行更改以使其更好地工作之后,您似乎已经向我显示了启动文本。那对我没有帮助。

除非连接了电阻器,否则不要将引脚 34-39 用于任何用途。https://github.com/bdring/Grbl_Esp32/wiki/Setting-Up-the-IO-Pins#input-only-no-pulluppulldown

串行通信仅在测试驱动中 #416

嘿 Bart,没有硬件、cnc 控制器分线或以其他方式连接到 ESP32,它只是一个通过 USB 电缆连接到 PC 的 ESP32_Core_board_V2。

RX 的 Heres 引导文本不起作用(“#include “Machines/3axis_v4.h”,没有对 $$ 的响应):
ets 2016 年 6 月 8 日 00:22:57

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
ets 2016 年 6 月 8 日 00:22:57

rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip:0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
时钟模式:DIO 1
load:0x3fff0018,len:4
load:0x3fff001c,len:1216
ho 0 tail 12 room 4
load:0x40078000,len:9720
ho 0 tail 12 room 4
load:0x40080400,len:6352
entry 0x400806b8

[MSG:Grbl_ESP32 Ver 1.2a Date 20200514]
[MSG:Compiled with ESP32 SDK:v3.2.3-14-gd3e562907]
[MSG:Using machine:ESP32_V4]
[MSG:Axis count 3]
[MSG:RMT Steps]
[MSG: PWM主轴输出:2,Enbl:22,Dir:-1,Freq:5000Hz,Res:13bits]

[MSG:Local access point GRBL_ESP started, 192.168.0.1]
[MSG:Captive Portal Started]
[MSG:HTTP Started]
[MSG:TELNET Started 23]

Grbl 1.2a [‘$’寻求帮助]
[MSG:Check door]

这是 TX RX 工作的启动文本(ifdefs 注释掉和对 $$ 的响应):
ets Jun 8 2016 00:22:57

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
ets 2016 年 6 月 8 日 00:22:57

rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip:0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
时钟模式:DIO 1
load:0x3fff0018,len:4
load:0x3fff001c,len:1216
ho 0 tail 12 room 4
load:0x40078000,len:9720
ho 0 tail 12 room 4
load:0x40080400,len:6352
entry 0x400806b8

[MSG:Grbl_ESP32 Ver 1.2a Date 20200514]
[MSG:Compiled with ESP32 SDK:v3.2.3-14-gd3e562907]
[MSG:Using machine:ESP32_V4]
[MSG:Axis count 3]
[MSG:RMT Steps]
[MSG:警告:主轴输出引脚未定义]

[MSG:Local access point GRBL_ESP started, 192.168.0.1]
[MSG:Captive Portal Started]
[MSG:HTTP Started]
[MSG:TELNET Started 23]

Grbl 1.2a [‘$’寻求帮助]
$0=3
$1=250
$2=0
$3=0
$4=0
$5=1
$6=0
$10=1
$11=0.010
$12=0.002
$13=0
$20=0
$21=0
$22 =0
$23=3
$24=200.000
$25=2000.000
$26=250
$27=1.000
$30=1000.000
$31=0.000
$32=0
$100=100.000
$101=100.000
$102=100.000
$110=1000.000
$111=1000.000
$112=1000.000
$120=200.000
$121=200.000
$122=200.000
$130=300.000
$131=300.000
$132=300.000
好的
好的

这是有效的实际 machine.h 文件:
`/*
3axis_v4.h Grbl_ESP32
的一部分

Pin assignments for the ESP32 Development Controller, v4.1 and later.
https://github.com/bdring/Grbl_ESP32_Development_Controller
https://www.tindie.com/products/33366583/grbl_esp32-cnc-development-board-v35/

2018    - Bart Dring
2020    - Mitch Bradley

Grbl_ESP32 is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

Grbl is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with Grbl_ESP32.  If not, see <http://www.gnu.org/licenses/>.

*/

#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 LIMIT_MASK B111
#define X_LIMIT_PIN GPIO_NUM_17
#define Y_LIMIT_PIN GPIO_NUM_4
#define Z_LIMIT_PIN GPIO_NUM_16
/*
#ifdef HOMING_CYCLE_0
#undef HOMING_CYCLE_0
#endif
#define HOMING_CYCLE_0 (1<<Z_AXIS) // Z 优先

#ifdef HOMING_CYCLE_1
#undef HOMING_CYCLE_1
#endif
#define HOMING_CYCLE_1 ((1<<X_AXIS)|(1<<Y_AXIS))

#ifdef HOMING_CYCLE_2
#undef HOMING_CYCLE_2
#endif

// 可以注释掉以将 pin 用于其他功能
#define STEPPERS_DISABLE_PIN GPIO_NUM_13

#define SPINDLE_TYPE SPINDLE_TYPE_PWM
#define SPINDLE_OUTPUT_PIN GPIO_NUM_2 // 标记为 SpinPWM
#define SPINDLE_ENABLE_PIN GPIO_NUM_22 // 标记为 SpinEnbl

#define MIST_PIN GPIO_NUM_21 // 标记为 Mist
#define FLOOD_PIN GPIO_NUM_25 // 标记为 Flood
#define PROBE_PIN GPIO_NUM_32 // 标记为 Probe

#define CONTROL_SAFETY_DOOR_PIN GPIO_NUM_35 // 标记为 Door,需要外部上拉
#define CONTROL_RESET_PIN GPIO_NUM_34 // 标记为 Reset,需要外部上拉
#define CONTROL_FEED_HOLD_PIN GPIO_NUM_36 // 标记为 Hold,需要外部上拉
#define CONTROL_CYCLE_START_PIN GPIO_NUM_39 // 标记为 Start,需要外部上拉
*/
`

串行通信仅在测试驱动中 #416
所有者

谢谢…当我们得到信息时很容易修复。

如果没有带上拉电阻的附加硬件,则不能使用引脚 34-39。一个浮动的 I/O 引脚告诉 Grbl 你的门是开着的。

注释掉所有这些引脚。

#define CONTROL_SAFETY_DOOR_PIN GPIO_NUM_35 // labeled Door, needs external pullup
#define CONTROL_RESET_PIN GPIO_NUM_34 // labeled Reset, needs external pullup
#define CONTROL_FEED_HOLD_PIN GPIO_NUM_36 // labeled Hold, needs external pullup
#define CONTROL_CYCLE_START_PIN GPIO_NUM_39 // labeled Start, needs external pullup

请考虑向该项目捐款。

串行通信仅在测试驱动中 #416
作者
韦尼奥斯迪亚斯 评论了 2020 年 6 月 1 日  

现在工作 :) 完美,谢谢。也感谢你在 psoc grbl 端口上所做的工作 :) 你想让我捐赠还是你更愿意我在 Tindie 上购买你的产品?