CHDKPTP: S90 Primary Focal Plane Configuration - hacking out the CCD - page 45 - Creative Uses of CHDK - CHDK Forum  

CHDKPTP: S90 Primary Focal Plane Configuration - hacking out the CCD

  • 704 Replies
  • 188341 Views
*

Offline SticK

  • *****
  • 779
Re: CHDKPTP: S90 Primary Focal Plane Configuration - hacking out the CCD
« Reply #440 on: 29 / July / 2013, 10:11:14 »
Advertisements
ZOOM SERIES for S90_101a INSTRUMENT CAMERA  CR2 vs DNG

Figure illustrates border thickness difference between a DNG and native CR2.  The DNGs have no left border.  Viewer zoom is 300%.

==>> Please refer to previous new post on page 44 bottom for complete zoom series images:

http://chdk.setepontos.com/index.php?topic=8801.msg103291#msg103291
« Last Edit: 29 / July / 2013, 11:01:40 by SticK »

*

Offline reyalp

  • ******
  • 14121
Re: CHDKPTP: S90 Primary Focal Plane Configuration - hacking out the CCD
« Reply #441 on: 29 / July / 2013, 12:57:34 »
WRT the borders .....

Now I have some answers.  In general, this is what I see on the 100c with lens.  Firstly, this border is problematic because it appears in both DNGs and CR2s.  I see it on the 101c instrument camera too.  As such, it will give stitching issues in instrument mosaics if not suppressed (but suppressing this may not be possible unless it's directly related to vignetting).  At full wide the DNG border is 2X thicker than the CR2, but the left side has no border.  The CR2 is 1/2 thickness with a border around the whole image.
With regard to the DNG, there are 3 different crops defined in the file:
1) The whole raw buffer. Whatever the comes from the sensor is here, including pixels that are completely masked. Normally, raw software will not show you all of this.
2) The active area. This is manually determined by whoever does the port. It could be wrong, and whether it includes the border pixels that are darker but still include valid data is a subjective choice by the person who made the port. Normally, this is the largest image raw processing software will show you.
3) The "default crop". In CHDK, this is simply the jpeg size, centered in the sensor size. This will not line up exactly with the camera jpeg, because the exact positioning of the cameras jpeg crop is not known. Some photo software may show this instead of the entire active area.

Adjusting the active area either by customizing your CHDK build, or simply tweaking the tags in the DNG file after the fact should be quite straightforward.

And finally, FWIW, with CHDK 1.2 and the current chdkptp, you can capture DNG directly to your PC over USB without saving it on the card.
Don't forget what the H stands for.

*

Offline SticK

  • *****
  • 779
Re: CHDKPTP: S90 Primary Focal Plane Configuration - hacking out the CCD
« Reply #442 on: 29 / July / 2013, 13:14:12 »
And finally, FWIW, with CHDK 1.2 and the current chdkptp, you can capture DNG directly to your PC over USB without saving it on the card.

Oh my!  This IS WORTH a lot.  Thanks!  Does it number files sequentially on the PC side?  Is there new code in CHDKPTP that you can direct my attention to?   What do I need to try this (on the 100c) ?

The BIG question ... is it possible to easily port srsa's V1.1 S90_101a hacks (including this one if he can get it) to V1.2 ?

edit:
Adding to your comment regarding extracting the active area ... CHDK customization a very good potential solution because the border issue is likely not related to vignetting, and will likely remain if srsa can solve this back-breaker.
« Last Edit: 29 / July / 2013, 13:26:17 by SticK »

*

Offline SticK

  • *****
  • 779
Re: CHDKPTP: S90 Primary Focal Plane Configuration - hacking out the CCD
« Reply #443 on: 29 / July / 2013, 14:05:27 »
@srsa_4c

I have two ideas that might help isolate the code zone.  Both might help.

IDEA #1
You could generate a V1.2 BIN for the 100c that only implements your "nodistcorr" hack if possible, and I run the DmpRAM series again.  My rationale is that we can minimize unnecessary RAM variability from ZOOM-to-ZOOM, perhaps allowing easier isolation of vignetting code.

IDEA #2
I have given some thought on how I would implement the code if I were at Canon.  There are two ways I can think of that can be used in combination:
  a) a look-up table for every pixel (or a small bin perhaps)
       and/or
  b) a parametrized nonlinear equation set that characterizes a standard lens.
Option (a) would require a huge table entry in ROM (even as 8-bit values), and is unlikely for a 10Mpx CCD.  Option (b) is attractive as long as production lens sub-assemblies conform to certain tolerance bounds that allow a generic equation set.  Thus, the only parameter that would need to be set during manufacture, is the CCD center offset vector from lens optical axis (cx, cy).  Hence an equation set of the form:
    out_intensity(px,py) = f_vignette(in_intensity(px,py), Z, cx, cy)
