Setting focus from scripts or menus - page 3 - General Discussion and Assistance - CHDK Forum supplierdeeply

Setting focus from scripts or menus

  • 556 Replies
  • 84461 Views
Advertisements
Data for A810, SX110, SX240, SX30, SX40 attached. Not the most recent CHDK build though. Let me know if I run the tests again with a recent build.

Data for A810, SX110, SX240, SX30, SX40 attached. Not the most recent CHDK build though. Let me know if I run the tests again with a recent build.
Wow - thanks for all of those!  All cameras are running 1.2.0 so the build level is okay.

If I can further impose,  and if you have a few minutes, can you rerun these tests with the following changes ?

  • Enable Lua Native Calls in CHDK's Miscellaneous menu for each camera.
  • For each camera, enable the fourth SS.MFOn test as well as the other three using the script parameter menu in the CHDK Script menu.
  • A couple of your tests had either had Canon Servo AF set (A810) or Continuous AF set (SX100).  Those need to be disabled via the Canon shooting menu prior to testing.
  • I think your SX110 is actaully an SX100? If so, don't repeat the test for that camera as I have data it already.

Once again - thanks for the help.

WW

Ported :   A1200    SD940   G10    Powershot N    G16

Wow - thanks for all of those!  All cameras are running 1.2.0 so the build level is okay.

If I can further impose,  and if you have a few minutes, can you rerun these tests with the following changes ?

  • Enable Lua Native Calls in CHDK's Miscellaneous menu for each camera.
  • For each camera, enable the fourth SS.MFOn test as well as the other three using the script parameter menu in the CHDK Script menu.
  • A couple of your tests had either had Canon Servo AF set (A810) or Continuous AF set (SX100).  Those need to be disabled via the Canon shooting menu prior to testing.
  • I think your SX110 is actaully an SX100? If so, don't repeat the test for that camera as I have data it already.

Once again - thanks for the help.

WW

Right, I have an SX100, not an SX110... Attached are new results for the other cameras with fixed settings. BTW, the A810 crashed during the first attempt to make a new mf_test.csv file. The ROM log is included in the zip.

And what I forgot to write before: I'm really looking forward to the results of your investigations. I could figure out how to set the focus from a Lua script -- maybe my chances to do it successfully become better :)

Attached are new results for the other cameras with fixed settings. BTW, the A810 crashed during the first attempt to make a new mf_test.csv file. The ROM log is included in the zip.
The A810 crashed in the focus task - I guess that's to be expected.  Did you notice on the camera LCD screen what test was being attempted when it crashed?

Also,  it looks like your A810 is still in servo_AF mode.  The CHDK code will (usually) prevent scripts from setting focus when that mode is active so all the tests failed.  Can you try again to disable Servo AF in the Canon menu and rerun the test on the A810 yet again?

The other camera tests are all good - thanks for running them again.

Quote
And what I forgot to write before: I'm really looking forward to the results of your investigations. I could figure out how to set the focus from a Lua script -- maybe my chances to do it successfully become better :)
If we can get this sorted out,  the whole issue should become transparent to a script writer.  Its a mess right now.
Ported :   A1200    SD940   G10    Powershot N    G16


Attached are new results for the other cameras with fixed settings. BTW, the A810 crashed during the first attempt to make a new mf_test.csv file. The ROM log is included in the zip.
The A810 crashed in the focus task - I guess that's to be expected.  Did you notice on the camera LCD screen what test was being attempted when it crashed?

No, not exactly :( I _believe_ that it was during the first or second test, but I did not watch the script output very carefully. I tried to reproduce the crash by running the script maybe 10 times -- no "luck", now it just worked...

Quote
Also,  it looks like your A810 is still in servo_AF mode.  The CHDK code will (usually) prevent scripts from setting focus when that mode is active so all the tests failed.  Can you try again to disable Servo AF in the Canon menu and rerun the test on the A810 yet again?

sure, next file is attched. Sorry for the mess -- it seems that even the relatively simple menu of the A810 is too complex for my small brain ;)

sure, next file is attched. Sorry for the mess -- it seems that even the relatively simple menu of the A810 is too complex for my small brain ;)
Hmm ... seems third time was not lucky.  Its still in Servo_AF (Servo Auto Focus) mode and failing all the tests.

EDIT : servo_AF might be what is preventing this camera from crashing!  If so,  you will probably need to disable the first test ( Default test ) when you run the script if servoAF is disabled

