BMP183 SPI sensors as bed probe
-
Thanks David. Ultimately it simplifies things if I can use a 3.3V Arduino for the final product as it allows me to have the one 3/4 pin connector going to the Duet Probe port. I was just concerned that the sequential reading of the three modules over SPI would pose a delay of 3 x the main loop duration so loop speed may have been an important factor. I'll probably do a debug write to EEPROM of the duration between each module read to see how quick the Adafruit libraries are and put that info out to serial after a number of loops. Tempted to output PWM to give a raw reading of the variations in pressure. This would allow the Duet to determine the trigger point. Does the mod pin allow for PWM in? I assume that is how analog values are read?
I have performed numerous G30 S-1 probes at points all over the bed and I'm getting close to 0.01mm variation between z trigger depths. Having a bubble under the PEI sheet where I set the probe point certainly makes those readings inconstant but that's hardly surprising. On the bare AL heatbed the probes were within 0.005mm of each other.
I've had to tweak the sensitivity as some z movements were triggering the modules so it's at a sweet spot now where I can perform the mesh probe at 20mm spacing and get a very accurate representation of the surface (bubbles and all).
Will fire up Eagle tomorrow and start on an integrated board with connectors.
-
Module mounted in a 3D printed bearing block (3 under the bed for the Y axis on my i3 clone) -
-
Hi David, I just tried analogWrite on the Arduino code with the pin connected to the IN probe pin. When sending a static value of 100 on analogWrite the web interface is showing a bouncing value which is all over the shop. D3 is the pin on the Pro Mini I'm using which defaults to 480Hz PWM. Does this IN pin expect a true analog input of varying voltage levels or should raw PWM work in mode 1? Currently I use M558 P1 0 R0.8 H0.75 A10 S0.02 T2000 F60 X0 Y0 Z1 for the probe. Couldn't find any write up online for this.
Also, the Duet Wifi I'm testing on is a V1.01 so I guess it's not tolerant to the 5V PWM? I can test on the newer board I have but I do need to get this one working. Might just put a 220ohm in series with D3 to see if that helps?
-
Is it possible to stick a piece of adhesive foam on top of the sensor and use that instead of a printed boot?
-
@tjb1 - I doubt it as the hole on top of the BMP sensor is tiny so the foam tape would not create the sudden increase in pressure when pressed. All it would do is seal that hole. The rubber boots I printed create a cavity of a few mm cubed which is sealed from the atmospheric pressure and spikes with the smallest of pressure down on it. It's quite critical to how this solution works.
-
One of the issues with the first LM8UU bearing block design was that I lost about 7-8mm of z depth on the printer. This new design only cuts into the z depth by a mm.
-
@jgrouse It looks like Adafruit just released this one - listed as a pressure sensor so I don't know if its sensitive enough to detect the changes here, maybe you could use one of those with a tube that goes around to all the bearing blocks and seal the end. Possibly a long silicone tube right under the bed? Clamp the bed down enough to slightly compress it and then see if it can be detected on the sensor.
-
@tjb1 - interesting. As long as the sensor in there is just as sensitive as the existing BMP sensors that would probably work. Sensitivity is the key to this working. A very narrow sealed silicone tube running through each of the three bearing blocks and then to the module would really simplify this concept. Now if the sensor could cope with a non-conductive liquid in the tube then the pressure/response would more immediate as soon as something touched the surface. Some oil?
Might order that sensor tonight and have a play with these ideas.
Thanks for letting me know about that module!
-
@jgrouse said in BMP183 SPI sensors as bed probe:
Hi David, I just tried analogWrite on the Arduino code with the pin connected to the IN probe pin. When sending a static value of 100 on analogWrite the web interface is showing a bouncing value which is all over the shop. D3 is the pin on the Pro Mini I'm using which defaults to 480Hz PWM. Does this IN pin expect a true analog input of varying voltage levels or should raw PWM work in mode 1? Currently I use M558 P1 0 R0.8 H0.75 A10 S0.02 T2000 F60 X0 Y0 Z1 for the probe. Couldn't find any write up online for this.
Also, the Duet Wifi I'm testing on is a V1.01 so I guess it's not tolerant to the 5V PWM? I can test on the newer board I have but I do need to get this one working. Might just put a 220ohm in series with D3 to see if that helps?
PWM at such a low frequency would not work because you would need to smooth it using a time constant of 10ms or more, which would delay the response too much. I suggest you use either a digital output, or a 4-level output from 2 digital pins as the IR sensor does. Use a voltage divider to reduce the output voltage to 3.3V maximum.
-
@jgrouse said in BMP183 SPI sensors as bed probe:
to see how quick the Adafruit libraries are
If you want to speed-up things, I suggest you re-write the lib. They might have implemented a lot of stuff you don't need which can slow down the reading. I did that for their PWM lib for PCA9650, and gained a factor 2 or 3 in speed.