Using FSRs to triangulate {X, Y} of probed location

Post Reply
User avatar
626Pilot
ULTIMATE 3D JEDI
Posts: 1716
Joined: Tue May 14, 2013 12:52 pm

Using FSRs to triangulate {X, Y} of probed location

Post by 626Pilot »

The goal of this experiment, for me, is to enable my Smoothie branch to obtain more accurate bed probings for use in its AI delta printer calibration routine. Currently, it obtains depth (Z) information from a Z-probe, and assumes that the {X, Y} position where it thinks the effector is, is accurate. I feel this is an acceptable solution because on a Delta printer, error in Z usually correlates with error in X and Y; so if you adjust the calibration in a way that helps Z, you usually can't help but improve X and Y as well. However, it may not be the optimal solution. It would be ideal to have a probing system that tells us where the probe hit in the XY plane, not just its depth in Z.

If force-sensing resistors (FSRs) have adequate accuracy and repeatability, it may be possible to use them to triangulate the location of a probed point given the differences between the "weights" returned by each FSR. For example, if you have FSRs at precisely known locations near the X, Y, and Z towers, and you tap the board close to one tower, that tower's FSR will report "heavier" than the other two. The question is whether the signal from the FSRs is clean and precise enough to allow us to triangulate the coordinates to an accuracy of better than 40 microns. (50 or even 100 microns might be acceptable, and may be better than assuming X and Y are accurate in some cases, but 40 or better would be better. Zero would be ideal.)

I've opened a dialog with JohnSL about the possibility of using his FSR endstop board for probing the print surface. He has published open-source firmware that runs on a board he sells through tridprinting.com for $10. The board has an ATTiny861A processor, so it can be programmed using the Arduino IDE. The firmware keeps a running average of the "weight" of the print surface, and will trigger the Z-min endstop if that weight deviates from the average by a significant amount.

