Welcome! Log In Create A New Profile

Advanced

z-height sensor 'top hat' light shield with improved target proposal

Posted by Treth 
z-height sensor 'top hat' light shield with improved target proposal
February 21, 2014 03:23AM
This post has been moved from KimBrowns post [forums.reprap.org] as I didn't want to 'corrupt the flow'.

My area of exploration was could a physical shield be applied to the z height sensor to reduce the effects from stray ambient light.

My initial investigations expanded to include the reflective target.

This was initially done some time ago with some (ancient) black "flock paper #55" bits that I had laying around from an old optics project. It is dark black and is like a fine felt material to absorb light.
I made a crude rectangular tube to surround the sensor with a top hat type brim at the bottom.
I also played with fixed targets of white tape as a disk with a ring (washer) of this black stuff.

My logic was that the sensor had a side response sensitivity as evident by the person who posted that they printed a black sensor mount in place of the supplied red and got better performance regarding stray light sensitivity. this was an important post.

The top hat rim acts as a shield to produce a shadow from stray IR light, particularly from above and the complimentary target ring was to reduce light coming from an angle and reflecting into the sensor. The two modifications applied together seems to be very effective with a narrow gap for IR entry and absorbing surfaces (tested with an incandescent torch).

My findings were that this worked exceptionally well in my environment, but I needed time to make it a proper design and test thoroughly before 'publishing', this hasn't happened and I now await DC42's enhanced sensor solution, but this technique could still improve matters for those not needing to print at the corners.

Quote
Radian
@Treth - I understand what you mean about waiting before publishing. If you do get round to it though, I hope you put some photos in your topic.

You prompted me to take the plunge! Unfortunately the holes for the z height sensor have become stripped/loose, so not sure how good my results will be.

These tests are all with an unmodified z-height sensor board, i.e. none of the enhancements provided by DC42 regarding LED current or sensor load resistance, so should be even better with those.

Initial results for stray light (night, hence dark outside), with 3 room incandescent 60W spot lights on at the ceiling on a 180 degree arc at about 2m radius and 2m height.
Lights on 224, lights off 212.

I'll leave in this position (about 2mm nozzle height) and repeat during the day tomorrow.

Any idea what this change in G31 reading is roughly equivalent to mm's?
That will determine whether this test is worth pursuing!

My crude attempts:



Picture has been photoshop'd to make the sensor window (hole) visible.


This has now been moved to below the glass on the aluminium heat spreader.

There can be many improvements, currently this 'floppy' light shield on the sensor clashes with the home sensor lug, but small changes to these printed parts could accommodate this design. A sensor 'clip on' shield would make a nice add on if anyone is willing to design one for testing?
Areas to be cautious of is the homing tab and the area around this as the current parts will dictate a thin and profiled top hat rim in this area.
Also my tape blocks the rear of the sensor from IR as well, which may or may not help?


As you can see this is a very crude setup and was 'on my list' to investigate properly, but here it is for comment. Thanks.


Ormerod #007 (shaken but not stirred!)
Re: z-height sensor 'top hat' light shield with improved target proposal
February 21, 2014 04:21AM
Between readings I did some searching. Dmould it was your suggestions [forums.reprap.org] that triggered these thoughts!


Day time test results.
This is from Cornwall in SW England.
The X axis is pointing East with French doors and windows to the side about 3m from the bed, so is quite open to sun light/sunrise, but the sun moves away from shining directly on the printer bed as it rises.
Today is sunny!

Time Reading Comments
7:10 207 Day break room lights off (minimum recorded for the test duration)
7:16 219 Room lights on (as previous days test)
8:00 232 Sunrise at low angle shining onto bed (through trees)
8:01 235
8:02 236
8:03 240
8:04 238
8:05 236 Direct light still through trees and probably now obscured by central doors frame....
8:07 234
8:10 246
8:15 249
8:20 245
8:21 245
8:21 233 Turned room lights off
8:21 245 Room lights back on
8:21 233 Room lights off and left off
8:30 236
8:35 239 Sun becoming brighter, but now not direct on printer but on walls.
8:37 241
8:45 241 Bright sunny day.... quite a lot of light on the bed now
8:50 256
8:55 281 Sun now moving away fro bed area, noticed tree shadows causing fast fluctuations, so I'm recording peak values.
9:00 252 Value has been decreasing now so presume past this peak
9:05 245
9:10 240 Got to work now........
EDIT
9:43 212 Sun gone and raining..... Room lights still off (225 room lights on)
End EDIT

