Infomagier
Infomagier

Reputation: 329

Raspberry Pi 4 controlling a Servo without shaking

I've been trying to control a mg995 Servo by changing the duty Cycle with the RPi.GPIO library, but the Servo ended up shaking a lot. I've been reading a lot of Threads about this issue and I know, that using the RPi.GPIO library is causing the issue. I then tried to use the pigpio library but it's unfortunately not available for the RP4. I know that buying a specific hardware could help out but I want to try it with software first. Is there another way to controll a Servo without the shaking? I want to run the Servo through python code btw

Upvotes: 0

Views: 626

Answers (2)

hudada
hudada

Reputation: 1

As I tested before, software PWM is unstable and the servos can shake a lot, hardward PWM is quite acurrate, but the pi has only 2 hardware PWM channels. The best way may be add an external PWM module (PCA9685 for example).

Upvotes: 0

Jerome Favrou
Jerome Favrou

Reputation: 126

If the driving is not done at a too high PWM frequency then you can create a solution by using SYSFS driver, if you need high frequency the problem is maybe hardware and not software to control at the oscilloscope. If you are able and want to do without any lib then you can write directly the gpio registers of the SOC through memory-map with mmap

Upvotes: 1

Related Questions