I also looked into the possibility of wiring FSRs directly to the Smoothieboard, if it has enough analog ports broken out. It does. However, they would need to use an analog voltage source (AVCC), which is not broken out directly. A wire could be soldered into "the SD card side of the 4k7 pullups, RN1" (says Triffid_Hunter on IRC). I don't like the idea of telling people they have to aim a soldering iron at their $150 controller board if I don't have to, so while I'm willing to look into it, I would like to investigate a solution that doesn't require that. (The solution I'm looking at involves soldering pin headers - but to the $10 endstop board, which is somewhat less scary.)

The '861 in John's endstop board has 8K flash, 0.5K EEPROM, 0.5K RAM, 16 general purpose registers, and can run at a maximum of 10-20MHz depending on voltage. There's no crystal, so I assume it runs at 8MHz. It has solder pads for an SPI port. I think with these, it could be connected to a Smoothieboard and stream the sensor values over high-speed SPI. It should also be possible to send a self-clocking signal to Z-min and read that in software (so rather than acting like a normal endstop, it would decode binary data sent to the Z-min pin using a self-clocking signal). That would be nice because we wouldn't have to use up an SPI port, or even do any soldering. However, this would require a lot more work (both in the FSR firmware and Smoothieware) than SPI. In fact, on the Arduino side, it would require assembly language coding tailored to make all the opcodes execute in a specific time frame, as with the NeoPixel driver that runs on Arduinos. That's more than I want to get into at this stage, so I would like to concentrate on SPI, and leave self-clocking signals for "some future version, maybe."

John asked me to start a thread for this so we could have the discussion in a real forum instead of in Github's ticket system, so, here is the thread. I would like to welcome JohnSL to our forums, where his work is already known. John, I have two of these endstop boards, and some pin headers. Is there anything I need to know about how to flash a firmware to the boards?
User avatar
Nylocke
ULTIMATE 3D JEDI
Posts: 1418
Joined: Sun Jun 23, 2013 1:43 pm
Location: Iowa

Re: Using FSRs to triangulate {X, Y} of probed location

Post by Nylocke »

That sound like a pretty slick idea. Good luck with it.
User avatar
mhackney
ULTIMATE 3D JEDI
Posts: 5391
Joined: Mon Mar 26, 2012 4:15 pm
Location: MA, USA
Contact:

Re: Using FSRs to triangulate {X, Y} of probed location

Post by mhackney »

I'm happy to test anything along the way. I have 3 of John's boards. One is setup on a mini kossel currently. The others will go on my Rostock and a TAZ 4 sometime in the next 2 weeks.

Sublime Layers - my blog on Musings and Experiments in 3D Printing Technology and Art

Start Here:
A Strategy for Successful (and Great) Prints

Strategies for Resolving Print Artifacts

The Eclectic Angler
User avatar
626Pilot
ULTIMATE 3D JEDI
Posts: 1716
Joined: Tue May 14, 2013 12:52 pm

Re: Using FSRs to triangulate {X, Y} of probed location

Post by 626Pilot »

mhackney wrote:I'm happy to test anything along the way. I have 3 of John's boards. One is setup on a mini kossel currently. The others will go on my Rostock and a TAZ 4 sometime in the next 2 weeks.
Do you have some 3D-printable mounts for the FSRs?
User avatar
mhackney
ULTIMATE 3D JEDI
Posts: 5391
Joined: Mon Mar 26, 2012 4:15 pm
Location: MA, USA
Contact:

Re: Using FSRs to triangulate {X, Y} of probed location

Post by mhackney »

I do for the kossel and I'm doing an update for the Rostock. You can see the kossel design in a thread in the mods forum. i use a trilobal plunger to minimize friction while minimizing slop (3 points of contact).

The Kossel mounts could be used on a Rostock, it just the way they are attached with the slots needs to be modified a bit.

Sublime Layers - my blog on Musings and Experiments in 3D Printing Technology and Art

Start Here:
A Strategy for Successful (and Great) Prints

Strategies for Resolving Print Artifacts

The Eclectic Angler
User avatar
626Pilot
ULTIMATE 3D JEDI
Posts: 1716
Joined: Tue May 14, 2013 12:52 pm

Re: Using FSRs to triangulate {X, Y} of probed location

Post by 626Pilot »

I think I will probably do a mount that fits to the T-slot, reusing part of the geometry from this: http://www.thingiverse.com/thing:147456
User avatar
teoman
ULTIMATE 3D JEDI
Posts: 1770
Joined: Sat May 24, 2014 5:43 pm

Re: Using FSRs to triangulate {X, Y} of probed location

Post by teoman »

Michael, Nylocke or Pilot

Would you have an oscilloscope handy?

One that you can connect to atleast 2 of the FSR's?


I have played very little with the FSR's and their accuracy is not fantastic but acceptable in most cases. They may require their own calibration though.

An idea came to my mind, If you attach an oscilloscope, you might be able to see a time difference in the registration of the pressure on the FSR's. And that time difference could be used like pseudo gps signals to calculate the position which would be independent of the FSR's accuracy. I wish I still had access to my old lab where i could play with this stuff.

Assuming that the contact vibration or pressure wave travels at the speed of sound, it would take roughly 4 ms for the signal to travel from the centre of the build plate to the extremities. (Assuming a 15cm distance, so FSR's placed on a 30cm diameter circle). Sound travels 10 times faster in glass [1] so 0.4ms. One may need a pretty fast interrupts for this but it is worth inspecting.

To capture the signal you would need to use the trigger function of the oscilloscope so that it freezes the screen when one of the signals raises above a certain point.

Ref [1]: http://www.engineeringtoolbox.com/sound ... d_713.html
When on mobile I am brief and may be perceived as an arsl.
User avatar
mhackney
ULTIMATE 3D JEDI
Posts: 5391
Joined: Mon Mar 26, 2012 4:15 pm
Location: MA, USA
Contact:

Re: Using FSRs to triangulate {X, Y} of probed location

Post by mhackney »

I do not have an oscilloscope but could get access to one from a friend if needed.

Sublime Layers - my blog on Musings and Experiments in 3D Printing Technology and Art

Start Here:
A Strategy for Successful (and Great) Prints

Strategies for Resolving Print Artifacts

The Eclectic Angler
User avatar
teoman
ULTIMATE 3D JEDI
Posts: 1770
Joined: Sat May 24, 2014 5:43 pm

Re: Using FSRs to triangulate {X, Y} of probed location

Post by teoman »

If you want to play around with my potentially stupid ideas, why not :)
When on mobile I am brief and may be perceived as an arsl.
User avatar
Nylocke
ULTIMATE 3D JEDI
Posts: 1418
Joined: Sun Jun 23, 2013 1:43 pm
Location: Iowa

Re: Using FSRs to triangulate {X, Y} of probed location

Post by Nylocke »

I don't have one either but I think someone at my space has a "nice" digital one. Wouldn't know how to use/read it though, not quite that much of an electronics guy.
User avatar
626Pilot
ULTIMATE 3D JEDI
Posts: 1716
Joined: Tue May 14, 2013 12:52 pm

Re: Using FSRs to triangulate {X, Y} of probed location

Post by 626Pilot »

I have an oscilloscope, but I don't have a bench power supply to give the FSRs some voltage to test against. I think the speed-of-sound idea could have merit. Due to the speeds involved, it might be something to try implementing on the microcontroller.
User avatar
Tonkabot
Printmaster!
Posts: 251
Joined: Wed Mar 05, 2014 1:28 pm
Location: Minnesota

Re: Using FSRs to triangulate {X, Y} of probed location

Post by Tonkabot »

Remember that the speed of sound in a solid is much faster than in air, something like 3x for some metals.
I would love to see you guys get the triangulation working, but my educated guess is that you will be lucky to get 10 mm accuracy on the position.
Just my guess.

I don't know why you need triangulation from the force sensors anyway. The printer knows [almost] exactly where the head is.
Okay, I re-read the original post and see why you want to triangulate. I just can't imagine the analog force sensors to be accurate enough.
User avatar
626Pilot
ULTIMATE 3D JEDI
Posts: 1716
Joined: Tue May 14, 2013 12:52 pm

Re: Using FSRs to triangulate {X, Y} of probed location

Post by 626Pilot »

If they are not accurate enough, it's still worth trying because we'd know this is an avenue that no longer needs exploration.

As some users have got 0-step (perfect) repeatability, I think their repeatability is within spec. The accuracy is the question.

Also, I was thinking about the speed-of-sound idea. The print surface will get pushed, not at the speed of sound, or even the speed of sound through glass, but at the speed at which the atoms will push against each other. I don't think we are going to measure that with an Arduino. It will have to be done by taking the difference in pressure at the points.
Polygonhell
ULTIMATE 3D JEDI
Posts: 2417
Joined: Mon Mar 26, 2012 1:44 pm
Location: Redmond WA

Re: Using FSRs to triangulate {X, Y} of probed location

Post by Polygonhell »

Tonkabot wrote:Remember that the speed of sound in a solid is much faster than in air, something like 3x for some metals.
I would love to see you guys get the triangulation working, but my educated guess is that you will be lucky to get 10 mm accuracy on the position.
Just my guess.

I don't know why you need triangulation from the force sensors anyway. The printer knows [almost] exactly where the head is.
Okay, I re-read the original post and see why you want to triangulate. I just can't imagine the analog force sensors to be accurate enough.
The reason to know where the head actually is vs where the head actually is, it gives you additional signal to understand the nature of the calibration error and hence a better chance at correcting it.
I don't think you'll be able to get an accurate reading off the difference between the FSR's without considerably more force than you're likely to apply through the hotend.
Best bet for absolute position would probably be to use something like a temporarily mounted optical mouse sensor with some opaque bed cover, but even then you may have issues with the difference in Z affecting the accumulated X/Y position in odd ways.
User avatar
Tonkabot
Printmaster!
Posts: 251
Joined: Wed Mar 05, 2014 1:28 pm
Location: Minnesota

Re: Using FSRs to triangulate {X, Y} of probed location

Post by Tonkabot »

Polygonhell wrote:
The reason to know where the head actually is vs where the head actually is, it gives you additional signal to understand the nature of the calibration error and hence a better chance at correcting it.
I don't think you'll be able to get an accurate reading off the difference between the FSR's without considerably more force than you're likely to apply through the hotend.
Best bet for absolute position would probably be to use something like a temporarily mounted optical mouse sensor with some opaque bed cover, but even then you may have issues with the difference in Z affecting the accumulated X/Y position in odd ways.

Now an optical mouse sensor I can see working well. You could mount it with some Z compliance so that it is always at the bed level.
Of course an optical mouse sensor is an incremental encoder, so you have to have a known home position somewhere.
I would thinK it would work very well on the matte PEI bed.

I also tried a quick calculation and if the FSR's have a 16-bit ADC the resolution would be on the order of 0.0045 mm (300mm/2^16).
A 12-bit ADC would be .07mm. 8 bit gives a whopping 1mm or so resolution. That is assuming that you got the scaling right so you could use the full scale of the sensor and ADC, which I doubt will be easy. Also, 16 bit ADC is resolution is hard to achieve in the real world with wires running a foot from the sensor.

In the picture where I can see the sensors and stepper motors you should at least twist the FSR sensor wires together - that will help with noise suppression.
User avatar
626Pilot
ULTIMATE 3D JEDI
Posts: 1716
Joined: Tue May 14, 2013 12:52 pm

Re: Using FSRs to triangulate {X, Y} of probed location

Post by 626Pilot »

Tonkabot wrote:I also tried a quick calculation and if the FSR's have a 16-bit ADC the resolution would be on the order of 0.0045 mm (300mm/2^16).
How did you arrive at this formula?
User avatar
teoman
ULTIMATE 3D JEDI
Posts: 1770
Joined: Sat May 24, 2014 5:43 pm

Re: Using FSRs to triangulate {X, Y} of probed location

Post by teoman »

Diamater of bed, divided by the number of ppsitions you can measure. Is what he dis i think
When on mobile I am brief and may be perceived as an arsl.
User avatar
Tonkabot
Printmaster!
Posts: 251
Joined: Wed Mar 05, 2014 1:28 pm
Location: Minnesota

Re: Using FSRs to triangulate {X, Y} of probed location

Post by Tonkabot »

626Pilot wrote:
Tonkabot wrote:I also tried a quick calculation and if the FSR's have a 16-bit ADC the resolution would be on the order of 0.0045 mm (300mm/2^16).
How did you arrive at this formula?
Teoman is right, bed diameter/ADC resolution. That is the best you could possibly get from a analog sensor. It is worse than that because the FSR is nonlinear and you'd have to carefully scale the FSR output in order to use the full range of the ADC.
User avatar
626Pilot
ULTIMATE 3D JEDI
Posts: 1716
Joined: Tue May 14, 2013 12:52 pm

Re: Using FSRs to triangulate {X, Y} of probed location

Post by 626Pilot »

This idea is dead. I did a mockup with an FSR kitchen scale and a 1KG weight. The pressure gradient per millimeter was really, really tiny. Far too tiny to measure with FSRs in the 0.1-10KG range. Maybe for a much narrower-ranged FSR, it might be possible, with a 32-bit DAC. (Yeah, it would seriously take a lot.) And then vibrations from the steppers would hose it.

I also did some research into using microphones mounted where the FSRs would be. GPS-like trilateration could work. This would also require a microcontroller with a high-fidelity DAC, and would probably have to sample at 100KHz or better, because of how fast sound propagates through glass. I don't know if that's the best solution either.

I did the math to figure it out, and it's not too bad. Maybe something for another day. Measuring time-in-flight gives you distance. Distance gives you the radii of three circles. Find the circles' intersections - there will be six - then keep only the three intersections that are within all three circles. Their geometric center is the impact point.
Attachments
Circles intersecting.png
Circles intersecting.png (2.24 KiB) Viewed 13242 times
User avatar
Tonkabot
Printmaster!
Posts: 251
Joined: Wed Mar 05, 2014 1:28 pm
Location: Minnesota

Re: Using FSRs to triangulate {X, Y} of probed location

Post by Tonkabot »

Actually, I don't think you would need DACs or ADCs for the sound based system. And actually the speed of sound in the material is probably not needed, either - as long as it is a constant.
[Oops, the speed of sound in a material changes depending on temperature, so you might need the bed to be an even temp throughout]

you would use little piezo circles as your three bed supports, they are also the 'microphones'.

you would also put a little vibrator on the print head (at first I was thinking another piezo, but a pager motor might do) Or maybe just the print head knocking into the build plate is good enough.

So, you start timing, 'tap' the print head into the build plate, wait long enough for the sound to propigate, then read out your timers (1 for each corner).
You have the timer stop when it's piezo crosses a threshold. now you just do math on the results.

You could have the piezo on the print head be the 'start timer' signal, or have it feed into a fourth timer which you use as the start timer signal.

You could also send a ping from one of the corner supports and time it's propagation to the others if you did care or need to know the speed of the sound.




626Pilot wrote:This idea is dead. I did a mockup with an FSR kitchen scale and a 1KG weight. The pressure gradient per millimeter was really, really tiny. Far too tiny to measure with FSRs in the 0.1-10KG range. Maybe for a much narrower-ranged FSR, it might be possible, with a 32-bit DAC. (Yeah, it would seriously take a lot.) And then vibrations from the steppers would hose it.

I also did some research into using microphones mounted where the FSRs would be. GPS-like trilateration could work. This would also require a microcontroller with a high-fidelity DAC, and would probably have to sample at 100KHz or better, because of how fast sound propagates through glass. I don't know if that's the best solution either.

I did the math to figure it out, and it's not too bad. Maybe something for another day. Measuring time-in-flight gives you distance. Distance gives you the radii of three circles. Find the circles' intersections - there will be six - then keep only the three intersections that are within all three circles. Their geometric center is the impact point.
User avatar
Tonkabot
Printmaster!
Posts: 251
Joined: Wed Mar 05, 2014 1:28 pm
Location: Minnesota

Re: Using FSRs to triangulate {X, Y} of probed location

Post by Tonkabot »

I still agree that it is dead, but I don't think you considered that there needs to be a circuit (one or two op-amps) that can offset and scale the FSR's output so that it spans the full scale of your ADC.

example with made up numbers:

For example, you found the FSR your using gave 100K ohm at 0 kg, and 50K ohm at 10 kg.
you make a voltage divider with the FSR using a 75K ohm resistor (to linearize non-linear resistive sensors you want to use a divider resistor that is right in the middle of the range).
You then see that your getting 2.3v at 0kg, and 2.7v at 10kg.
you use an op-amp to offset the 2.3v down to zero [ 0.5 in a practical circuit is better]
you use another op-amp to amplify the signal 10x so you get a range of 0.5v at 0kg to 4.5v at 10kg
[ I am pretty sure you can do both offseting and scaling at the same time with one op-amp ]

Then your ADC is used [nearly] full scale so you measure the range of signals you are interested in.

I agree it is still dead, but it was not as terrible as you thought.
626Pilot wrote:This idea is dead. I did a mockup with an FSR kitchen scale and a 1KG weight. The pressure gradient per millimeter was really, really tiny. Far too tiny to measure with FSRs in the 0.1-10KG range. Maybe for a much narrower-ranged FSR, it might be possible, with a 32-bit DAC. (Yeah, it would seriously take a lot.) And then vibrations from the steppers would hose it.
Post Reply

Return to “Smoothieboard and variants”