Arducam PTZ pan/tilt runs continuously instead of fixed steps in FocuserExample on Pi 5

Hi, I’m using the FocuserExample with my Arducam 8MP Pan-Tilt-Zoom camera on a Raspberry Pi 5. When I trigger pan or tilt, the servo motor just keeps running continuously until I trigger the opposite direction. It never stops on its own. Is there a method to make it rotate a fixed degree or number of steps and stop automatically? Right now it behaves more like speed control than position control.

Could you record a short video showing this? It’s easier to see what’s actually happening that way.

Separately, about the lens shading calibration you were trying earlier — looking at the command and log you posted, the failure is clear. You ran:

libcamera-still -t 0 --tuning-file imx219_original.json

and got:

[3488] INFO Camera camera_manager.cpp:313 libcamera v0.3.0+65-6ddd79b5
[3491] INFO RPI pisp.cpp:695 libpisp version v1.0.6 b567f0455680 17-06-2024 (10:20:00)
[3491] WARN RPiSdn sdn.cpp:40 Using legacy SDN tuning - please consider moving SDN inside rpi.denoise
[3491] ERROR IPARPI pisp.cpp:275 Tuning data file target returned "bcm2835", expected "pisp"
[3491] ERROR RPI pipeline_base.cpp:798 Failed to load a suitable IPA library
[3491] ERROR RPI pisp.cpp:922 Failed to register camera imx219 4-0010: -22
Made X/EGL preview window
ERROR: *** no cameras available ***

The key line is the tuning data file target: it returns “bcm2835” but the Pi 5 pipeline expects “pisp”. That mismatch makes the IPA library fail to load, so the imx219 never registers, which is why you end up with ‘no cameras available’.

Thanks for explaining the log. Just to restate the pan/tilt problem clearly: it does not behave like angle rotation at all. When I send a direction, it keeps moving continuously until I trigger the opposite direction. I want it to move a fixed angle or number of steps and then stop. Do I need a different example or some parameter for that? I’m still using the FocuserExample with the Arducam 8MP PTZ camera on a Raspberry Pi 5.

For the lens shading issue, try using the imx219_120d.json tuning file instead of imx219_original.json. I have sent you the tuning file via private message — please check your inbox.

Place it under /home/pi and run:

libcamera-still -t 0 --tuning-file imx219_120d.json

To use it in the PTZ Python demo, open RpiCamera.py inside the PTZ-Camera-Controller folder, find this line:

self.cam = Picamera2()

and change it to:

self.cam = Picamera2(tuning="/home/pi/imx219_120d.json")

save, then retry FocuserExample.py and see if anything changes. Chapter 6 of the Raspberry Pi Camera Guide also covers tuning files if you want more background.

Here’s a video of the behavior: 20241010_200046.mp4

What I’m seeing is that as the value moves away from 90, the motor starts and doesn’t stop. The further the value is from 90, the faster the motor spins. Is that normal, or should it stop at the particular value I’m calling, like 80 degrees?

Thanks for the video. To be honest, we haven’t disassembled the servo motors and tested them separately — they’ve always been used together with the gimbal in our own testing, so I can’t say for certain whether what you’re seeing is expected for this hardware. Based on your description (continuous motion, speed increasing the further you move from 90), the fixed-angle positioning behavior isn’t happening in FocuserExample. We don’t have a confirmed root cause yet.

Here’s a reference video from our side showing how it behaves in our setup: https://www.youtube.com/watch?v=2Xn8L1kupOk

Could you compare it with yours and let me know what difference you see?