grblHAL / core

grblHAL core code and master Wiki
Other
310 stars 76 forks source link

Not entering the reset and sending the welcome message while in an emergency stop state can cause Candle to fail. I would like to discuss some solutions with you. #319

Closed hanke-cnc closed 1 year ago

hanke-cnc commented 1 year ago

Although this is an extreme case, I hope to seek a solution, even though it is not an error with grblhal.

"The perfect solution that I can think of is to modify Candle to use a hard reset during connection instead of 0x18 (which should not be a problem for me as I am using a serial port instead of a USB virtual serial port). I have checked your documentation and tried using 0x1B or 0x14 as an alternative, but it seems they do not work. I am using an F407 control board."

The translation is:

"The solution I have thought of is to create my own system command, such as "$Reset", for hard resetting. I can find the system commands that you have defined in the grblhal source code, so all I need to do is to change one of the system commands that I don't need to $Reset. However, I don't know how to write the code for hard resetting because my programming skills are weak."

terjeio commented 1 year ago

ESC (0x1B) followed by CTRL-T (0x14) is the "standard" hard reset sequence, however only a few drivers has this implemented. Code has to be attached to the hal.reboot function pointer for those drivers that does not have it. Likely it is only one one or a few statements, setting a bit in some register.

Adding a $-command is best done in a plugin, do not modify the core source. And this should call hal.reboot (if not NULL). Here is an example of how to add custom commands.

Anyway, I am a bit curious about which emercency state(s) that is not responding properly to a soft reset.

hanke-cnc commented 1 year ago

<Alarm:10|MPos:0.000,0.000,0.000,0.000,0.000,0.000|Bf:35,1023|FS:0,0|Pn:PXYZE>

I have reviewed your document. Alarm:10 is an emergency stop state. When in this state, connecting to Candle will not be successful because it relies on a startup message.

hanke-cnc commented 1 year ago

Your ioSender can connect even when the system is in Alarm:10 emergency stop state because it does not require a startup message. Perhaps you should consider changing Candle, but you may not want to mess it up.

hanke-cnc commented 1 year ago

The translation seems a bit off. Your ioSender can connect even when the system is in Alarm:10 emergency stop state because it does not require a startup message. Perhaps I should consider modifying the source code of Candle, but I'm hesitant to do so as it may cause further issues.

terjeio commented 1 year ago

Uncomment this line to change from estop to legacy reset handling of the estop/reset input.