Hey everyone, I’m trying to use the FocuserExample.py script from the B016712MP folder on the PTZ Camera Controller GitHub repo. The problem is that neither the zoom nor the focus motor will go beyond 2100 steps no matter what I do. According to the product specs, the zoom range should be 2317 steps (wide to tele) and the focus range should be 3009 steps (near to far). So 2100 seems way too low. Is there a setting I’m missing, or is the example script limiting things somehow? I’m using the code straight from here: PTZ-Camera-Controller/B016712MP at master · ArduCAM/PTZ-Camera-Controller · GitHub
Good question — this trips up a lot of people. The FocuserExample.py in the B016712MP directory is actually a specialized version designed for synchronized zoom and focus control. It intentionally caps the steps at 2100 to keep the image from going out of focus while you’re adjusting both motors simultaneously. It’s not a hardware limitation, just a design choice in that particular example script. The fix is straightforward: don’t use the B016712MP-specific code. Instead, grab the standard testing code from the main branch here: GitHub - ArduCAM/PTZ-Camera-Controller · GitHub. That version has no synchronization logic and no artificial step caps — you should get the full range: zoom past 2300 and focus past 3000 steps.
Thanks for the quick reply. Just to make sure I understand — can I take the master branch code and run it directly with my B016712MP hardware? Or do I need to go into the B016712MP code and manually change the limit values to 3000 myself? I want to make sure I don’t mess anything up.
Definitely don’t try to manually modify the limit values in the B016712MP code. Those limits aren’t simple user-configurable parameters — they’re embedded in a more complex synchronization implementation and changing them incorrectly could cause other issues. The correct approach is to use the main branch code as-is, without any modifications. It’s designed to work with the hardware and will let you control the full motor range directly. No need to port anything from the B016712MP folder.
Alright, so I downloaded the FocuserExample.py from the master branch (not the B016712MP folder) and ran it. Unfortunately, I’m still hitting the same wall — neither motor will go past 2100 steps. The behavior is identical to what I was seeing before. I was under the impression the main branch code would unlock the full range. Am I doing something wrong or is there maybe another layer to this?
That’s unexpected — the main branch code shouldn’t have that cap. Could you share a screenshot of the FocuserExample.py while it’s running, showing the limit you’re seeing? That’ll help me figure out whether the issue is in the script, the communication with the board, or somewhere else entirely.
Sure, here’s what I’m seeing. 2100 is the absolute max I can set for either zoom or focus — the slider/input just won’t let me go higher.

I’ve also attached the full master branch package I’m using if that helps: PTZ-Camera-Controller-master.rar
Thank you for the screenshot — that confirms what’s happening. I dug into the B0167 controller firmware source code and here’s the actual situation: the 2100-step limit is baked into the chip’s firmware itself. It’s not coming from any Python script or example code. Here’s what’s going on under the hood: the control board firmware takes the raw physical motor steps and normalizes them to a standardized control range of 0–2100. So the spec sheet numbers — 2317 steps for zoom and 3009 steps for focus — those are the raw mechanical step counts of the lens motors. But the firmware maps that entire physical range into a 0–2100 scale that gets exposed to software. In practice, when you set the value to 2100 in software, you’re already at the full mechanical limit of the lens. You’re getting the complete travel distance. The spec sheet was misleading because it listed raw motor steps rather than the mapped control range, but functionally there’s nothing missing — you’re already using the full zoom and focus range.
That’s really helpful context, thank you for explaining the mapping. I get it now — 2100 in software equals the full physical range. That said, is there a different controller chip or board available that doesn’t have this firmware limitation? Or alternately, are there lenses with a greater zoom and focus range that could work with this setup? I’m looking to see what my hardware options are if I want more range.