Not as good as I had hoped, but nothing to compare with.
A top reflective sensor would be better form my torch test, but in conjunction with DC42 modulated sensor may just make a small further improvement.

Thoughts

Edited 1 time(s). Last edit at 02/21/2014 04:55AM by Treth.


Ormerod #007 (shaken but not stirred!)
Re: z-height sensor 'top hat' light shield with improved target proposal
February 21, 2014 08:41AM
Yes, after my initial jubilation at the improvement a black housing made, I found that the improvement, although considerable, was not enough to provide reliable Z homing in changing light situations, and it was easier to set the Z height by hand than cover the printer with a binbag every time I wanted to home the Z axis! Further experimentation as well as your test results has made me conclude that the IR method as originally designed is simply not going to work satisfactorily no matter what mechanical changes are made. Perhaps the modulated LED idea is a viable solution (especially in combination with these light shields), but automatic Z homing / bed compensation is a low priority for me at present, and I'll sit back (lazy sod that I am!) and see how the various other technologies people are developing pan out. I am hoping to need a sensor only for homing, not bed compensation, because I plan on modifying the bed so that it does not move and is mechanically adjusted to remain completely level - which will not only ease the setting up, but also greatly reduce wear on the Z lead screw, which I am hoping will last years without modification if it is used only to change layers rather than moving continuously throughout a print.

