2.3 KiB
PC control protocol
COM port setup: 8N1, minimum baudrate of 115200, higher can be better
Reporting
Board periodically sends info about lens in below format:
Focus mode: MF Focus limit: NO Focus: 16388 Focal length: 27.999964 Aperture: 4884
Focus mode:
Values:
- MF - manual focus
- AF - autofocus (manual focus ring is disabled in this mode)
Focus limit:
Values:
- NO - focus element is not in any limit position
- NEAR - focus element is in far limit position
- FAR - focus element is in near limit position
- UNKNOWN - another unknown value, it shows after far, so I suspect parking position
Focus:
- Raw data from lens indicating focus position in steps
Focal length:
- Computed from raw data
Aperture:
- Raw data from lens
Control
Messages which control the lens from PC, they are not case sensitive
Focus mode:
For autofocus: af
For manual focus: mf
Aperture:
You can send either absolute value corresponding to what lens returns or relative value.
For absolute: aperture 5678
For relative: aperture_rel 100 or -100 depending if you want to open or close it
Focus:
You can send either absolute value corresponding to what lens returns or relative value.
For absolute: focus 18000
For relative: focus_rel 100 or -100 depending in which direction you want to focus
Zoom:
Zoom is a bit different in that it is controlled externally with stepper motor so the commands are a bit different. You can zoom on specific focal length or by count of steps. There are not set software limits to where you can zoom, so make sure, that you have some kind of protection setup either mechanical or in stepper controller setup with for example top current limit.
For zoom at focal length: zoom 100 50 where first number is focal length and second one is number of steps per iteration, smaller number = better resolution.
For steps mode: zoom_steps 0 200 where first number is direction: 0 retract, 1 extend, and second is number of steps.
Zoom speed can be set in file on the board, when connected to PC and with open Thonny IDE, you can select interpreter in bottom right corner to MicroPython (RP2040) and after that in left panel open config.py and edit ZOOM_SPEED
If lens zooms backwards, flip stepper motor connector. MAKE SURE, THAT BOARD IS POWERED OFF