On all of my cameras,  when I put the camera into shooting mode (i.e. lens extended) and press the Menu button (normal Canon mode - not CHDK ALT mode), then the third or fourth item on the Canon menu says "Servo AF".  Did you see a menu item like that?

Incidentally,  you can check the csv file from the test yourself.  Just open it in notepad or any other editor (or a spreadsheet program) - the first two lines will look like this :

a810,100e,CHDK,1.2.0-2994-0
Mode:P,Continuous_AF:0,Servo_AF:1


The "1" you see after the Servo_AF should be a "0" for the tests to work.

Noted for reference : on my SD940,  the camera enables Continuous_AF when its in Auto mode and disables it when its in P mode.  There is no menu item for Continuous_AF
« Last Edit: 31 / December / 2013, 12:26:58 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

sure, next file is attched. Sorry for the mess -- it seems that even the relatively simple menu of the A810 is too complex for my small brain ;)
Hmm ... seems third time was not lucky.  Its still in Servo_AF (Servo Auto Focus) mode and failing all the tests.

Finally I figured out what happened: I did set all AF options to "off", then started the script; the camera then crashed (in test 2) and powered off with the lens extraced -- and when powered on again, it switched to some default settings -- which included Servo AF being enabled. This happened reproducibly. So I disabled the second test in the script, double-checked that the AF options are indeed disabled, and ran the test again. The result is attached, as well as the last ROM log. So it seems that my brain is not yet totally broken ;)

Quote
On all of my cameras,  when I put the camera into shooting mode (i.e. lens extended) and press the Menu button (normal Canon mode - not CHDK ALT mode), then the third or fourth item on the Canon menu says "Servo AF".  Did you see a menu item like that?

Incidentally,  you can check the csv file from the test yourself.  Just open it in notepad or any other editor (or a spreadsheet program) - the first two lines will look like this :

a810,100e,CHDK,1.2.0-2994-0
Mode:P,Continuous_AF:0,Servo_AF:1


The "1" you see after the Servo_AF should be a "0" for the tests to work.

Double-checked -- the file should contain what you need, I hope.

*

Offline srsa_4c

  • ******
  • 3901
I wonder if this is also a timing issue, a mechanical problem, or the accuracy limit of the ixus110 ?
Good question. It's not a mecha problem, since the lens is fine.

I have done another test series, this time with the ixus870_sd880.
The mf_test runs were done with the unmodified script, mf_test2 was done with this modification:
Code: [Select]
function test_shoot(foc)
    if (foc>0) then set_focus(foc) end
    sleep(1000)
    press("shoot_half")
    sleep(2000)
    gf = get_focus()
    press("shoot_full")
    sleep(200)
    release("shoot_full");
    sleep(1000)
    return gf
end
(Yeah, not too smart, fixed delays only for simplicity)
For the "flashlight" tests I used an LED flashlight shining directly into the lens. That test failed with the original script, but not with the modified one. The main difference is the sampling point of the focus distance (and the timing).
Could not reproduce this difference with the ixus110 (with the flashlight), so the reason behind the test failures can be something else.


Double-checked -- the file should contain what you need, I hope.
Perfect this time - thanks for sticking with it.

But it adds a new wrinkle to the mystery.  The camera crashes when set_aflock() is used but passes all the other tests - including just using set_focus() without set_aflock(). 
Ported :   A1200    SD940   G10    Powershot N    G16

For the "flashlight" tests I used an LED flashlight shining directly into the lens. That test failed with the original script, but not with the modified one. The main difference is the sampling point of the focus distance (and the timing). Could not reproduce this difference with the ixus110 (with the flashlight), so the reason behind the test failures can be something else.
Well, fwiw the sd880 failure were just slightly more than 10% off.  Accuracy rather than not working.

[
Code: [Select]
function test_shoot(foc)
    if (foc>0) then set_focus(foc) end
    sleep(1000)
    press("shoot_half")
    sleep(2000)
    gf = get_focus()
    press("shoot_full")
    sleep(200)
    release("shoot_full");
    sleep(1000)
        print(gf,get_focus()   -- <******
    return gf
end
If you add a print statement like above (brute force) to see what happens with the focus, I wonder if the two values are the same?

(btw :  interesting that Lua did not bark at the ; after the release(shoot_full).   I guess its "C" friendly?)
Ported :   A1200    SD940   G10    Powershot N    G16

 

Related Topics