where Z is zoom level and (px,py) are the pixel coordinates, would be essentially trivial and work very well.   Hence no abrupt disengagement from correction code would be needed throughout the entire zoom range.  In my opinion, (b) is the more linear and more compact choice. 

Is this useful?
« Last Edit: 29 / July / 2013, 14:29:28 by SticK »


*

Offline srsa_4c

  • ******
  • 4451
Re: CHDKPTP: S90 Primary Focal Plane Configuration - hacking out the CCD
« Reply #444 on: 29 / July / 2013, 16:18:36 »
  b) a parametrized nonlinear equation set that characterizes a standard lens.
That could be close, I guess. The issue is that all image/data manipulation is done by the DSP, so I don't expect anything easily recognizable.
I think the current RAM snapshots will be enough to search for suspected variables holding the current zoom point. I'm assuming that the correction depends on zoom point and not something else.
About your test pictures: I was expecting something similar to the distcorrect-stuff, but instead, it looks like this correction is never really "switched off". Hopefully its effect will be close to unrecognizable at the tele end of the zoom range.

About the new remote capture support: shooting jpeg and raw/dng is supported on the s90, but nobody yet has tested it on this camera. I'd like to stress that native raw is not supported, as it's saved in a yet unknown part of the firmware. You can find binary builds of chdkptp at the usual place, but those are a bit behind the latest developments. You can use a current CHDK 1.2 build to test.
Porting my hacks will be possible, but I'd suggest you to experiment on your 1.00c camera until it's done. The new chdkptp command is called 'rs'.

*

Offline SticK

  • *****
  • 779
Re: CHDKPTP: S90 Primary Focal Plane Configuration - hacking out the CCD
« Reply #445 on: 29 / July / 2013, 16:43:13 »
About your test pictures: I was expecting something similar to the distcorrect-stuff, but instead, it looks like this correction is never really "switched off". Hopefully its effect will be close to unrecognizable at the tele end of the zoom range.
Seems right to me.  I don't think the borders are actually a correction, agreeing with reyalp here.  However, the 101a is always at MAX WIDE, so the solution reyalp offered to eventually extract a sub-frame (w/o border) will work.  That RAW file border issue is not a show-stopper by any means.

Quote
I'd like to stress that native raw is not supported
Ok that's a good point for me to know ... the Canon natives are useful to me because they don't require external clean-up (eg badpixels) like DNGs, and are compressed (about 2/3 a DNG), so eventually you might find where they hide. 

Quote
Porting my hacks will be possible, but I'd suggest you to experiment on your 1.00c camera until it's done
Yes definitely, I'd have to get it working and understand it 100% first before attempting anything in the 101a.  Will advise later down in time.  Mission critical is the vignette correction.  If you can manage that one, the rest is clear sailing on a sunny day!
« Last Edit: 29 / July / 2013, 16:55:18 by SticK »

*

Offline srsa_4c

  • ******
  • 4451
Re: CHDKPTP: S90 Primary Focal Plane Configuration - hacking out the CCD
« Reply #446 on: 29 / July / 2013, 16:58:25 »
I don't think the borders are actually a correction
Right, those faint borders are uncorrected, vignetting correction is only applied to the inner part of the images. The only reason I kept mentioning the borders is because those seem like a sure sign of this correction.

*

Offline SticK

  • *****
  • 779
Re: CHDKPTP: S90 Primary Focal Plane Configuration - hacking out the CCD
« Reply #447 on: 30 / July / 2013, 09:33:20 »
SOME NEW INTERESTING INSIGHT INTO THE CCD TEMP ISSUE

@reyalp

Perhaps you may recall a discussion we had about the discrepancy between the actual CCD temp I was measuring and the one reported on the OSD.  At the time while the CCD was hanging in the air I found that difference to be 10-12C, higher on the OSD than measured.  Thus with the matchbox-S90 (instrument 101a) sitting on the bench I would see around 40C to 45C at room temp on the OSD.  You claimed the OSD value to be accurate and the discrepancy to be thermal resistance between the CCD surface (you assumed a thermistor on the silicon surface of the CCD die) and its ceramic package.  While theoretically true (specified as degC/W in power designs with an infinite heatsink), such a large difference can only be seen when a high-power transistor is overdriven way beyond its capacity for its heatsink to bleed out the heat effectively. The case of the camera CCD is the reverse, that is, it is ultra low power and there is no effective heatsink.  So because of its low power it takes several minutes for the CCD to reach a stable temp while hanging in air, and if that kind of difference were real, the CCD would burn up in a bright flash!

