Hey, I've been working on an optical sensor that measures the filament caliper in real time. The idea is to control the rate of extrusion based on the sensor to compensate for varying filament widths. At this point I have it integrated with my printer firmware (Marlin), but have not done much testing yet. Part of the reason is that my current filament does not have a lot of variation.
Sensor uses an optical linear array with 400dpi interfaced to a microcontroller. The microcontroller controls the brightness of the illuminating LED. The filament casts a shadow on the sensor, and the microcontroller detects the edges of the shadow and determines the width. I found a simple sub-pixel edge detection approach online that seems to give roughly .01-.03 mm accuracy. The sensor itself puts out a voltage in relation to the width. For example, 2.84v means 2.84mm. This can easily be interfaced to the A-D of a 3D printer controller board.
A nice feature is that the gcode does not need to be updated for changes in filament width, since that now becomes a variable within the firmware. Gcode is created using the nominal width of 3mm for my filament, but the extruder rate factor is modified in real time based on estimated cross-sectional area of the filament.
Here are the details: [www.thingiverse.com]
One major to-do is to determine a way to have the sensor measure the cross sectional area, since it only measures the diameter along a single radius. Current thought is to scan it over 180 degrees of the filament and then combine the results. Scanning could be achieved by an RC servo. Seems like the simplest way so far...
Another is to try it with some filament that has a lot of variation and see if it makes a difference...
Sensor uses an optical linear array with 400dpi interfaced to a microcontroller. The microcontroller controls the brightness of the illuminating LED. The filament casts a shadow on the sensor, and the microcontroller detects the edges of the shadow and determines the width. I found a simple sub-pixel edge detection approach online that seems to give roughly .01-.03 mm accuracy. The sensor itself puts out a voltage in relation to the width. For example, 2.84v means 2.84mm. This can easily be interfaced to the A-D of a 3D printer controller board.
A nice feature is that the gcode does not need to be updated for changes in filament width, since that now becomes a variable within the firmware. Gcode is created using the nominal width of 3mm for my filament, but the extruder rate factor is modified in real time based on estimated cross-sectional area of the filament.
Here are the details: [www.thingiverse.com]
One major to-do is to determine a way to have the sensor measure the cross sectional area, since it only measures the diameter along a single radius. Current thought is to scan it over 180 degrees of the filament and then combine the results. Scanning could be achieved by an RC servo. Seems like the simplest way so far...
Another is to try it with some filament that has a lot of variation and see if it makes a difference...