Author Topic: Focus Code Help  (Read 5605 times)

mk11174

  • Contributor
  • Hero Member
  • *****
  • Posts: 809
Focus Code Help
« on: July 13, 2013, 11:17:10 PM »
I am trying to add a code to bolt trigger module.

I figured out how to control the focus, and added some lines for full wide and full zoom of my 18-55mm kit lens.

I would just set lens to MF the turn focus to INF all the way, then I would switch on AF and run the code for whatever zoom I am at, Full or Wide. It always focuses right where I want it just fine.

But the question is, can anyone tell me how to make the code know if it is full wide or full zoom so it knows which code to run when I run the code?

An maybe anyone willing to help has a simplier solution then my basic code? LOL

Update: Sorry was in rush cause of a storm, here is the line of code I am using right now.

Code: [Select]
  /*  Full Zoom  */
/*        msleep(100);
        lens_focus_start(80 * get_follow_focus_dir_h());
        msleep(100);
        lens_focus_start(1 * get_follow_focus_dir_h());
        msleep(100); */

    /* Full Wide  */
        msleep(100);
        lens_focus_start(2 * get_follow_focus_dir_h());
        msleep(100);
        lens_focus_start(1 * get_follow_focus_dir_h());
        msleep(100);
        lens_focus_start(1 * get_follow_focus_dir_h());
        msleep(100);

        lens_focus_stop();
        msleep(100);
500D/T1i  550D/T2i  600D/T3i  700D/T5i

grogan197

  • New to the forum
  • *
  • Posts: 2
Re: Focus Code Help
« Reply #1 on: August 16, 2013, 12:18:32 PM »
When Live View is on you should be able to retrieve the current focal length with lens_info.focal_len; Not sure if you can retrieve the min and max length for a lens but you could use lens_info.name and then set the min and max values manually for each lens.

Audionut

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3657
  • Blunt and to the point
Re: Focus Code Help
« Reply #2 on: August 16, 2013, 01:36:03 PM »
55mm on a crop has a hyperfocal distance of 40 meters @ f/4.0 (I'm being generous on the aperture value), with a near limit of sharpness @ 20m.  I assume you want to be further then 20m from the strikes!

Wider angles bring closer the near limit of sharpness, for the same far limit (infinity) of sharpness.

http://www.dofmaster.com/dofjs.html

TLDR:  Set your focus @ 40m!

mk11174

  • Contributor
  • Hero Member
  • *****
  • Posts: 809
Re: Focus Code Help
« Reply #3 on: August 16, 2013, 02:04:26 PM »
When Live View is on you should be able to retrieve the current focal length with lens_info.focal_len; Not sure if you can retrieve the min and max length for a lens but you could use lens_info.name and then set the min and max values manually for each lens.
Hi, thanks for the info, I actually got a code working that I really like I made a focus infinity module out of it, I did try the lens_info but that was not working to recognize the lens, I was able to GET the info but was not sure how to make the code read that data when the certain lens was used, so in the module I made I just made it work at a mm range, so I made a 55mm setting and a 300mm setting for my 2 lenses and as long as I zoomed to that range before running the code it knew the lens I had and what setting to use, bad thing was this is no good for other lenses so I also added a custom option to quickly tweak per lens, so it all worked great.

I now can set my focus in dark without double checking it by zooming in on something with LV.
500D/T1i  550D/T2i  600D/T3i  700D/T5i