fra589 / grbl-Mega-5X

5/6 Axis version of Grbl, the open source, embedded, high performance g-code-parser and CNC milling controller written in optimized C that will run on an Arduino Mega2560
https://github.com/fra589/grbl-Mega-5X/wiki
Other
344 stars 161 forks source link

motors off #279

Closed wbendick closed 2 years ago

wbendick commented 2 years ago

When I disconnect from serial and then reconnect, my steppers lose power and my gantry crashed into my table or workpiece. I have $1 set to 255. Is there a workaround for this?

fra589 commented 2 years ago

Hello @wbendick,

By design, the Arduino is reset by opening the serial port (auto reset) and/or on power up. So, the stepper power lost is the normal behavior.

Solution to disable this can be found here:
https://playground.arduino.cc/Main/DisablingAutoResetOnSerialConnection/

But with disabled serial port connexion reset, you will probably need to modify your GCode sender because most of them are waiting for the Grbl's connexion/reset message when connecting to Grbl.

@++;
Gauthier.

wbendick commented 2 years ago

I see. Would it be possible to have the motors immediately power up after reset to prevent drops?

fra589 commented 2 years ago

Hi @wbendick,

Perhaps you ca try to add a call to st_wake_up(); in main.c...
Add this on line 525 (just before the report_init_message(); line.

I don't verify if this work, but if no, this might be complicated to do.

@++;
Gauthier.