jps Posted July 15, 2017 Posted July 15, 2017 Hello. I am trying to control a servo, and after a lot of mistakes and hits in the face... finally i can move it with WiringOP (https://github.com/zhaolei/WiringOP) I use one of the examples called servo.c and the servo moves to one side and another. This is the first step, but the servo makes weirds movements. Watch this video. Any iddeas why? Any other way to control a servo? I am not C expert, some way to do it with Python? Thank you very much in advance. servo.c
pzw Posted July 15, 2017 Posted July 15, 2017 The "weird" moves are because the pulse to the servo has a lot of jitter. It is very hard to do time critical processes like servo pulses in Linux.
jps Posted July 16, 2017 Author Posted July 16, 2017 But Raspberry can manage it perfectly... I tried with WiringOP, WiringBP compatible con Banana Pi, orangepi_PC_gpio_pyH3... I think is more a library problem than a Linux problem.
pfeerick Posted July 16, 2017 Posted July 16, 2017 Can the Raspberry 'manage it perfectly' on any pin, or just one? As IIRC, the rPi has one dedicated PWM capable pin, which should be stable... not sure about the oPi? I'm not saying there aren't library, hardware and configuration differences that could be causing the problem, just that I know that is one possible reason for this variance.
jps Posted July 16, 2017 Author Posted July 16, 2017 Orange Pi have a pin called PWM1 (PA6 - pin number 7) so it must be able to manage PWM. In script.bin configuration file it can be enabled and disebled... So must be possible. Still looking for a way to do it. Thank you guys.
zador.blood.stained Posted July 16, 2017 Posted July 16, 2017 According to currently available sources and documentation on H3 only PA5 can be used for hardware PWM.
jps Posted July 16, 2017 Author Posted July 16, 2017 Yes, PA5 is the middle pin of the serial debug port. I can move "weirdly" the servo from PA6, this pin of the serial debug port and pin 10, but i can not control the tremor movements...
Recommended Posts