Originally shared by D Rob As I was cruising ebay I found this  http://www.ebay.com/itm/Wire-Measuring-Machine-/331157067818?pt=LH_DefaultDomain_0&hash=item4d1a7fd82a

Originally shared by D Rob

As I was cruising ebay I found this http://www.ebay.com/itm/Wire-Measuring-Machine-/331157067818?pt=LH_DefaultDomain_0&hash=item4d1a7fd82a And looking at the design I thought “Why cant we make an active filament measuring device similarly?”. This design would use a spring, 2 x 623vv bearings, a sliding pot, 3 x m3 screws, 1 x m2 screw, and the rest printed. Alternately a second axis, turned 90 degrees, could be added. Calibrate distance from the filament to the nozzle and away we go. My issue is this: my Arduino skills are non-existent. That and lack of firmware support which falls back on my issue again. I made this in all one part with enough space .1mm for each item to be separate. I exported to .stl and cura separated most of it except the top bearing. Any thoughts, ideas, help?

The device you linked to is for measuring length, not diameter.

For measuring length with a slide pot, you would need to mechanically amplify the motion, and you’re going to end up adding resistance and hysteresis in the process of attaching that to the wiper of a slide pot. @Thomas_Sanladerer posted a design for this purpose using a hall effect sensor (non-contact) here: https://www.youmagine.com/designs/filament-diameter-sensor

yeah, I know it was for length but its what inspired the idea. linked with something like this https://www.thingiverse.com/thing:155464 a gear instead of the dial and a rotary pot with a gear. think that would work?

or maybe even hacking a “real” dial indicator.

By mechanically increasing the motion, you’re decreasing torque. I wouldn’t be surprised if the necessary decrease in torque made it unable to move the pot. If you try to stop the dial on a dial indicator, you’ll see that there is essentially zero force making it move, and it takes significantly more force than this to turn a potentiometer. Non-contact sensors like the one @Thomas_Sanladerer used are really a better solution.

My sensor uses an analog hall sensor (zero drag) and mechanical amplifier riding on skateboard bearings (near-zero drag). The weight of the bearing riding on the filament is the only force pushing on the filament and is enough to overcome any static friction in the system.
The accuracy somewhat depends on the algorithm used on the microprocessor, but with ample supersampling and a bit of noise on the ADC, 10µm or better are definitely possible.
The only thing you’ll also need in the assembly is some way to lightly press the filament against the (lower) idler bearing if the filament isn’t perfectly straight. I’ve got the sensor between a pair of filament guides, which have their center line 5mm below the sensor’s.

One thing you want to keep in mind when designing a sensor is the ADC’s resolution and and general mechanical precision. Ideally, you’d want a sliding pot with just 3mm (or 1.75mm) of travel to maximize the voltage change per diameter change.

@Thomas_Sanladerer Actually, you want the travel to be equal to the difference between the minimum and maximum values that you’ll need to measure, or about 10% of the nominal diameter. If filament is not within the range of about 1.7-1.88 (for nominally 1.75) or 2.7-3.0 (for nominally 3.0), all you need to know is that it’s under/over the acceptable range, but you want to measure within that range as precisely as possible. Then you will of course need a precisely-measured test piece to provide your zero-point offset since the zero point is no longer within your range of measurement, which you may be able to do by changing the sensitivity of the mechanism so that it can fist measure the larger range.

Is there a way to integrate a digital dial indicator to output to an Arduino? Or caliper?

@Whosa_whatsis right.
There’s probably no such thing as a 0.175mm sliding pot, but you can get incredibly high resolution by using a hall sensor and a magnet in the right orientation moving along the side of the sensor - it’s usable for a very tight range, (the response kinda looks like plot x^3-x - Wolfram|Alpha) and will only work if you are sure about your range of measurement. I’ve opted for a full-range measurement on my sensor since it’s used as feedback for an extruder, and that needs to occasionally handle large swings, for example at start up.
I’m using lookup tables with linear interpolation for all kind of things, including evaluating the sensor - basically, it’s the thermistor lookup code straight from Marlin. You can empirically calibrate the system (i use drill bit shafts and calipers or a micrometer) and also have it clamp to specific output values when the input goes out of range.

Again, you need to consider the force required to move the calipers, especially if you want to amplify the motion to get more precision. I’m not sure if digital “dial” indicators (in quotes, because the digital ones don’t have dials) have the same data ports, but they would be more appropriate for the application if they do.

And here’s some arduino code: https://sites.google.com/site/marthalprojects/home/arduino/arduino-reads-digital-caliper

