synthetos / TinyG

Affordable Industrial Grade Motion Control
https://github.com/synthetos/TinyG/wiki
893 stars 293 forks source link

Feature / Best for Pick and Place #276

Closed markmaker closed 2 years ago

markmaker commented 2 years ago

Description


This is a documentary Pull Request, not intended for upstream merging. I just wanted to make this know, in the spirit of Open Source.


This PR contains some additional features used for Pick & Place

ADC reading for Vacuum sensing

Based on the code of thereza of the Liteplacer.com forum I reintegrated a condensed implementation. However, rather than a proprietary json request, I implemented G-code M105 for reading, as most other controllers do. It will return the raw ADC value (12bit, 0 … 4095) in the usual “thermistor” form, for best compatibility.

> M105 
ok T:1234
tinyg [mm] ok>

As Thereza proposed, connect the sensor in parallel with a 1µF capacitor to GND and SS2:

SS2

In OpenPnP configure the vacuum sensing actuator ACTUATOR_READ_COMMANDas follows:

M105 ; read vacuum level

and the ACTUATOR_READ_REGEXas

.*T:(?<Value>-?\d+).*

For more information about vacuum sensing:

Removed implicit Spindle Control from Z Probing Cycle

The standard TinyG firmware automatically switches off the spindle, when Z probing is initiated. This was likely a safety feature, but it is not compatible with Pick and Place, where the spindle signal is typically used to drive the vacuum pump (Liteplacer wiring). See the user support case: https://groups.google.com/g/openpnp/c/5XTtQZBF7l8/m/H-q9ccSdAQAJ

Side note: I believe it is generally bad behavior for a firmware to do stuff it was not asked for. It could equally make sense to probe with a running spindle in a CNC machine, for instance for fixed drill depth probing, where a probe could be mounted right next to the drill bit.

CAUTION: I still do not advocate for TinyG to adopt this change. It would be unsafe for machines that rely on that behavior.

More Information

See https://makr.zone/tinyg-new-g-code-commands-for-openpnp-use/577/

markmaker commented 2 years ago

I'm now closing this myself, as it is only documentary.