The script function autofocus:
Seems to find very dim stars. Hence focus is very random.
The exposure time of the original image, the setup of the autofocus window (focuser increment, steps, number of tries) and the 4 parameters are all clearly interacting.
I have tried many combinations but not come up with a good set?
1: I think fp4 seems to need to be close to the exposure time of the original image.
2: pf1 changes the size of the capture box ok.

What is the best combination?

All the best