The page says that reading the signal requires a transistor on the caliper’s output to raise it to 5V, but the 1.5v output should be more than enough to read a logic high for any of the Atmel chips I’ve seen the datasheets for (I checked the three most commonly used for 3d printer controllers, plus the attiny85 because I’m considering using a trinket or digispark as an intermediate).

It’s probably a worthwhile addition to allow M200 to read filament diameter in this form, so I’ll look into integrating it into Marlin.

Oh, and since you’re only reading from the caliper, not writing, and it outputs a voltage high enough to trigger logic HIGH, no level shifting is necessary.

You will need a source of power to the caliper if you don’t want to run it off of a battery. They’re meant for 1.5v, but I wonder if the circuits can handle 3.3v, which some boards have already available. I just tested one, and a voltage above ~2v made the display unreadable (all segments on), but the data output might still work (though it seems that you need to be able to check the display to ensure that it is in mm mode). If 3.3v is ok, a LD1117V33 would be easy to add if you don’t already have it available, otherwise an LM317 and a couple of resistors (5:1 resistance ratio to produce 1.5v) would work. I also checked the 1.25v that an LM317 produces without a voltage divider, but it didn’t work with the unit I tried, so it’s probably best to just stick with the 1.5v it expects.

These calipers use very little power, so a 10k pot (or fixed resistors) as a voltage divider and a small cap are probably going to work just fine.

Now, the tricky part of an integrated setup using one of these is that you’ll have to zero it (requires removing the filament) after power-up (I think the really expensive ones use a grey code, but the cheap ones count pulses from an assumed zero point the same way we count steps with steppers). So no leaving filament in place between uses.

My cheapos remember their last state on wake up, and wake up upon movement, but that’s with a battery in place. Maybe we could use a setup like the CMOS battery in the system, or alternatively we could simply leave enough room around the point of measurement to move aside the filament zero replace the filament and print. I think calipers with a printed mount for 623 v v bearings and a calibration rod (drill bit?) and then measure the fluctuations from nominal size. this way slicer could tell firmware we are using nominal 1.75 or nominal 3 and gauge the fluctuations, for flow control. True, this isn’t perfect due to non uniform dimensions, but would be a cost and labor friendly method to add more bang without a lot more bucks. Also the use of v v bearings should give more accurate readings than flat ones since they use 4 points of contact as well as being a guide. An extension spring should be sufficient to keep contact with diameter fluctuations

A small-diameter filament will sink deeper into a V groove than a larger-diameter one, which will alter the measurements. Better to use F624 bearings with the flanges arranged on opposite sides to prevent the filament from escaping while keeping the bearings running on a flat surface.

I like the idea of calibrating against a drill bit instead of zero. The firmware could store a variable for the diameter of the calibration bit and use it as an offset when measuring. This would also make it so that the machine wouldn’t end up being entirely non-functional if it powers up without being calibrated, it would just calibrate itself off of the filament left in it and assume that its diameter is equal to the calibration bit (not ideal, but probably better than letting it think that the diameter is zero).

Leaving the battery in and then trying to switch to an external voltage source probably isn’t safe. Unless the battery can be safely trickle-charged (with no cut-off) from the voltage you are putting in, you would have to put a diode in the circuit to keep power from flowing to the battery, and even the forward voltage drop of a schottky diode is probably too high to let these calipers continue functioning. Of course, it would also limit you to using the lowest-quality of the cheap calipers (better low-cost ones power down when you press the power button or they sit too long, while the lower-quality ones only turn off the display and continue to drain the battery).

Yes, the way different filament sizes sit in the v’s is different, but since calibration is against a similar sized object the readings should still be accurate. I also firmly believe the multiple points of contact will provide better readouts since its an automatic average between the points. 2 points of contact will only measure the distance between those points. There may be another bearing with shallower narrower v’s that would be better suited to this application.

Ok, so I did some testing, and despite the fact that the datasheets say it should read HIGH above .6-.8v, mine is reading LOW for any voltage below 2.5v. With the voltage turned up to 2.5v, all segments of the LCD turn on (making it impossible to tell which mode the caliper is in), but otherwise the data output works just fine with that 2.5v logic level. If we were calibrating from zero and then measuring the full diameter, we could probably compensate for this uncertainty because the range of possible values would not overlap, but this won’t work if we’re trying to measure a small offset from the diameter of a calibration object that is close to the size of the filament.

It might be possible to disable the mode button and prevent the mode from being changed from the power-on state by removing the actuator and shorting it out.