That's clever! How do you implement such a an auto-z sensing circuit for Mach3?