Focus distance override and bracketing on IXUS cameras - AllBest's Builds - CHDK Forum

Focus distance override and bracketing on IXUS cameras

  • 22 Replies
  • 27386 Views
Focus distance override and bracketing on IXUS cameras
« on: 16 / January / 2008, 07:14:20 »
Advertisements
Hi AllBest,

I got focus distance override and bracketing working on the IXUS800 with your build 11 by making this little change:
void shooting_set_focus(int v, short is_now) {
   // if((is_now) && (shooting_get_focus_mode())) {
     if((is_now)){

When I do the same patch to your build 16, no go. There has changed so much between these versions...

The IXUS800 has no manual focus mode, so focus distance override is a bit slow due to autofocusing before you applying the override, but it works!

It can be optimized by using the Auto Focus Lock button (available in "marketing manual mode"), so I scanned the properties and found
PropCase 193 = 1 when AFL is active!
Maybe this can be applied before SHOOT_HALF when a focus distance override is set, but I'm a newbie to the CHDK sources and don't understand the control flow. Is there any document about it?

Hint: Allowing focus distance bracketing without manual focus mode would also save users of other camera models some button presses.
 
One more hint: You can simplify your bracketing code removing
#if defined(CAMERA_ixus700_sd500) || defined(CAMERA_ixus800_sd700) || defined(CAMERA_a560)
by changing main.c like this:
} modemap[] = {
    { MODE_AUTO,               32768 },
//    { MODE_M,                  32772 },
    { MODE_P,                  32772 },

Thanks
  nirschi

« Last Edit: 17 / January / 2008, 04:45:16 by nirschi »

Re: Focus distance override and bracketing on IXUS cameras
« Reply #1 on: 17 / January / 2008, 04:42:50 »
Hi, nirshi!
Your investigations are very intresing and  i'll try to implement it in my next build.

little change:
void shooting_set_focus(int v, short is_now) {
   // if((is_now) && (shooting_get_focus_mode())) {
     if((is_now)){
Unfortunately most of the cameras hangs up when we do "set_focus" not in the manual focus mode...
When I do the same patch to your build 16, no go. There has changed so much between this versions...
Yes, some small difference exists in the algorithm of focus setting. I will think about this trouble
It can be optimized by using the Auto Focus Lock button (available in "marketing manual mode"), so I scanned the properties and found
PropCase 193 = 1 when AFL is active!
Maybe this can be applied before SHOOT_HALF when a focus distance override is set, but I'm a newbie to the CHDK sources and don't understand the control flow. Is there any document about it?
I will build special version for you camera model. I hope you'll help me to test this build
Hint: Allowing focus distance bracketing without manual focus mode would also save users of other camera models some button presses.
As I previously mentioned there is some trouble in this case...
One more hint: You can simplify your bracketing code removing
#if defined(CAMERA_ixus700_sd500) || defined(CAMERA_ixus800_sd700) || defined(CAMERA_a560)
by changing main.c like this:
} modemap[] = {
    { MODE_AUTO,               32768 },
//    { MODE_M,                  32772 },
    { MODE_P,                  32772 },
I'm agree
Thanks!

Re: Focus distance override and bracketing on IXUS cameras
« Reply #2 on: 17 / January / 2008, 05:37:57 »
Hi AllBest,

I got focus distance override and bracketing working on build 16 with the following change:
void lens_set_focus_pos(long newpos)
{
//#if !defined (CAMERA_ixus700_sd500) && !defined (CAMERA_ixus800_sd700) && !defined(CAMERA_a560)
...
//#endif

Unfortunately most of the cameras hangs up when we do "set_focus" not in the manual focus mode...

I think cameras that support manual focus mode require manual focus mode to not hang.
But why not a config menu entry: focus distance override and bracketing requires manual focus mode?
Could be default disabled for IXUS/A560 and enabled for all others, so everyone can try.

I will build special version for you camera model. I hope you'll help me to test this build

I can't wait to see where to insert the PropCase 193 = 1 !
Please publish the source and I will debug it.

Thanks
  nirschi

Re: Focus distance override and bracketing on IXUS cameras
« Reply #3 on: 17 / January / 2008, 08:10:17 »
Unfortunately most of the cameras hangs up when we do "set_focus" not in the manual focus mode...

Have you ever tried whether AF lock is enough to prevent hang?

And if setting PropCase 193 = 1 activates the AF lock (we will see) , then the following pseudocode should work:

if ( !manual_focus_mode && (PropCase 193 == 0) ) {
  if focus distance override active set PropCase 193 = 1 before autofocus (to speedup and prevent hang)
  else if focus distance bracketing active set PropCase 193 = 1 after autofocus (to prevent hang)
  On shutter release: set PropCase 193 = 0
};
else normal handling


UPDATE: Tried it myself, setting PropCase 193 to 1 does only activate the AFL readout but not lock the focus.

« Last Edit: 31 / January / 2008, 17:20:14 by nirschi »

Re: Focus distance override and bracketing on IXUS cameras
« Reply #4 on: 31 / January / 2008, 23:17:45 »
Pulled in from another thread to have all about that subject in one place:

Other IXUS cameras (IXUS70, IXUS 800, A560) don't have manual focus in user's manual, but have non-empty functions MFOn() and MFOff(). Can anybody test  MoveFocusLensToDistance() on these cameras? After MFOn()?

All about IXUS800:

Camera shuts down calling MFOn();
Camera shuts down calling shooting_set_prop(PROPCASE_FOCUS_MODE, 1);
"MF.c" and "MFBar.c" strings found in A610 not present, calls above ending in neverland.

What I discovered further:

Camera shuts down calling MoveFocusLensToDistance() when zoom point equals 8, my cure:
short shooting_get_focus_mode()
{
...
   return shooting_get_zoom() < 8;
...

Suggestion: Current calls to shooting_get_focus_mode() should better be called shooting_can_focus_be_set().

MoveFocusLensToDistance() is limited to 100mm to Infinity, but IXUS800 does auto-focus down to 70mm.
Calling MoveFocusLensToPositionWithMaxSpeed(3000) allows focusing down to 60mm (equals 10mm from the lens rim).

Conclusion: It seems that the MoveFocusLensToDistance() code is left over from another camera with only 8 zoom points and a minimal focus distance of 100mm.

I am investigating further on this subject. My goals is now to pimp IXUS cameras being always-with-you super macro tools.

nirschi
« Last Edit: 01 / February / 2008, 11:53:25 by nirschi »

Re: Focus distance override and bracketing on IXUS cameras
« Reply #5 on: 31 / January / 2008, 23:20:48 »
Camera shuts down calling MoveFocusLensToDistance() when zoom point equals 8...
MoveFocusLensToDistance() is limited to 100mm to Infinity...

Scanned all Canon camera models around IXUS800 and found only one good match:
The somewhat different twin pair A560/A570IS.

Take a lesson in 'The Fine Art of Crippling'...
http://www.dpreview.com/news/0702/07022201canonsa560a570is.asp#specs

Code: [Select]
IXUS800:       static const int fl_tbl[] = {5800, 6600, 7500, 8600, 10000, 11800, 14300, 18600, 23200};
A560/A570IS: static const int fl_tbl[] = {5800, 6600, 7900, 9900, 12700, 16000, 19600,            23200};

There is no significant loss of sharpness using the wrong tables with MoveFocusLensToDistance().

The values returned by GetFocusLensSubjectDistance() are OK. EDIT: ...but also limited to 100mm to Infinity.

« Last Edit: 01 / February / 2008, 03:00:20 by nirschi »

Re: Focus distance override and bracketing on IXUS cameras
« Reply #6 on: 01 / February / 2008, 11:01:38 »
Note:

In order to bring AllBest distance override and bracketing:

CNF menus, OSD readout and ALT mode focus override keys

to life for evaluation, you have to remove some #define CAMERA_ixus... brackets in core/gui.c.

Re: Focus distance override and bracketing on IXUS cameras
« Reply #7 on: 03 / February / 2008, 12:33:03 »
Hi IXUS porters,

In order to aid IXUS porters checking compatibility with AllBest focus distance override (a precondition to intended IXUS super macro and comfortable manual focus emulation) - and to collect information about IXUS platform differences - a new CHDK branch was created: nirschi-ixus

CAUTION:
Do not use this code for real shooting before you tested it thoroughly and understand the limits!
All blocking to call MoveFocusLensToDistance() removed. Comments labeled 'nirschi:' added to support IXUS porters using a local .zip copy of SVN, to find all 'points of interrest' easily.

Download a .zip file here: http://tools.assembla.com/chdk/browser/branches/nirschi-ixus
SVN checkout: http://tools.assembla.com/svn/chdk/branches/nirschi-ixus

Compile for your camera and run, check camera configuration:

OSD Parameters / Miscellaneous Values:  Show Misc Values ticked, Show Zoom ticked, Zoom Value [X]
OSD Parameters / DOF Calculator:  Show DOF Calculator [In Misc], Use EXIF Subj. Dist. (PC65) NOT ticked, Show Subj. Dist, in Misc. ticked

Leave ALT mode, zoom point 0 (wide), auto mode, macro mode, no CHDK override.

Please report:

1) Camera model and CHDK sub directory name.

2) What subject distance (S: [meter]) is displayed, at zoom point 0 (wide), when auto-focus signals green at the nearest possible distance in Macro mode ?
3) What is the real subject distance, in [mm], measured from the back of the camera where the thumb grip is (not the rim of the display) ?

Enter ALT mode and use left, right and zoom lever keys to move the focus lens until OSD readout is  SD:1  FACTOR:1

4) What subject distance (S: [meter]) is displayed, at zoom point 0 (wide)
5) What is the real subject distance, in [mm], measured from the back of the camera where the thumb grip is (not the rim of the display) ?

Leave ALT mode, OSD readout is  SD:1
Step through all zoom points and half-press shutter on each.

6) Does the camera shut down and at which zoom point (Z: value)


