grblHAL / core

grblHAL core code and master Wiki
Other
304 stars 73 forks source link

MPG behavior/documentation #486

Closed LaurentLM closed 2 months ago

LaurentLM commented 2 months ago

I have been tinkering with the second UART interface with the plan to build a home made MPG. I've been reading the wiki, discussions/issues and the code. I think I get the general gist of it, but there are still a few things I'd like to check:

When the UART stream is claimed by a pendant, there are 2 ways to keep ioSender up to date:

I have always been confused by the combination of KEYPAD / MPG settings. I came to this summary: KEYPAD_ENABLE 1 : i2C, requires strobe pin. KEYPAD_ENABLE 2 : UART, send 0x85 to clear jogs. MPG_ENABLE 1: UART stream claimed through MPG_pin, does not require the keypad plugin. MPG_ENABLE 2: UART stream claimed through 0x8B. Handling of 0x8B (and other single-character, real-time commands through UART stream) requires the keypad plugin.

MPG and keypad may use the same UART, but the keypad will not work when the MPG claims the stream. If you have the keypad and MPG communicating through UART, you cannot use the stream toggling pin. In this configuration, stream claim is only by sending 0x8B and by observing |MPG:1 in the status report.

terjeio commented 2 months ago

Autoreport can be checked by requesting an extended report (0x87) and look for |AR:200 (or frequency set in $481) in the response. I suppose it is advisable the MPG runs this check after the stream is claimed?

Correct, when autoreport is enabled the MPG should not send report requests. Note that ioSender disables autoreporting while it is connected so the MPG should react to changes in the AR element as needed and not only based on its own status request. BTW a full status report is sent when the stream is claimed.

MPG_ENABLE 2: UART stream claimed through 0x8B. Handling of 0x8B (and other single-character, real-time commands through UART stream) requires the keypad plugin.

Real-time commands are always handled. Single character commands are handled by the keypad plugin if MPG mode is off, if not they are ignored.

LaurentLM commented 2 months ago

Thanks for confirming this, that's very helpful.