The matchbox-S90 is now mounted on its new machined heatsink assembly with a precision TEC controller capable of 0.01% temperature regulation (it even looks beautiful in its ugliness).  Although mounted on the TEC, at present the CCD is not yet in its hermetic cap (ie exposed to air) but cooling it down to near dew point is possible.  Thus using both an IR thermometer and a contact thermometer that agree, the CCD is at +18C, rock stable.

However, the OSD CCD temp shows +46C // no sense at all.   Also, changing CCD temp from +18C to +22C does not change the CCD OSD value.  So what's the problem then?

Spraying air gently from a DustOff can across the PCB drops the OSD CCD temp from +46C to +42C in about 10 seconds.  Going into PLAY for 1 minute and back to REC, drops the temp by 5C, and the temp goes back to +46C in 2-3 minutes.

The conclusions are that thermal resistance does not account for the discrepancy.  Also, there cannot be any thermistor in the CCD die, and, there is no thermistor on the CCD plate and ribbon cable in this camera.  Obviously that reading cannot be the actual CCD temp for the S90, and if anything, it is an estimation by FW of some thermistor on the PCB itself.  The only schematic available (IXUS 60 - DIGIC II) does show a thermistor mounted on the CCD plate.  So the IXUS 60 indeed must report real CCD temp on the OSD in CHDK.  I have measured individual chips on the S90 PCB to read as high as +45C.  So my guess is that the "CCD temp" OSD value is actually "PCB temp", for the S90.  The matchbox-S90 camera is mounted with its exposed PCB facing the heatsink, so I cannot isolate the PCB thermistor position in this configuration.  I discovered the problem a few days ago after the whole unit was assembled.  When I take it apart again to access the circuit side, I will be able to find and characterize the PCB thermistor accurately.
« Last Edit: 30 / July / 2013, 09:36:11 by SticK »


*

Offline reyalp

  • ******
  • 14121
Re: CHDKPTP: S90 Primary Focal Plane Configuration - hacking out the CCD
« Reply #448 on: 30 / July / 2013, 14:10:54 »
Spraying air gently from a DustOff can across the PCB drops the OSD CCD temp from +46C to +42C in about 10 seconds.  Going into PLAY for 1 minute and back to REC, drops the temp by 5C, and the temp goes back to +46C in 2-3 minutes.
Very useful information.
Quote
You claimed the OSD value to be accurate and the discrepancy to be thermal resistance between the CCD surface (you assumed a thermistor on the silicon surface of the CCD die) and its ceramic package.
No. The only thing I stated as fact is that the "CCD temperature" is the value returned by the Canon firmware "GetCCDTemperature" function.

All interpretation and calibration is up the you, the user.

I did speculate on some other things, but I think I've been pretty clear that was speculation: http://chdk.setepontos.com/index.php?topic=8613.msg91337#msg91337

Quote
CHDK simply returns the value of a canon function named GetCCDTemperature. There's no guarantee it is calibrated to any particular standard. OTOH if the Canon sensor is integrated in the sensor die, 12c higher than the surface doesn't sound implausible.
/grumpy
Don't forget what the H stands for.

*

Offline SticK

  • *****
  • 779
Re: CHDKPTP: S90 Primary Focal Plane Configuration - hacking out the CCD
« Reply #449 on: 30 / July / 2013, 15:15:17 »
Dear grumpy ....

Quote
OTOH if the Canon sensor is integrated in the sensor die, 12c higher than the surface doesn't sound implausible.

The point I made is that even if a thermistor were integrated on the die, a 12 deg difference is *impossible* under all normal working conditions.  ... if one could even measure such a difference ... the CCD would fry in an instant, making you unable to do the measurement!  The thermal gradient is *way* low at steady-state, a tiny fraction of a degree (ie high thermal conductivity of silicon along with very low power dissipation).  It's a bit like trying to demonstrate quantum mechanics empirically.

In the temp regard, I discovered something else that might be useful ... In the S90,  the Opt temp is the thermistor mounted on one of the internal plastic lens barrels.  I temporarily substituted that one for a 10K resister, the reading is a "perfect" +25C and stays still, as expected because thermistor resistance is rated at +25C, and the most common is 10K.  That validates the precision of CHDK temp value reporting mechanism, at RT simulation certainly on the S90.  However, in my application, because thermistors have a variety of different response slopes (the "B" value), only the correct one that can be used is the original part.  So my intention now is remove the one on the lens and attach it onto the CCD plate, giving me both CKT temp (ie OSD CCD) and actual CCD temp (OSD Opt).

The upshot here is that CHDK rocks!

/happy
« Last Edit: 30 / July / 2013, 15:51:37 by SticK »

 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal