Stepper release upon disconnect

Discussion about the arduino based g-code interpreter, grbl
Post Reply
Posts: 3
Joined: Sat Sep 19, 2015 6:14 am

Stepper release upon disconnect

Post by adamsd5 » Tue Apr 04, 2017 3:14 am


I'm using GRBL 0.9g, and experimenting with probing on my Shapeoko 3. Probing uses the G38.2 with 3 touch plates (X, Y, and Z). Then, I set the work positions using G10. This works great. However, since after a G10 I need to wait for the OK (I wish I could recall the link, but it seems flashing doesn't get interrupted, so sending more commands before the 'ok' can cause commands to be lost... I experienced this with Universal GCode Sneder), I wrote a python script to send the commands, waiting for an OK each time. However, I need to disconnect from the serial port from python and re-connect from Universal GCode Sender. This leads to my question...

Every time I close the socket at the end of this procedure, the Z axis drops between .1 and .5 inches. So when I reconnect with UGS, the Z is off from where I probed. X zero and Y zero are correct, but the Z needs adjusting. I believe this is because the stepper motors de-energize for a short amount of time upon disconnection. I test this with UGS by putting upward pressure when I press Close/Open. Upon close, the motor goes up a bit. Just for about 0.1s, then locks in. If I'm not pressing, it drops, or if near the bottom (spring stretched), it goes back up. I can move in X and Y directions as well. Any ideas on why this is happening? Or more importantly, any idea how to prevent it from happening?

Posts: 376
Joined: Tue Aug 12, 2014 2:16 pm
Location: Albuquerque NM, USA

Re: Stepper release upon disconnect

Post by chamnit » Tue Apr 04, 2017 2:11 pm

An Arduino automatically resets whenever it is connected to. This involves the DTS pin (I think). I recall you can disable this pin in Python and it'll prevent the Arduino from auto-resetting. Also, make sure that your $1 setting is 255. This will keep the steppers enabled whenever it is t in motion.

Post Reply