I’ve found a couple of similar posts here on the Pimoroni forums with similar problems to you:
1.Pan-Tilt Hat, how zero the position heads from both servos?
It seems to fix this, you should pop over to the “/library/pantilthat/pantilt.py
” part of your pan-tilt hat directory (wherever that is) and change the values
servo1_min=575,
servo1_max=2325,
servo2_min=575,
servo2_max=2325,
in order to re-adjust the minimum and maximum position of your hat, which should hopefully reset the 0 position as well. The values are PWM (Pulse Width Modulation) based, so I’m not sure myself how they translate to degrees, have a fiddle around!
I’m still not sure why your hat moves randomly at boot. It is possible it’s a fault with your Pi, but I’d prefer to resort to that as a last resort (shortly after an error with your hat). Try running the “test.py
” file in the library directory and see if you get, to Phil’s dismay (yes, I found that little Easter egg there sir), a happy message that your haven’t broken anything. If not, do post the log up here or have a look for any errors that may suggest why you’re getting this erratic behaviour!