Fix a hangup reported in the Slack channel of Grbl_ESP32.
It was too early to change the mode of I2S in Probing.
For example, this happens when probing immediately after the completion of a move, as shown below.
Outputs a message to change to pass-through mode and hang.
(Ignore the mixed output timing of ‘ok’.)
“TEXT`
G0 X1000 F100
G0 X0 F100
G38.2 X10 F50ok
ok
ok
ok
[MSG:Stop the I2S streaming and switch to the passthrough mode.]
It can probably also happen right after real time movement by JOGs.
I will now fix the following.
- Check the system status
- Wait for the real time commands that are being executed to finish synchronizing.
- Switch I2S mode.
After fix:
``
Grbl 1.3a ['$' for help]
[MSG:'$H'|'$X' to unlock]
$X
[MSG:Caution: Unlocked]
ok
ok
G0 X1000 F100
G0 X0 F100
G38.2 X10 F50ok
ok
ok
ok
[MSG:Stop the I2S streaming and switch to the passthrough mode.]
[PRB:2.014,0.000,0.000,0.000,0.000,0.000:1]
ok
ok
Homing doesn’t have the same phenomenon because it does the system status check first and then switches I2S.
If you try to homing while doing something, error 8 will return.
`“
Grbl 1.3a ['$' for help]
[MSG:'$H'|'$X' to unlock]
$X
[MSG:Caution: Unlocked]
ok
ok
G0 X1000 F100
ok
ok
$H
error:8
ok
(error 8 is STATUSIDLEERROR: You have issued a command only allowed when the machine active state is Idle)
评论 (9)
#2 – odaki 于 2020-09-20
I’ll fix a small issue with PlatformIO as well.
The problem is that if you change a file under the Custom folder, it is not recompiled.
From
“`
-<.git/> - -
`
To
“
-<.git/> - -
I also added some comments to the debug.ini that I would like to add personally.
#3 – odaki 于 2020-09-20
It has passed Travis CI.
https://travis-ci.com/github/odaki/Grbl_Esp32/builds/185438476
#4 – bdring 于 2020-09-20
I ran a file with a lot of moves and probes and it succeeded. It was running from the SD card, so only the probe results were echoed to the serial port. I think you should remove or comment out the the [MSG:Stop…]. It is information the user should not see.
““
[MSG:Stop the I2S streaming and switch to the passthrough mode.]
[PRB:11.000,-1.000,-13.125:1]
[MSG:Stop the I2S streaming and switch to the passthrough mode.]
[PRB:11.000,-1.000,-13.136:1]
[MSG:Stop the I2S streaming and switch to the passthrough mode.]
[PRB:11.000,-1.000,-13.136:1]
[MSG:Stop the I2S streaming and switch to the passthrough mode.]
[PRB:11.000,-1.000,-13.132:1]
[MSG:Stop the I2S streaming and switch to the passthrough mode.]
[PRB:11.000,-1.000,-13.153:1]
[MSG:Stop the I2S streaming and switch to the passthrough mode.]
[PRB:11.000,-1.000,-13.139:1]
[MSG:Stop the I2S streaming and switch to the passthrough mode.]
[PRB:11.000,-1.000,-13.126:1]
#5 – odaki 于 2020-09-20
Thanks for the test and review.
I will change the level of this comment from Warning to Debug.
#6 – odaki 于 2020-09-21
~~Modify the change process to passthrough a bit, as it may cut off the remaining steps of the previous motion.~~
#7 – odaki 于 2020-09-21
~~It turns out that the original code does not make the cutoffs either. Already taken into consideration.~~
~~However, it looks like the mode changes should be synchronous, so I’ll change the code a bit.~~
#8 – odaki 于 2020-09-21
I have found it difficult to make the transition to PASSTHROUGH synchronously in any case with the current implementation. I will make use of the current implementation.
#9 – odaki 于 2020-09-21
Test results.
It appears to be working as intended.
“
ets Jun 8 2016 00:22:57
rst:0x1 (POWERONRESET),boot:0x13 (SPIFASTFLASHBOOT)
configsip: 0, SPIWP:0xee
clkdrv:0x00,qdrv:0x00,ddrv:0x00,cs0drv:0x00,hddrv:0x00,wpdrv: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:Grbl_ESP32 Ver 1.3a Date 20200910]
[MSG:Compiled with ESP32 SDK:v3.2.3-14-gd3e562907]
[MSG:Using machine:ESP32 SPI 6 Axis Driver Board Trinamic]
[MSG:Axis count 6]
[MSG:I2S Steps, Stream]
[MSG:Init Motors]
[MSG:X Axis Trinamic TMC2130 Step:I2SO(2) Dir:I2SO(1) CS:I2SO(3) Disable:I2SO(0) Index:-1 Limits(0.000,0.000)]
[MSG:Y Axis Trinamic TMC2130 Step:I2SO(5) Dir:I2SO(4) CS:I2SO(6) Disable:I2SO(7) Index:-1 Limits(0.000,0.000)]
[MSG:Z Axis Trinamic TMC2130 Step:I2SO(10) Dir:I2SO(9) CS:I2SO(11) Disable:I2SO(8) Index:-1 Limits(0.000,0.000)]
[MSG:A Axis Trinamic TMC2130 Step:I2SO(13) Dir:I2SO(12) CS:I2SO(14) Disable:I2SO(15) Index:-1 Limits(0.000,0.000)]
[MSG:B Axis Trinamic TMC2130 Step:I2SO(18) Dir:I2SO(17) CS:I2SO(19) Disable:I2SO(16) Index:-1 Limits(0.000,0.000)]
[MSG:C Axis Trinamic TMC2130 Step:I2SO(21) Dir:I2SO(20) CS:I2SO(22) Disable:I2SO(23) Index:-1 Limits(0.000,0.000)]
[MSG:X Trinamic driver test passed]
[MSG:Y Trinamic driver test passed]
[MSG:Z Trinamic driver test passed]
[MSG:A Trinamic driver test passed]
[MSG:B Trinamic driver test passed]
[MSG:C Trinamic driver test passed]
[MSG:TMCStepper Library Ver. 0x000701]
[MSG:Relay spindle Output:GPIO(26), Enbl:None, Dir:None]
[MSG:Local access point GRBL_ESP started, 192.168.0.1]
[MSG:Captive Portal Started]
[MSG:HTTP Started]
[MSG:TELNET Started 23]
Grbl 1.3a ['$' for help]
[MSG:'$H'|'$X' to unlock]
$X
[MSG:Caution: Unlocked]
ok
ok
G0 X10 F100
G0 X0 F100
G38.2 X10 F50
ok
ok
ok
ok
[PRB:3.364,0.000,0.000,0.000,0.000,0.000:1]
ok
ok
ok
ok
“
The PRB value is meaningless because the Probe is manually touching the alternative switch.
#1 – odaki 于 2020-09-20
I decided to incorporate the recent modifications made in the ESP-IDF regarding I2S, just in case.
This fixes an issue where parameter changes could not be properly reflected due to an incorrect reset sequence in I2S.
https://github.com/espressif/esp-idf/issues/5410
https://github.com/espressif/esp-idf/commit/c7f33524b469e75937f003d4c06336bf4694a043#diff-27688c6b3c29373d2a2b142b8471981c
As far as I can see from the logic analyzer, this change does not appear to have affected the our careful I2S resets.
However, I will make the change so that if something goes wrong in the future, we won’t have to worry about whether it’s a reset sequence problem or not.
I2S reset after fix (The state of 74HC595 is kept in place by bitbang.):
!スクリーンショット 2020-09-20 16 51 44