Liteplacer TinyG Homing Problem not backing up to switches

182 views
Skip to first unread message

Phuong Casso

unread,
Apr 27, 2022, 9:56:19 AM4/27/22
to OpenPnP

Hi everyone,

I come back here with yet some more problem with the homing using TinyG. 

I have encounter multiple instances like this when attempting to home the machine: it first can home the Z switch properly, but after that it didn’t perform the homing for X and Y – ie it doesn’t go back to the home switches, but instead it goes straight to visual homing.

Attached below are my log file containing one of those instances as well as my machine.xml and my settings for the TinyG. I included the version 440.20 and 440.21 for further examination.Could you look into it? 

Thank you in advance.

Phuong

machine.xml
OpenPnP_log_homing_issue.log
back_up_tiny_g_440.21_new.txt
back_up_tiny_g_440.20.txt

mark maker

unread,
Apr 27, 2022, 10:19:13 AM4/27/22
to ope...@googlegroups.com

Hi Phuong,

I know it is the TinyG convention to send all these

$variable=xy

settings in the CONNECT_COMMAND:

But I actually advise against that.

When the settings are the same as before, it does nothing bad (but it is then also useless).

When the settings change, TinyG is writing to the EEPROM, and it is known that serial communication is then not reliable for a few milliseconds, I believe I read somewhere that during EEPROM write, the MCU cannot serve interrupts. The original Liteplacer software even adds a 50ms wait after each such command write (as I've just recently discovered).

What's even worse: if you add the same settings twice by mistake and with different settings, you get two EEPROM writes each time! Not a good thing.

So I would make sure the settings are OK in the EEPROM and back them up using external means. Then remove them from the CONNECT_COMMAND.

The EEPROM writing disruption could explain that the homing command is (perhaps only sometimes) corrupted.

_Mark

--
You received this message because you are subscribed to the Google Groups "OpenPnP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/302c3476-272c-4c4d-90e7-19c4fcb1d8c9n%40googlegroups.com.

tonyl...@gmail.com

unread,
Apr 27, 2022, 12:36:05 PM4/27/22
to OpenPnP
On my machine, the homing button doesn't become available until after the CONNECT_COMMAND and ENABLE_COMMAND have completed yet I see in your log that the HOMING_COMMAND is somehow getting sent well before those commands complete.  Also, somehow your pump and solenoid valve are getting turned-on before homing:
2022-04-26 18:13:37.753 GcodeAsyncDriver DEBUG: serial://COM25 commandQueue.offer($zsx=3, 50000)... 
2022-04-26 18:13:37.754 GcodeAsyncDriver DEBUG: serial://COM25 commandQueue.offer($zsn=0, 50000)... 
2022-04-26 18:13:37.754 GcodeAsyncDriver DEBUG: serial://COM25 commandQueue.offer(G21 M9, 50000)... 
2022-04-26 18:13:37.758 GcodeDriver$ReaderThread TRACE: [serial://COM25] << [sv] status report verbosity 0 [0=off,1=filtered,2=verbose] 
2022-04-26 18:13:37.759 GcodeDriver$ReaderThread TRACE: [serial://COM25] << tinyg [mm] ok> 
2022-04-26 18:13:37.760 ReferenceActuator DEBUG: PUMP.actuate(true) 
2022-04-26 18:13:37.762 GcodeAsyncDriver DEBUG: serial://COM25 commandQueue.offer(M4, 50000)... 
2022-04-26 18:13:37.780 GcodeDriver TRACE: [serial://COM25] confirmed $SV=0 
2022-04-26 18:13:37.781 ReferenceActuator DEBUG: VAC.actuate(true) 
2022-04-26 18:13:37.781 GcodeAsyncDriver$WriterThread TRACE: [serial://COM25] >> $ex=1 
2022-04-26 18:13:37.781 GcodeAsyncDriver DEBUG: serial://COM25 commandQueue.offer(M8, 50000)... 
2022-04-26 18:13:37.789 ReferenceMachine DEBUG: homing machine 
2022-04-26 18:13:37.791 GcodeAsyncDriver DEBUG: serial://COM25 commandQueue.offer(G28.2 X0 Y0 Z0 ; Home all axes, -1)... 
2022-04-26 18:13:37.791 GcodeAsyncDriver DEBUG: serial://COM25 commandQueue.offer(G28.3 X0.0000 Y0.0000 Z0.0000 A0.0000 ; Set all axes to home coordinates, -1)... 
2022-04-26 18:13:37.791 GcodeAsyncDriver DEBUG: serial://COM25 commandQueue.offer(G92.1 ; Reset all offsets, -1)... 

I'm not sure how/why that is happening, but it results in your vacuum pump and solenoid turning on just before homing starts and I wonder if the electrical noise generated by that is somehow confusing the TinyG:

2022-04-26 18:13:38.684 GcodeAsyncDriver$WriterThread TRACE: [serial://COM25] >> M4 
2022-04-26 18:13:38.696 GcodeDriver$ReaderThread TRACE: [serial://COM25] << tinyg [mm] ok> 
2022-04-26 18:13:38.696 GcodeDriver TRACE: [serial://COM25] confirmed M4 
2022-04-26 18:13:38.697 GcodeAsyncDriver$WriterThread TRACE: [serial://COM25] >> M8 
2022-04-26 18:13:38.709 GcodeDriver$ReaderThread TRACE: [serial://COM25] << tinyg [mm] ok> 
2022-04-26 18:13:38.710 GcodeDriver TRACE: [serial://COM25] confirmed M8 
2022-04-26 18:13:38.711 GcodeAsyncDriver$WriterThread TRACE: [serial://COM25] >> G28.2X0Y0Z0 
2022-04-26 18:13:38.722 GcodeDriver$ReaderThread TRACE: [serial://COM25] << tinyg [mm] ok>

I can't figure out why that is happening though - do you have a startup script that's doing that?

mark maker

unread,
Apr 27, 2022, 12:51:46 PM4/27/22
to ope...@googlegroups.com

I guess he has Home after enabled? set on the Machine.

And perhaps some Machine State Actuation control:

https://github.com/openpnp/openpnp/wiki/Setup-and-Calibration%3A-Actuators#actuator-machine-states

_Mark

Jim Young

unread,
Apr 27, 2022, 2:38:24 PM4/27/22
to OpenPnP
Regarding repeating the TinyG variable settings commands - I have discovered that with the TinyG I must  be issued the $sv=0 command when connecting, otherwise OpenPnP freezes up when any other commands are issued. 

I found this in the TinyG firmware code. Perhaps the memory location for SV is not in EEPROM and is reset upon powerup?

#define STATUS_REPORT_INTERVAL_MS    500                        // milliseconds - set $SV=0 to disable

Jim Young

unread,
Apr 27, 2022, 4:03:26 PM4/27/22
to OpenPnP
Oops, I meant this variable

#define STATUS_REPORT_VERBOSITY     SR_FILTERED             // one of: SR_OFF, SR_FILTERED, SR_VERBOSE=

Phuong Casso

unread,
May 5, 2022, 10:07:10 AM5/5/22
to OpenPnP
Hey all,

Apologies for the AWOL, my computer just got crashed a few days ago and I just have it back up now.

I tried out as per your suggestions but it still behaves the same regardless. 
OpenPnP.1.log

mark maker

unread,
May 5, 2022, 10:28:45 AM5/5/22
to ope...@googlegroups.com

> I tried out as per your suggestions

Looking back I'm unsure what suggestions you mean. Please elaborate.

_Mark

tonyl...@gmail.com

unread,
May 5, 2022, 10:35:28 AM5/5/22
to OpenPnP
Try disconnecting your vacuum pump and valve from the TinyG and see if you still have the problem.  As I mentioned above, you are turning them both on almost instantaneously with the homing cycle possibly creating too much electrical noise for the TinyG.

Tony

Phuong Casso

unread,
May 5, 2022, 12:00:37 PM5/5/22
to OpenPnP
Hi Tony,

I tried that too but the problem still persists.
I also disconnected it physically so I was unsure what other problems might there be.

Phuong

tonyl...@gmail.com

unread,
May 5, 2022, 12:19:34 PM5/5/22
to OpenPnP
Can you explain how you have the limit switches wired to the TinyG - some pictures of your wiring might help as well.  In your OP, it sounded like this was an intermittent issue, if so, how many times does it successfully home versus fail?

Tony

Jim Young

unread,
May 6, 2022, 12:48:17 PM5/6/22
to OpenPnP
I was going over your log and comparing it to mine. You have a lot of commands being sent to the TinyG before homing starts. The G28.2 command is queued then a whole bunch of commands get sent - G21, G90, G21M9, M8, M4, M5, M9 (all previously queued) - before the G28.2 homing command is sent. I would pare down your CONNECT_COMMAND to just

$sv=0
G21 ; Set millimeters mode
G90 ; Set absolute positioning mode

In the Machine Setup | ReferenceMachine, turn off Home After Enabled, and make sure that ReferenceAdvancedMotionPlanner is selected for the Motion Planning.

Try the above and see if that makes any difference.

Phuong Casso

unread,
May 9, 2022, 9:22:16 AM5/9/22
to OpenPnP
Hey guys,

Sorry for the late reply. I tried  condensing the CONNECT_COMMAND but there isn’t any changes happening.

For the wiring, I did as instructed by the TinyG Liteplacer connection schematics, with the exception of the Zmin anf Zmax switches being swapped place of course. Here is the source I used for my wiring diagram: https://liteplacer.com/Downloads/LitePlacer_Wiring_v1_2.pdf

So far, I’ve estimated around 5-10 fails to 1 success, so I do think that it could be an electrical issue too.

tonyl...@gmail.com

unread,
May 9, 2022, 2:52:07 PM5/9/22
to OpenPnP
Please post a log of when it does work so we can compare it to the bad ones.  Re: your wiring - are you using good EMI wiring practices?

mark maker

unread,
May 9, 2022, 3:19:50 PM5/9/22
to ope...@googlegroups.com

Hi Phuong

Earlier I pointed at this:

On Wednesday, April 27, 2022 at 9:51:46 AM UTC-7 ma...@makr.zone wrote:

I guess he has Home after enabled? set on the Machine.

And perhaps some Machine State Actuation control:

https://github.com/openpnp/openpnp/wiki/Setup-and-Calibration%3A-Actuators#actuator-machine-states

Can you please disable Home after enabled?

And please move any Machine State Enabled actuation to Homed, or (for the moment) disable it entirely (set to defaults as in screen shot above).

You will then need to press the homing button separately.

(there might be some kind of race condition in these automatisms)

_Mark

Reply all
Reply to author
Forward
0 new messages