pyr0ball / pyr0piezo

An AVR/ARM based piezoelectric sensor for use in ultra-precise applications
https://docs.pyroballpcbs.com/
Other
71 stars 23 forks source link

[FR] Detect if no piezo element is plugged in to the PCB header. #48

Closed klcjr89 closed 4 years ago

klcjr89 commented 4 years ago

Is your feature request related to a problem? Please describe. Feature request is not directly related to problem #47, but it would potentially save people from crashes if a piezo wire gets broken or element damaged.

Describe the solution you'd like Upon powerup, the piezo board can interrogate the PCB header where the piezo element plugs into to see if anything is attached. This would be done in a function call that can be later reused, as described below.

The MCU can additionally poll every X amount of seconds or (however long is determined to be best) to verify that a piezo is still plugged in and that a wire or solder joint has not broken. This would cause the user to investigate their wiring to fix it when they realize their firmware cannot home or probe the Z axis, thus eliminating a crash.

pyr0ball commented 4 years ago

Detecting a piezo disk plugged in is very doable, but it may not be possible to detect whether the disk is damaged. Being able to halt the system if the piezo becomes unplugged is definitely a required safety feature I believe, however.

No polling should be required when using interrupt pins. I'll set up one of the unused pins as a pullup input, and have that get pulled to ground when the piezo is attached. If the piezo is unplugged, the pin will go high and can set an error state that will keep the system in a "triggered" state until the issue is fixed, which should prevent the printer from damaging itself

pyr0ball commented 4 years ago

Created new board revision v2.2.x for this feature, as it requires changing a header and attaching a new pin to the MCU

pyr0ball commented 4 years ago

added in a9d9288