Dave
(#106)
Re: z-height sensor 'top hat' light shield with improved target proposal
February 22, 2014 06:34AM
Treth, how steady are your G31 readings if you repeatedly issue them in quick succession? I always see a spread of up to 7 counts.


RS Components Reprap Ormerod No. 481
Re: z-height sensor 'top hat' light shield with improved target proposal
February 22, 2014 07:44AM
Quote
Radian
Treth, how steady are your G31 readings if you repeatedly issue them in quick succession? I always see a spread of up to 7 counts.

If you are powering the Duet from the 12V supply via the switching regulator, then the connections between the sensor board and the Duet pick up noise from the regulator. See [forums.reprap.org].



Large delta printer [miscsolutions.wordpress.com], E3D tool changer, Robotdigg SCARA printer, Crane Quad and Ormerod

Disclosure: I design Duet electronics and work on RepRapFirmware, [duet3d.com].
Re: z-height sensor 'top hat' light shield with improved target proposal
February 22, 2014 03:47PM
Quote
dc42
Quote
Radian
Treth, how steady are your G31 readings if you repeatedly issue them in quick succession? I always see a spread of up to 7 counts.

If you are powering the Duet from the 12V supply via the switching regulator, then the connections between the sensor board and the Duet pick up noise from the regulator. See [forums.reprap.org].
Hi Radian and DC42,
I think I missed most of the previous sensor electrical noise discussions.
From what you state, my results will probably not be truly 'realistic'. I decided to power the DUET via the USB from my laptop to avoid fan noise and the any possibility of the motors moving if I needed to power down/up to get further results.

Last night I removed the top hat, but kept the target below the glass on the heat spreader to get a set of 'unshielded' results, which I shall present later, but I have just done a set of repeated G31's in quick succession with room lights on. This was the sequence.
241 x2; 240; 241 x2; 240 x2; 241 x6; 242; 241 x23; 242; 241 x9
= 3@240, 42@241 and 2@242

With the Alpine PSU powered up I get:

241 x2; 240; 241; 240 x2; 242; 241; 242; 241 x3; 242; 241 x6; 242; 243; 241 x3; 240; 241 x2; 243; 240; 241 x6 240 x2; 241; 242; 240 x2; 240; 241 x2; 242; 241 x3
= 10@240, 30@241, 6@242, 1@243

As above, but with bed heater on, i.e. heating up.

240; 239; 238; 239 x3; 241 x2; 239; 240 x3; 239; 241; 238; 240 x3; 239; 240; 239 x6; 240; 239; 240 x2; 239 x6; 240; 239; 240; 238; 239; 240 x6
= 3@238, 22@239, 19@240, 3@241



I'll post my other results later.


Ormerod #007 (shaken but not stirred!)
Re: z-height sensor 'top hat' light shield with improved target proposal
February 22, 2014 04:29PM
Treth, can you confirm that JP9 was removed for those tests?



Large delta printer [miscsolutions.wordpress.com], E3D tool changer, Robotdigg SCARA printer, Crane Quad and Ormerod

Disclosure: I design Duet electronics and work on RepRapFirmware, [duet3d.com].
Re: z-height sensor 'top hat' light shield with improved target proposal
February 22, 2014 04:33PM
Hi Treth,

it looks like a pretty significant increase in standard deviation - it would be interesting to see zero-signal versions too (ie with light-proof paper over the photodetector), to show electronic noise isolated from optical signal variation (although you'd probably only see one side of the distribution providing there's no offset). [edit - it would be interesting to see if rerouting the signal as dc42 did also works for you with the external power and load connected)[edit]

Ray

Edited 1 time(s). Last edit at 02/22/2014 04:35PM by rayhicks.
Re: z-height sensor 'top hat' light shield with improved target proposal
February 22, 2014 04:55PM
Here are my results for Day 2 without the TopHat interspersed with the previous TopHat results.
Although these are obviously different days, the start of the day regarding sunshine and cloud were amazingly similar, so could be a useful comparison.

Key observations were that with the top hat the effect of the stray light is much reduced from both the sunlight and the room lights.
The change in reading with the room lights on and off was consistent at differing levels of sunlight reading.
My opinion is that this shows the Top Hat could be a valuable addition with the other proposals for modulation and IR intensity etc.

I hope the following presentation of data is clear.

Time Day1 Top Hat Day 2 NO Top Hat Comments
7:10 207 Day break room lights off (minimum recorded for the test duration)
7:16 219 Room lights on (as previous days test) NOTE Diff=12 with Top Hat
7:20 219 lights OFF (just coincidence of reading with Day1 lights on)
7:20 251 lights ON and left on until noted.
NOTE diff=32
7:30 261
7:55 314

8:00 232 Sunrise at low angle shining onto bed (through trees)
8:01 235
8:01 339
8:02 236
8:03 240
8:04 238
8:04 361
8:05 236 Direct light still through trees and probably now obscured by central doors frame....
8:07 234
8:10 246
8:15 249
8:20 245
8:20 404
8:21 245
8:21 233 Turned room lights off
8:21 245 Room lights back on NOTE Diff = 12 with TopHat
8:21 233 Room lights off and left off
8:25 371
8:28 368
8:28 337 Room lights OFF
NOTE diff = 31
8:30 236
8:30 322
8:35 239 Sun becoming brighter, but now not direct on printer but on walls.
8:35 354
8:37 241
8:45 241 Bright sunny day.... quite a lot of light on the bed now
8:45 963
8:50 256
8:55 281 Sun now moving away from bed area....
9:00 252 Value has been decreasing now so presume past this peak
9:05 245
9:10 240
9:12 382
9:40 985

9:43 212 Sun gone and raining..... Room lights still off (225 room lights on)

Having done these tests, I aim to try something similar with the reflective sensor on the top surface of the glass (this should in my view reduce sensitivity to stray IR and maximise the desired reflectance..
My thoughts here are in line I believe with what KimBrown (and others?) have said, that the reflective sensor should be as small as possible to match the working area of the sensor and everything outside of this should have the minimum IR reflectance possible. Obviously this assume a single point zero setting/ z axis reference and a well levelled rigid bed as produced by DC42 and others, or at least reflective spots in the 'levelling' positions.


Ormerod #007 (shaken but not stirred!)
Re: z-height sensor 'top hat' light shield with improved target proposal
February 22, 2014 04:57PM
Quote
dc42
Treth, can you confirm that JP9 was removed for those tests?
J9 was present for all tests.
The USB lead remained connected also, the only difference was switching on the ATX PSU.


Ormerod #007 (shaken but not stirred!)
Re: z-height sensor 'top hat' light shield with improved target proposal
February 22, 2014 05:27PM
Looks like a good belt to use before dc42 produces his braces - the combination of both should be synergistic. It's quite astonishing to see the level go up to >900 on more than one occasion (hard to do a fully controlled run with sunlight being a variable, and I presume you used just room light for the previous figures since you posted in the evening - will you have time to repeat with hats off and on tomorrow morning?)

Cheers

Ray

Edited 1 time(s). Last edit at 02/22/2014 05:27PM by rayhicks.
Re: z-height sensor 'top hat' light shield with improved target proposal
February 22, 2014 05:31PM
Quote
rayhicks
Hi Treth,

it looks like a pretty significant increase in standard deviation - it would be interesting to see zero-signal versions too (ie with light-proof paper over the photodetector), to show electronic noise isolated from optical signal variation (although you'd probably only see one side of the distribution providing there's no offset). [edit - it would be interesting to see if rerouting the signal as dc42 did also works for you with the external power and load connected)[edit]

Ray
Hi Ray, I did the best I could here and turned off all tungsten lights and only left on some CFLs (wall lights) in an adjoining room.
I turned the bed heater on and did the tests at about 30 to 35C reported temperature.

208 x2; 207; 208 x9; 207; 208; 207; 209; 208 x2; 207; 209; 207 x2; 208; 210; 205; 208 x3; 206; 208 x2; 209; 208; 209 x2; 208; 211; 208; 207; 208; 207 x2; 209 x2; 208 x2; 209 x 2; 207; 208 x2.
= 1@205, 1@206, 10@207, 27x208, 6@209, 1@210 and 1@211

NOTE to overlay this set of data I added 30 to the readings to bring onto the previous graphs.




Obviously these are a small sample set, but this last set might match with what others are seeing, having captured some of the outliers.


(With all the lights back on the reading is up at 236/237 and running on USB only it remains at 236/237).


Ormerod #007 (shaken but not stirred!)
Re: z-height sensor 'top hat' light shield with improved target proposal
February 22, 2014 05:42PM
Quote
rayhicks
Looks like a good belt to use before dc42 produces his braces - the combination of both should be synergistic. It's quite astonishing to see the level go up to >900 on more than one occasion (hard to do a fully controlled run with sunlight being a variable, and I presume you used just room light for the previous figures since you posted in the evening - will you have time to repeat with hats off and on tomorrow morning?)

Cheers

Ray
I was very lucky with the weather and sunrise for these two days (which was shining at a low angle on the z axis just above the x axis, so close to the sensor for direct light and certainly bright in that vicinity at the peaks seen).
The repeated readings done tonight were in room light which seems very stable regarding its impact.

'Storms' tomorrow (in fact here now!), so probably no sunrise!

I think trying to optimise the reflective sensor size using the ceiling lights as the interfering IR would be a useful exercise, but i'll see what time I get. My top hap is a sticky felt like material and difficult to assemble for a 'free space' structure as you probably noted in my pic's, so I would quite like to move this on to something more robust.
Any 3D printers out there willing to try something simple in black?


Ormerod #007 (shaken but not stirred!)
Re: z-height sensor 'top hat' light shield with improved target proposal
February 22, 2014 06:46PM
Interesting - it looks like (from the first set of data with top hat) the PSU adds variance around the same mean that you get with USB only (ie, there's a +/- background waveform imposed on the same signal), when you start the bed heater, the signal mean drops, as well as the variance increasing further (maybe due to drop in excitation voltage, although this should be regulated still by the 3.3V regulator even if the 12V line drops, maybe it's an effect of high frequency noise pulses pulling the signal down) .

Your dark test isn't quite what I'd hoped for though, (although it again shows that there's a greater variance with the PSU and Heater on compared to the USB data) - I'd hoped that you could record with a blanked off detector (so that it couldn't receive the IR from anywhere, including the LED) - this would have removed actual signal and just shown the noise due to electronic background - I'll give this a go on Monday (if I can find my probe! - I haven't seen it for a couple of weeks, since I took it off - I imagine I put it somewhere sensible) and see what I get.

Cheers

Ray

PS - hopefully the sun WILL rise tomorrow, or we're really screwed smiling smiley

Edited 1 time(s). Last edit at 02/22/2014 06:46PM by rayhicks.
Re: z-height sensor 'top hat' light shield with improved target proposal
February 23, 2014 12:14AM
I think the only way to get reasonable reads where the light varies is to have a second sensor reading the ambient light, then subtracting that from the probe reading. If I was going down that road, then a Pic could be used to do the calculation, and also take a quick burst of readings that it could average out. I might have a go one day soon if any one knows the details of the sensor. In the mean time, I'm quite happy using my Red Glass, but after I get home the Bed is in for a total re-vamp first. After an hour or more leveling the other day, the beds shifted AGAIN on my printer. But it is a harsh environment here to be fair..


Please send me a PM if you have suggestions, or problems with Big Blue 360.
I won't see comments in threads, as I move around to much.
Working Link to Big Blue 360 Complete
Re: z-height sensor 'top hat' light shield with improved target proposal
February 23, 2014 06:00AM
Hi Kim - the problem with that strategy is that the two detectors would have to be pointing at the same place from the same angle to ensure that they receive the same ambient light, and the second sensor would then need to be shielded from the IR transmitter. Modulation (which is part of dc42's mod board and firmware) allows you to achieve something similar to this using only one detector- you toggle the transmitter LED on and off rapidly, and measure the detector output in both states, then subtract the "dark" signal from the signal you get when the LED is on.

As I understand it, dc42's also increased the current driving the LED and biased the receiving transistor so that it's less sensitive all round and had some improvement before modulating - the top hat would make the sensitivity mods perhaps redundant since it seems to cut the contribution from ambient light significantly. He's also rerouted the signal wire so it picks up less electrical noise (of which there's quite a bit from Treth's data above, seemingly coming from the SMPS and presumably the PWM on the extruder heater - perhaps it should be a shielded cable)

Cheers

Ray

Edited 1 time(s). Last edit at 02/23/2014 06:07AM by rayhicks.
Re: z-height sensor 'top hat' light shield with improved target proposal
February 23, 2014 06:20AM
Quote
KimBrown
then a Pic could be used to do the calculation, and also take a quick burst of readings that it could average out.

Averaging would be good, I don't know if dc42's doing that - a robust estimator like the median would be best judging from Treth's low speed data - it would ignore the huge outliers (900+) where the mean would end up being between the outliers and the bulk of correct readings - ideally it should be used for the dark signal too.

One drawback of the median is that you can't do it "in place" in the same way as the mean, and you have to accumulate the different readings in a buffer then rank/sort them and find the middle value, so it adds a lot to the time needed (and memory for the two buffers)

Ray
Re: z-height sensor 'top hat' light shield with improved target proposal
February 23, 2014 06:49AM
The current firmware takes a sensor reading every 6ms and the value returned is the average of the last 8 readings. For my dumb modulated sensor, this is difference between the average of 4 readings with the IR on and 4 readings with the IR off. I'm planning to change the firmware to run the ADC in the background and take readings at a higher sample rate, probably every 1ms or so. This will permit averaging over a larger number of readings.



Large delta printer [miscsolutions.wordpress.com], E3D tool changer, Robotdigg SCARA printer, Crane Quad and Ormerod

Disclosure: I design Duet electronics and work on RepRapFirmware, [duet3d.com].
Re: z-height sensor 'top hat' light shield with improved target proposal
February 23, 2014 09:48AM
AAAaaaaaa I see DC, that negates the need of an ambient sensor then. Better still it's getting the ambient from the same place.
Yep I like that..smoking smiley
If you also enabled/disabled the networking side of the firmware in an external file like the config file so that those of us that only use the USB interface, then that would be great... Just a simple on/off (default on for compatability) command line could cut out the wait time.


Please send me a PM if you have suggestions, or problems with Big Blue 360.
I won't see comments in threads, as I move around to much.
Working Link to Big Blue 360 Complete
Sorry, only registered users may post in this forum.

Click here to login