Maker Pro
Maker Pro

Long term stability and calibration issues

C

Charlie E.

Jan 1, 1970
0
Hi All,
Ok, it is color reader time again! This thing is startingto drive me
crazy... or crazier, anyway!

Here is the problem. I take a unit. I test it in debug mode, taking
multiple samples of various materials. I get a series of values and
calibrations that will reliably read all the different color
distinctions I need. I build it into a release version, and move the
unit from my test enclosure to a permanent enclosure. All the
calibrations are off, the color ranges are flakey, and it doesn't work
well enough to give away, much less sell!

So, what could be causing such gross changes in my calibration? The
cases are identical, except for the two holes to allow the
programing/debug cable access. Even when I move the unit back into
the original case, it is still off in calibration. Am I just trying
to get more accuracy out of this sensor than it can provide?

A copy of the schematic is here:
http://edmondsonengineering.com/Documents/Rainbow Color Reader fact sheet.pdf
For a recap on the circuit:

I have three SM RA LEDs, red, green and blue on the top of the board
powered off a 20mA supply and switched through a couple of compl.
mosfets.

On the bottom of the board, I have an TEPT4400 ambient light
sensor/photo transistor, collector to 3.3VDC emitter to 12.4K resistor
feeding a buffer opamp with a 10K digital pot in series with 50K to
provide an adjustible gain amplifier. This goes through a low pass
filter of 1Kohm/.1uF to the ADC of my PIC24FJ128. It also feed to a
second stage of the opamp with a fixed 3X gain to another ADC input.

Basic calibration is to place a known white sample (white felt) and
turn on one of the LEDs. I adjust the digpot to get a reading of 2000
to 2020 out of a range of 2048. I then turn that LED off, turn on the
next, and remeasure. After I have all three colors calibrated, I then
put a known black sample, and measure my 'black' levels. I then scale
the measured levels in color between these two levels.

My gain settings keep varying between 3-5 steps for the white levels,
and the measured black level (typicall between 250 and 400) varies by
almost 100 points! In any one session they stay pretty stable, but
the next morning everything is way off.

So, any ideas what I am doing wrong? Any suggestions to improve
things?
 
M

Martin Riddle

Jan 1, 1970
0
Charlie E. said:
Hi All,
Ok, it is color reader time again! This thing is startingto drive me
crazy... or crazier, anyway!

Here is the problem. I take a unit. I test it in debug mode, taking
multiple samples of various materials. I get a series of values and
calibrations that will reliably read all the different color
distinctions I need. I build it into a release version, and move the
unit from my test enclosure to a permanent enclosure. All the
calibrations are off, the color ranges are flakey, and it doesn't work
well enough to give away, much less sell!

So, what could be causing such gross changes in my calibration? The
cases are identical, except for the two holes to allow the
programing/debug cable access. Even when I move the unit back into
the original case, it is still off in calibration. Am I just trying
to get more accuracy out of this sensor than it can provide?

A copy of the schematic is here:
http://edmondsonengineering.com/Documents/Rainbow Color Reader fact sheet.pdf
For a recap on the circuit:

I have three SM RA LEDs, red, green and blue on the top of the board
powered off a 20mA supply and switched through a couple of compl.
mosfets.

On the bottom of the board, I have an TEPT4400 ambient light
sensor/photo transistor, collector to 3.3VDC emitter to 12.4K resistor
feeding a buffer opamp with a 10K digital pot in series with 50K to
provide an adjustible gain amplifier. This goes through a low pass
filter of 1Kohm/.1uF to the ADC of my PIC24FJ128. It also feed to a
second stage of the opamp with a fixed 3X gain to another ADC input.

Basic calibration is to place a known white sample (white felt) and
turn on one of the LEDs. I adjust the digpot to get a reading of 2000
to 2020 out of a range of 2048. I then turn that LED off, turn on the
next, and remeasure. After I have all three colors calibrated, I then
put a known black sample, and measure my 'black' levels. I then scale
the measured levels in color between these two levels.

My gain settings keep varying between 3-5 steps for the white levels,
and the measured black level (typicall between 250 and 400) varies by
almost 100 points! In any one session they stay pretty stable, but
the next morning everything is way off.

So, any ideas what I am doing wrong? Any suggestions to improve
things?

