Arducam 108Mp distance to focus-value formula

Where did you get the camera module(s)?
Kubii
Model number of the product(s)?
EK030 with serial number : 3272496313125
What hardware/platform were you working on?
Arducam108Mp with USB3 CameraSHield and official USB3 cable.
Linux Ubuntu 22.04 + Python 3.9 + ArducamSDK v1.0.2
4. Instructions you have followed. (link/manual/etc.)
ArducamSDK Python example

Problems you were having?
In my application I will move the camera with a robot arm. I know the distance between camera and object. I would like to set focus according to this distance.
How could I convert distance (millimeter for instance) into focus value (1-1023 in cfg file) ?

The dmesg log from your hardware?

Troubleshooting attempts you’ve made?
Set focus value with try and error for multiple distance. This is not accurate

What help do you need?
Could you provide a formula to convert camera-object distance to focus value as stated in config file (1-1023) ?

Any clues @SupportTeam ?

@medalkiller

Sorry, no specific formula is available at this time.

I answered my self the question.
If anyone else is interested, i found focusValue( distance ) = 5254/ (-0.541+ distance) + 141
hyperbola

Regards,

Julien

datas

Hi @SupportTeam I discovered a technical limitation regarding motorized focus on Arducam 108Mp dev kit.
The focus value (0-1023) to use in order to focus at a defined distance depends on the camera orientation. cf. figure.
In other words, focus lens weight does influence the motorized focus value. Do you have any idea to fix that ?

Regards,
Julien