1

With the "old" Pi v1 B, Python 2.7 (or Python 3.x.) I run a smal program for testing a servo motor. The motor opens/closes a lid on a smal fan. It worked fine, the servo not jittering. I was happy.

Then I needed extra GPIO pins so I bought the new Pie vers 2B and Python 3.x.The op system newest. And now the program will not run. No such thing as servo in RPi.GPIO Then I tried to loaded/installed the old RPIO.GPIO, same result. Finally I used the PWM and freqvency and dutycycle and could move the engine but not controll it to special angles. And the motor is jittering and getting warm.

What can I do to get the "servo" back in the new raspbwerry Pi2 B?

I also heared there should be a special GPIO pin dedicated for PWM, wich one and how? Cant´find any solution of that issue either. Appreciate all answers. Thank You. Here is the program:

import time from RPIO import PWM servo = PWM.Servo()

PW increments: 10us

servo.set_servo(18, 2120) time.sleep(2) servo.set_servo(18, 1780) time.sleep(3) servo.set_servo(18, 1670) time.sleep(3) servo.set_servo(18, 1400) time.sleep(2) servo.set_servo(18, 1730) time.sleep(3) servo.set_servo(18, 1820) time.sleep(2) servo.set_servo(18, 1950) time.sleep(2) servo.set_servo(18, 1400) time.sleep(1) servo servo.set_servo(18, 2120) time.sleep(3)

1

For servos the first was servoblaster, for servos/PWM my pigpio, then dozens of imitators.


EDITED TO ADD

RPIO.GPIO and RPi.GPIO are different Python modules.

RPIO.GPIO provided hardware timed PWM in the same way as servoblaster and pigpio. However RPIO.GPIO PWM does not work on the Pi2.

RPi.GPIO provides software timed PWM which may be OK for motor speed control (the motor's inertia will hide the jitter) but will not be OK for servos or LEDs or anything needing precise timing.

  • Thanks Joan. Will there ever be a PWM/servo in the RPi.GPIO and does the pigpio work on the RPi vers2 B? – Exner Jul 18 '15 at 9:28
  • @Exner RPIO.GPIO may be updated. I doubt that hardware timed pulses will be added to RPi.GPIO. pigpio works on all Pis. – joan Jul 18 '15 at 14:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.