Temperature stability of the TEPT4400. My guess, if every thing else is
soild.
It doesn't look that stable from the data sheet.
Have you seen this?
http://www.homecinema-fr.com/colorimetre/index_en.php
It uses the TAOS sensors.

Cheers
 
M

Martin Brown

Jan 1, 1970
0
Temperature variation?? If the LED o/p& photosensors have a large tempco
then that could cause problems. Some enviromental sensors using leds/optics
have temp sensors co-located with the LED& sensor to compensate.

Try a calibration, wave a heat lamp near it and see what happens (without
moving or changing the housing).

My money is on tempco of the sensor dark current and sensitivity. That
sensor has a dark current at room temperature that varies by 10x for 20C
or 4% / degree C and relative sensitivity varies by 1% / degree C.

http://www.vishay.com/docs/81341/81341.pdf

It might also need a "hot mirror" IR blocking filter to stop it being
fooled when under IR rich incandescent lights. Sensitivity is still 50%
at 800nm. Most alternative photodiodes will need a blocking filter.

Unless it is temperature compensated or maintained at constant
temperature then I would expect pretty bad drift. A can of freezer spray
or a hair dryer will quickly confirm this hypothesis.

It is likely the LEDs will also show some tempco in the opposite sense
as cooling them typically increases efficiency slightly.

Regards,
Martin Brown
 
L

legg

Jan 1, 1970
0
Hi All,
Ok, it is color reader time again! This thing is startingto drive me
crazy... or crazier, anyway!

Here is the problem. I take a unit. I test it in debug mode, taking
multiple samples of various materials. I get a series of values and
calibrations that will reliably read all the different color
distinctions I need. I build it into a release version, and move the
unit from my test enclosure to a permanent enclosure. All the
calibrations are off, the color ranges are flakey, and it doesn't work
well enough to give away, much less sell!

So, what could be causing such gross changes in my calibration? The
cases are identical, except for the two holes to allow the
programing/debug cable access. Even when I move the unit back into
the original case, it is still off in calibration. Am I just trying
to get more accuracy out of this sensor than it can provide?

A copy of the schematic is here:
http://edmondsonengineering.com/Documents/Rainbow Color Reader fact sheet.pdf
For a recap on the circuit:

I have three SM RA LEDs, red, green and blue on the top of the board
powered off a 20mA supply and switched through a couple of compl.
mosfets.

On the bottom of the board, I have an TEPT4400 ambient light
sensor/photo transistor, collector to 3.3VDC emitter to 12.4K resistor
feeding a buffer opamp with a 10K digital pot in series with 50K to
provide an adjustible gain amplifier. This goes through a low pass
filter of 1Kohm/.1uF to the ADC of my PIC24FJ128. It also feed to a
second stage of the opamp with a fixed 3X gain to another ADC input.

Basic calibration is to place a known white sample (white felt) and
turn on one of the LEDs. I adjust the digpot to get a reading of 2000
to 2020 out of a range of 2048. I then turn that LED off, turn on the
next, and remeasure. After I have all three colors calibrated, I then
put a known black sample, and measure my 'black' levels. I then scale
the measured levels in color between these two levels.

My gain settings keep varying between 3-5 steps for the white levels,
and the measured black level (typicall between 250 and 400) varies by
almost 100 points! In any one session they stay pretty stable, but
the next morning everything is way off.

So, any ideas what I am doing wrong? Any suggestions to improve
things?

Your enclosure looks fairly translucent.

The optics area should probably be constructed of a white-card
light-blocking material.

RL
 
C

Charlie E.

Jan 1, 1970
0
Temperature stability of the TEPT4400. My guess, if every thing else is
soild.
It doesn't look that stable from the data sheet.
Have you seen this?
http://www.homecinema-fr.com/colorimetre/index_en.php
It uses the TAOS sensors.

Cheers
\
I looked at teh Taos sensors, but they have three problems.

1. They are difficult to get to work reliably, as there are
calibration and setup values that are under specified.

2. They can be quite expensive! I am trying to get this as low cost
as possible.

3. They are close to being obsoleted by the manufacturer! You can
barely find them on their website. I don't think sales were what they
had hope for.

Thanks!!!!

Charlie
 
C

Charlie E.

Jan 1, 1970
0
Your enclosure looks fairly translucent.

The optics area should probably be constructed of a white-card
light-blocking material.

