PanTiltHat servos with Explorer pHat or direct GPIO


#1

Hello,

I’m assembling a kite photography rig of sorts with a raspberry pi zero w and was wondering if I could use my pimoroni Pan-Tilt Hat minus the Hat with some other (lighter and smaller) pHat (1) or in a direct GPIO connection scheme (2).

  1. The Explorer pHat comes to mind in which case the doubt would be if I could use the pantilthat python library even if some reconfiguration would be in order.

  2. Direct GPIO connection does work but initial tests show what I would describe as a very nervous servo, one that is not exactly stationary between displacements. (I followed these instructions https://electronicshobbyists.com/raspberry-pi-pwm-tutorial-control-brightness-of-led-and-servo-motor/ )

Any recommendation (considering my very low electrical knowledge, specially) regarding direct GPIO connection of these 2 servos would be very much appreciated.

Thank you very much,
peter


#2

Explorer pHat is a motor controller. I don’t think the H bridges will work very well controlling servo’s? If that was your plan?
This may be a better choice, https://shop.pimoroni.com/products/adafruit-16-channel-pwm-servo-bonnet-for-raspberry-pi


#3

The various ways of driving servos directly from the Pi are kind-of terrible, and tend to result in jittery servo performance. It can be done, though. Explorer pHAT or HAT is unecessary since it inverts the protected outputs and makes generating the right signal for a servo slightly trickier.

Definitely don’t use RPi.GPIO PWM for servo control in particular, though, the results are pretty awful. Look at something like Servo Blaster- https://github.com/richardghirst/PiBits/tree/master/ServoBlaster

Or, as @alphanumeric suggests, grab another, more compact servo driver since you really can’t beat dedicated chips! (Of course it depends what you want to do with your servos, sometimes a bit of inaccuracy and jitter is fine)


#4

Thank you very much, @alphanumeric and @gadgetoid,

I have read about this a while back but forgot about motors not being servos! I’m sorry for that.

Thank you again for your help, not only for having a precise servo for my current project as well as having a better way to setup the jittering servo (which is, in itself, a very interesting thing to explore next)

Cheers!