bdring / Grbl_Esp32

A port of Grbl CNC Firmware for ESP32
GNU General Public License v3.0
1.7k stars 531 forks source link

Assert fail error while job is running. #343

Open povi2946 opened 4 years ago

povi2946 commented 4 years ago

It kept crashing while doing jobs from SD card so I just used UGS to send gcode via USB.

For most simple jobs it does ok, but it always crashes on raster jobs. Gcode is generated by LaserWeb4.

G1X98.82Y127.20S255.00F750 Skipping blank line #723 Skipping comment-only line: (Pass 0 Path 177) ok G0X98.74Y127.40 /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/queue.c:1446 (xQueueGenericReceive)- assert failed! abort() was called at PC 0x4009138f on core 1 Backtrace: 0x40095054:0x3ffbe880 0x40095285:0x3ffbe8a0 0x4009138f:0x3ffbe8c0 0x400f907b:0x3ffbe900 0x400e0361:0x3ffbe920 0x400e047d:0x3ffbe940 0x4008147d:0x3ffbe960 0x40087685:0x3ffbe980 0x4008301d:0x3ffba170 0x40089ed6:0x3ffba190 0x40085a7f:0x3ffba1b0 0x400916c1:0x3ffba1d0 Rebooting... [MSG:TMCStepper Init using Library Ver 0x000601] [MSG:X Trinamic driver test passed]`

bdring commented 4 years ago

Please provide all of the startup messages, plus your $$ settings and attach the gcode file. I want to repeat your setup and try the code.

povi2946 commented 4 years ago

Thanks, I am using Pen Plotter TMC2130 v1. I will be able to attach settings and g-code only on Monday.

Adding config and cpu_map . maybe they would help too. config_and_cpu_map.zip

povi2946 commented 4 years ago

gcode_and_startup.zip

Here attaching my startup output which includes all $$ settings. and Gcode that I was running. Also another piece of output when I received the error.

Thank you

bdring commented 4 years ago

I checked out what you sent. I noticed you are not using the latest code.

A commit 27 days ago added a message that shows the what SDK version of the ESP32 core was used. See my messages below.

You are also using laser mode which has very heavy use of the PWM channel. That was recently optimized.

I loaded your settings and ran the code. The only difference was my controller version. That should have no impact. I was able to run the complete job from both UGS (steaming) and via the WebUI (SD card) and both ran fine. I ran it twice from each place.

I suggest you update to the latest master. also see this note issue about the core version