RL

Ok, one more detail. The sensor area is surrounded by black cardboard
above and below the width of the case, with a half inch square hole
directly in front of the sensors and providing the aperature through
the front clear window.

Charlie
 
C

Charlie E.

Jan 1, 1970
0
Hi All,
Ok, it is color reader time again! This thing is startingto drive me
crazy... or crazier, anyway!

Here is the problem. I take a unit. I test it in debug mode, taking
multiple samples of various materials. I get a series of values and
calibrations that will reliably read all the different color
distinctions I need. I build it into a release version, and move the
unit from my test enclosure to a permanent enclosure. All the
calibrations are off, the color ranges are flakey, and it doesn't work
well enough to give away, much less sell!

So, what could be causing such gross changes in my calibration? The
cases are identical, except for the two holes to allow the
programing/debug cable access. Even when I move the unit back into
the original case, it is still off in calibration. Am I just trying
to get more accuracy out of this sensor than it can provide?

A copy of the schematic is here:
http://edmondsonengineering.com/Documents/Rainbow Color Reader fact sheet.pdf
[snip]

That's not a schematic.

...Jim Thompson

Darn, got the link above it!
http://edmondsonengineering.com/Documents/RCR5 _ LED-PT-BUF.pdf

;-)

Charlie
 
C

Charlie E.

Jan 1, 1970
0
Alternative: modulate the LEDs, and make a synchronous detector in
software. That eliminates background light, and you won't need as
much filtering (just enough so the detector doesn't rail).

Actually, in most of my test cases so far, outside light has not been
a problem. The case, while an almond color, does a pretty good job of
reducing the spill light. The cardboard insde does a good job of
reducing that spill to very low levels. I do measure background
illumination (one function is to test if a light is on, or not) and,
even with the same gain levels as for the LEDs, I typically get levels
of around 10-15 (out of 2048) and I compensate for that in software...

Charlie
 
C

Charlie E.

Jan 1, 1970
0
[snip]
A copy of the schematic is here:
http://edmondsonengineering.com/Documents/Rainbow Color Reader fact sheet.pdf
[snip]

That's not a schematic.

...Jim Thompson

Darn, got the link above it!
http://edmondsonengineering.com/Documents/RCR5 _ LED-PT-BUF.pdf

;-)

Charlie

You're dealing in DC, plus tempco's, plus distance to colored object.

Perhaps "rotating" pulsing of LED's (from same _current_source_) and
look at the relative outputs "simultaneously"?

...Jim Thompson
Hmmm...

Object is designed to be pressed against the front window, so distance
is always pretty much the same.

Are you thinking to PWM the LEDs? Or just turn on - measure- turn
off- measure-turn on-measure?

Thanks,
Charlie
 
M

Martin Brown

Jan 1, 1970
0
Might be worth a try crudely compensating the gain with an NTC
thermistor if thermal drift can be proven as the root cause.
Alternative: modulate the LEDs, and make a synchronous detector in
software. That eliminates background light, and you won't need as
much filtering (just enough so the detector doesn't rail).

That is probably the right solution and uses half as much power to the
LEDs. This would eliminate all DC components. Setting the integration
period to be 1/60s or a multiple would be a good idea.

Regards,
Martin Brown
 
L

legg

Jan 1, 1970
0
How fast does calibration run?

How are you sequencing supply/lamp signals?
You should never have all lamps disabled, while the MCP boost
converter is running, or you'll biuld a large charge on its output
storage cap. I'd recommend some kind of 'outside the processor' glue
logic to prevent this from happening.

When switching from one colour to another, their conduction should
overlap.

RL
 
M

Martin Riddle

Jan 1, 1970
0
Charlie E. said:
Hi All,
Ok, it is color reader time again! This thing is startingto drive me
crazy... or crazier, anyway!

Here is the problem. I take a unit. I test it in debug mode, taking
multiple samples of various materials. I get a series of values and
calibrations that will reliably read all the different color
distinctions I need. I build it into a release version, and move the
unit from my test enclosure to a permanent enclosure. All the
calibrations are off, the color ranges are flakey, and it doesn't
work
well enough to give away, much less sell!

So, what could be causing such gross changes in my calibration? The
cases are identical, except for the two holes to allow the
programing/debug cable access. Even when I move the unit back into
the original case, it is still off in calibration. Am I just trying
to get more accuracy out of this sensor than it can provide?

A copy of the schematic is here:
http://edmondsonengineering.com/Documents/Rainbow Color Reader fact sheet.pdf
[snip]

That's not a schematic.

...Jim Thompson

Darn, got the link above it!
http://edmondsonengineering.com/Documents/RCR5 _ LED-PT-BUF.pdf

;-)

