If you have the time, maybe you can try this version and see if it fixes your problem?
BTW I did a test shot on the way home that gives a flavour of the script's capability, although I should have focused a little closer to the camera.
Also, I used f/8 rather than the optimum aperture of f/5.6.
hook_shoot.count() or hook_raw.count()
Started by SkyWalker9 Script Writing
Started by SkyWalker9 « 1 2 » Completed and Working Scripts
Started by kidtree Completed and Working Scripts
Started by genosmm General Help and Assistance on using CHDK stable releases
Started by pigeonhill « 1 2 3 » Creative Uses of CHDK