Using FSRs to triangulate {X, Y} of probed location
Posted: Mon Mar 16, 2015 9:00 pm
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?
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?