Charlie

The Vcc connection to the TEPT440 might cause trouble. How clean is
that?
Why not use Vled? It would eliminate differences between supplies.

Cheers
 
C

Charlie E.

Jan 1, 1970
0
How fast does calibration run?

How are you sequencing supply/lamp signals?
You should never have all lamps disabled, while the MCP boost
converter is running, or you'll biuld a large charge on its output
storage cap. I'd recommend some kind of 'outside the processor' glue
logic to prevent this from happening.

When switching from one colour to another, their conduction should
overlap.

RL

Actually, I set the LED fets on, then activate the power supply,
measure, and then turn off the power supply, then switch the mosfets.
I am always careful to have the LEDs switched BEFORE activating the
power supply...
 
C

Charlie E.

Jan 1, 1970
0
Charlie E. said:
Hi All,
Ok, it is color reader time again! This thing is startingto drive me
crazy... or crazier, anyway!

Here is the problem. I take a unit. I test it in debug mode, taking
multiple samples of various materials. I get a series of values and
calibrations that will reliably read all the different color
distinctions I need. I build it into a release version, and move the
unit from my test enclosure to a permanent enclosure. All the
calibrations are off, the color ranges are flakey, and it doesn't
work
well enough to give away, much less sell!

So, what could be causing such gross changes in my calibration? The
cases are identical, except for the two holes to allow the
programing/debug cable access. Even when I move the unit back into
the original case, it is still off in calibration. Am I just trying
to get more accuracy out of this sensor than it can provide?

A copy of the schematic is here:
http://edmondsonengineering.com/Documents/Rainbow Color Reader fact sheet.pdf
[snip]

That's not a schematic.

...Jim Thompson

Darn, got the link above it!
http://edmondsonengineering.com/Documents/RCR5 _ LED-PT-BUF.pdf

;-)

Charlie

The Vcc connection to the TEPT440 might cause trouble. How clean is
that?
Why not use Vled? It would eliminate differences between supplies.

Cheers
VLED is actually a constant current source, not a voltage per se. Vcc
is as clean as I can get it, and in common with the MCU and the
opamps...
 
C

Charlie E.

Jan 1, 1970
0
Do the cal procedure and then change the temperature by 10 C and check
the cal. Does it repeat? If not, you may be able to put a temp sensor
in the unit and have multiple cal tables for different temps. High-gain
amps, photodiodes and even LEDs are very sensitive to temperature
changes. The leakage "dark current" of a photodiode usually changes a
factor of 2 over 10 C change. If that is all it is, maybe you could
just have the device do a LEDs-off zero set every time it is turned on.

Jon

Jon,
that is an interesting idea. I do take a reading with no LEDs, mainly
to get a feel for any leaking ambient. Wonder if there is any way I
can take that info for calibration adjustments...

Charlie
 
L

legg

Jan 1, 1970
0
Actually, I set the LED fets on, then activate the power supply,
measure, and then turn off the power supply, then switch the mosfets.
I am always careful to have the LEDs switched BEFORE activating the
power supply...

You'll want to make sure that the supply doesn't transition into 'PFM'
mode, as the light output of the leds may become unpredictable with
respect to 'average' current. A straight capacitive filter can't
remove this from the current waveform.

MCP1640 might be happier with higher impedances in series with the FB
pin. The app notes all expect >100K.

RL
 
C

Charlie E.

Jan 1, 1970
0
You'll want to make sure that the supply doesn't transition into 'PFM'
mode, as the light output of the leds may become unpredictable with
respect to 'average' current. A straight capacitive filter can't
remove this from the current waveform.

MCP1640 might be happier with higher impedances in series with the FB
pin. The app notes all expect >100K.

RL

I checked with them on the FB impedance. The large values are just
there to reduce power, so you aren't wasting power in your feedback
network. Works fine with this app. I use the 1640 variant that
doesn't have the PFM mode...

Charlie
 
Top