[MSG:Compiled with ESP32 SDK:v3.2.3-14-gd3e562907] [MSG:Using cpu_map:ESP32_TMC2130_PEN V2] [MSG:TMCStepper Init using Library Ver 0x000602] failed.[MSG:X Trinamic driver test failed] [MSG:X Trinamic driver test check motor power] failed.[MSG:Y Trinamic driver test failed] [MSG:Y Trinamic driver test check motor power] [MSG:Axis count 3] [MSG:RMT Steps] [MSG:Client Started] [MSG:Connecting Barts-WLAN] [MSG:Connecting.] [MSG:Connecting..] [MSG:Connecting...] [MSG:Connected with 192.168.1.12] [MSG:Start mDNS with hostname:http://grblesp.local/] [MSG:SSDP Started] [MSG:HTTP Started] [MSG:TELNET Started 23] Grbl 1.1f ['$' for help]

povi2946 commented 4 years ago

I pulled the newest, but I still get the error. I wasn't running Gcode via USB. I started the the job from webUI but I had serial connected for debugging. This time it was in different half way through it just stopped moving Y axis it was only X. I downloaded some jpegs from laserweb to etch for calibration purposes all those files and rasters went fine.. It moves and homes with no problem. But whenever I wanted to do a proper job it gets errorous.

povi2946 commented 4 years ago

signal-attachment-2020-03-02-183224 You can see in the kinda OK etch was raster just doing horizontal. But then at the top a non-sense was raster diagonal. It seems that in all diagonal jobs it gets glitchy, also on the side is visible when it just got stuck at one horizontal like and Y stopped moving. In general machine moves freely. I still need to calibrate more but I get these problems.

bdring commented 4 years ago

I ran my WebUI jobs the same way. I had a Serial GCode sender open and constantly requesting status, but the SD card job was started and monitored from the WebUI.

I do not have a full laser machine I can test with. I put an LED on the spindle output to visually monitor the the output.

I don't know why it would stop moving in one axis while still running a job. My first guess would be an electrical or thermal issue.

povi2946 commented 4 years ago

I see. Thank you. I am running two Y-motors on a single driver. They were not getting hot, but is it possible that driver TMC2130 shuts them off? We have these extended settings $140 thru $145 – [X,Y,Z,A,B,C] Stepper Run Current (extended settings) This is for Trinamic SPI stepper drivers only $150 thru $155 – [X,Y,Z,A,B,C] Stepper Idle Current (extended settings) Is there is a maximum value I can put in?

also, I saw my TMC library is one build older, I will try to update that one too. And test again. Thank you.

bdring commented 4 years ago

2 motors on one driver is unsupported territory.

The drivers try to read the motor during operation and could get confused by reading two motors.

I would contact Trinamic about it.

povi2946 commented 4 years ago

Ok, so this was most likely the problem for Y axis. I have this Step,dir,en splitter board.

signal-attachment-2020-03-03-124100

I could use it split step direction signal to two Trinamic drivers. But then obviously my TMC2130 pen plotter board looses purpose in a way. I just want to ask for a recommendation for my next approach. Should I try to hack pen plotter board to get step dir signal on the pins and then use the splitter board. Or just use Grbl_ESP32 Development Board 4.1v, and if I am correct I saw that in config we have options to use two drivers for the same axis. so I could use Z and Y slots for two Y axis motors.

MitchBradley commented 4 years ago

Either approach can be made to work. On the splitter board, I don't see any way to get the SPI pins over to the pen plotter board, but you could solder on some wires, or you could use the TMC drivers in standalone mode, without SPI. Search for "tmc2130 standalone mode" to learn how. The Grbl_ESP32 Development Board solution will result in a cleaner setup, but since you already have the other ones it might be a faster way to get going.

bdring commented 4 years ago

That is an interesting add-on board, but it has some issues. With SPI drivers you would need to hack in some external wires. I am not sure how it handles the micro-stepping jumpers with non-spi drivers.

The 3 axis controller can be ganged, but it does not support Trinamic drivers in SPI mode.

MitchBradley commented 4 years ago

This video shows how to modify TMC2130 to use standalone mode, so you could use them without SPI https://www.youtube.com/watch?v=Jh8iwqc1TP0

povi2946 commented 4 years ago

Thank you, yes I will use TMC2130 in a standalone mode and gang the axis. I will give another attempt tomorrow with Grbl_ESP32 Development Board. It should fix the Y problem for sure. I am still not sure how this could have affected the error I kept receiving but if tomorrow it's all good maybe we can close this issue. Thank you again

MitchBradley commented 4 years ago

It is possible that, with 2 motors connected, the current feedback from the motors was causing the driver chips to enter a protection state.

povi2946 commented 4 years ago

So I reworked everything on Grbl dev board. did some basic calibration and made sure homing etc is working. But I was still getting an error while running g-code from SD card from WEB-ui. I did ran it via UGS and it was ok.

[verbose] <Run|MPos:-216.775,-341.987,0.000|FS:139,0|Pn:Z|SD:82.80,/good_1.gcode> [verbose] <Run|MPos:-220.175,-338.388,0.000|FS:2000,163|Pn:Z|SD:82.83,/good_1.gcode> [verbose] <Run|MPos:-224.887,-333.675,0.000|FS:2000,163|Pn:Z|SD:82.83,/good_1.gcode> [verbose] <Run|MPos:-229.600,-328.962,0.000|FS:2000,163|Pn:Z|SD:82.90,/good_1.gcode> [verbose] <Run|MPos:-234.337,-324.225,0.000|FS:2000,137|Pn:Z|SD:83.01,/good_1.gcode> [verbose] <Run|MPos:-239.050,-319.513,0.000|FS:2000,0|Pn:Z|SD:83.05,/good_1.gcode> [verbose] <Run|MPos:-243.762,-314.800,0.000|FS:2000,163|Pn:Z|SD:83.08,/good_1.gcode> [verbose] <Run|MPos:-246.825,-311.538,0.000|FS:2000,163|Pn:Z|SD:83.15,/good_1.gcode> [verbose] <Run|MPos:-242.125,-316.237,0.000|FS:2000,135|Pn:Z|SD:83.17,/good_1.gcode> [verbose] <Run|MPos:-237.387,-320.975,0.000|FS:2000,0|Pn:Z|SD:83.18,/good_1.gcode> /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/queue.c:1446 (xQueueGenericReceive)- assert failed! abort() was called at PC 0x4008edfb on core 1 Backtrace: 0x400929e4:0x3ffbe880 0x40092c15:0x3ffbe8a0 0x4008edfb:0x3ffbe8c0 0x400f71df:0x3ffbe900 0x400dfdb9:0x3ffbe920 0x400dfed7:0x3ffbe940 0x40081232:0x3ffbe960 0x40084e05:0x3ffbe980 0x40082b4d:0x3ffba170 0x40087656:0x3ffba190 0x400831ff:0x3ffba1b0 0x4008f12d:0x3ffba1d0 Rebooting... ets Jun 8 2016 00:22:57 rst:0xc (SW_CPU_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 mode:DIO, clock div: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:Compiled with ESP32 SDK:v3.2.3-14-gd3e562907] [MSG:Using cpu_map:CPU_MAP_ESP32_V4] [MSG:Axis count 3] [MSG:RMT Steps] [MSG:Local access point GRBL_ESP started, 192.168.0.1] [MSG:Captive Portal Started] [MSG:HTTP Started] [MSG:TELNET Started 23] Grbl 1.1f ['$' for help]

$$ [MSG:'$H'|'$X' to unlock] $0 = 3 (Step pulse time, microseconds) $1 = 250 (Step idle delay, milliseconds) $2 = 0 (Step pulse invert, mask) $3 = 0 (Step direction invert, mask) $4 = 0 (Invert step enable pin, boolean) $5 = 0 (Invert limit pins, boolean) $6 = 0 (Invert probe pin, boolean) $10 = 1 (Status report options, mask) $11 = 0.010 (Junction deviation, millimeters) $12 = 0.002 (Arc tolerance, millimeters) $13 = 0 (Report in inches, boolean) $20 = 0 (Soft limits enable, boolean) $21 = 0 (Hard limits enable, boolean) $22 = 1 (Homing cycle enable, boolean) $23 = 3 (Homing direction invert, mask) $24 = 200.000 (Homing locate feed rate, mm/min) $25 = 2000.000 (Homing search seek rate, mm/min) $26 = 250 (Homing switch debounce delay, milliseconds) $27 = 1.000 (Homing switch pull-off distance, millimeters) $30 = 1000.000 (Maximum spindle speed, RPM) $31 = 0.000 (Minimum spindle speed, RPM) $32 = 1 (Laser-mode enable, boolean) $100 = 80.000 (X-axis travel resolution, step/mm) $101 = 80.000 (Y-axis travel resolution, step/mm) $102 = 80.000 (Z-axis travel resolution, step/mm) $110 = 15000.000 (X-axis maximum rate, mm/min) $111 = 15000.000 (Y-axis maximum rate, mm/min) $112 = 15000.000 (Z-axis maximum rate, mm/min) $120 = 800.000 (X-axis acceleration, mm/sec^2) $121 = 800.000 (Y-axis acceleration, mm/sec^2) $122 = 800.000 (Z-axis acceleration, mm/sec^2) $130 = 260.000 (X-axis maximum travel, millimeters) $131 = 360.000 (Y-axis maximum travel, millimeters) $132 = 300.000 (Z-axis maximum travel, millimeters) ok $G [verbose] GrblFeedbackMessage{message='[GC:G0 G54 G17 G21 G90 G94 M5 M9 T0 F0 S0.000]', distanceMode='G90', units='G21'} [GC:G0 G54 G17 G21 G90 G94 M5 M9 T0 F0 S0.000] ok [verbose] <Alarm|MPos:0.000,0.000,0.000|FS:0,0|Pn:Z|WCO:-259.000,-359.000,0.000> [verbose] <Alarm|MPos:0.000,0.000,0.000|FS:0,0|Pn:Z|Ov:100,100,100> [verbose] <Alarm|MPos:0.000,0.000,0.000|FS:0,0|Pn:Z> [verbose] <Alarm|MPos:0.000,0.000,0.000|FS:0,0|Pn:Z> [verbose] <Alarm|MPos:0.000,0.000,0.000|FS:0,0|Pn:Z> [verbose] <Alarm|MPos:0.000,0.000,0.000|FS:0,0|Pn:Z> [verbose] <Alarm|MPos:0.000,0.000,0.000|FS:0,0|Pn:Z> [verbose] <Alarm|MPos:0.000,0.000,0.000|FS:0,0|Pn:Z> [verbose] <Alarm|MPos:0.000,0.000,0.000|FS:0,0|Pn:Z>

good_1.zip