Thank you


IXUS800 behaviour as reference:
Subject distance readout is limited to 100mm to Infinity.
AllBests focus distance override is working with restrictions:
range is limited to 100mm to Infinity, half-press shutter at zoom point 8 shuts the camera down in MoveFocusLensToDistance().


« Last Edit: 03 / February / 2008, 13:10:00 by nirschi »

*

Offline quietschi

  • ***
  • 116
  • Ixus70 102a
Re: Focus distance override and bracketing on IXUS cameras
« Reply #8 on: 05 / February / 2008, 07:57:54 »
Hi

1. ixus70_sd1000 sub 102a
2. 0.061
3. ~60mm
4. 0.061
5. ~60mm
6. no

if i understand everything correct at every other zoompoint than 0 -> S:0.331

cheers quietschi

Re: Focus distance override and bracketing on IXUS cameras
« Reply #9 on: 05 / February / 2008, 12:50:22 »
if i understand everything correct at every other zoompoint than 0 -> S:0.331

You are right. Seems to be a hardware limitation of the lens.


Obviously, ixus70_sd1000 firmware is much better adopted to the hardware as with ixus800_sd700.


Thank you for your contribution.
Are you able to do the same patches and tests with some other ixus_sd ports that are on the way? 
Ever tried to find the string 'MFon' and call the corresponding function MFon() ?


When there are at least three contributions, I will make the second release presenting and testing:
- A MFon() emulation
- Driving the focus lens stepper motor directly and why

Cheers



 

Related Topics


SimplePortal © 2008-2014, SimplePortal