Welcome! Log In Create A New Profile

Advanced

Different sensors for Z height and bed leveling

Posted by leadinglights 
Different sensors for Z height and bed leveling
June 18, 2020 07:48AM
What is the best or easiest (or even possible) way to automatically get Z offset and bed leveling with two different sensors? Specifically, is it possible to perform a G30 to set the Z probe offset using one sensor and then a G29 to perform leveling/mesh compensation with a different sensor and different input pin?

A bit of background and detail:-

An under-bed sensor and conditioning board that I have been working on works very well for a single position on the bed if the nozzle is probing directly over the sensor. The conditioner is even able to detect a dirty nozzle and is accurate and repeatable in the region of a few microns. Having said that, the variation over other parts of the bed can be quite extreme and can exceed 50 microns in places. Redesign of the bed would ease this but would be far from simple.

The sensor I am working on for the leveling is an optical type where the light path is a very shallow grazing angle and works pretty much regardless of the bed surface. In my printer, this is a good option as the two nozzles can both be withdrawn to allow the optical sensor to approach within about half a millimeter of the surface

Although I would like to keep to Arduino Mega/RAMPS and Repetier or Marlin, I am not religious about it and will ditch them if needed.

Mike
Re: Different sensors for Z height and bed leveling
June 20, 2020 06:36AM
Thinking a bit more about this, I think there is no reason to use an optical sensor as both nozzles can be lifted at the same time and the whole z carriage lowered. A simple microswitch or piezo touch sensor could then be used: The piezo device could easily operate with as little as 1 gram of pressure. The diagram below shows the general idea.



The requirement still exists to find a way of getting firmware measuring the Z height for each of the two nozzles at a single point and then mapping the bed at 3 or more points for level and/or flatness compensation. While the height and map would be two different sensors I guess that some electronics could be used to multiplex the two to a single pin. I have not yet found any way to set up the firmware to do this and would appreciate any helpful suggestions.

Mike
Re: Different sensors for Z height and bed leveling
June 21, 2020 02:00AM
RepRapFirmware supports multiple Z probes, so it could handle this arrangement without multiplexing a pin.



Large delta printer [miscsolutions.wordpress.com], E3D tool changer, Robotdigg SCARA printer, Crane Quad and Ormerod

Disclosure: I design Duet electronics and work on RepRapFirmware, [duet3d.com].
Re: Different sensors for Z height and bed leveling
June 21, 2020 03:50AM
To "multiplex" these "sensors", if their OUT is an open collector (usually they are) is easy, just connect them together , one pull up R (often not required, just configure the IN pin) et voila !


"A comical prototype doesn't mean a dumb idea is possible" (Thunderf00t)
Re: Different sensors for Z height and bed leveling
June 21, 2020 05:59AM
@DC42
Do you mean that RepRapFirmware would be able to do something like the following in G and M codes?

  • Move to a position over underbed piezo sensor
  • Probe with Z carriage touch sensor to get a starting datum
  • Move the first nozzle to that position and get a Z offset for the first nozzle (reading from underbed sensor)
  • Move the second nozzle to the same position and get Z offset for the second nozzle
  • Use Z carriage touch sensor to map the bed for level/flatness

@MKSA
My existing piezo controllers have bidirectional IO pins (PIC17F1704 MCU) and don't willingly act as OC or OD outputs. My nice Chinese PCB supplier gives me 10 PCBs for less that I have paid for a coffee in a posh restaurant so I could redesign it with a new MCU. Hopefully, it will be possible to do what I want with RepRap Firmware.

Mike
Re: Different sensors for Z height and bed leveling
June 21, 2020 04:47PM
Yes that would be possible.



Large delta printer [miscsolutions.wordpress.com], E3D tool changer, Robotdigg SCARA printer, Crane Quad and Ormerod

Disclosure: I design Duet electronics and work on RepRapFirmware, [duet3d.com].
Re: Different sensors for Z height and bed leveling
June 21, 2020 05:09PM
@DC42

O.K., it looks like I will be going 32 bit.

Mike
Sorry, only registered users may post in this forum.

Click here to login