Servo DS3120

Servo control

Servo motors such as in the photo are used to drive devices controlled by turning the shaft. Here’s how to control multiple servos from Raspberry Pi.

  1. git clone https://github.com/richardghirst/PiBits.git
  2. cd PiBits/ServoBlaster/user
  3. sudo make
  4. sudo make install

pi@raspberrypi:~ $ sudo servod

Board model: 3B
GPIO configuration: P1 (40 pins)
Using hardware: PWM
Using DMA channel: 14
Idle timeout: Disabled
Number of servos: 8
Servo cycle time: 20000us
Pulse increment step size: 10us
Minimum width value: 50 (500us)
Maximum width value: 250 (2500us)
Output levels: Normal

Using P1 pins: 7,11,12,13,15,16,18,22

Servo mapping:
0 on P1-7 GPIO-4
1 on P1-11 GPIO-17
2 on P1-12 GPIO-18
3 on P1-13 GPIO-27
4 on P1-15 GPIO-22
5 on P1-16 GPIO-23
6 on P1-18 GPIO-24
7 on P1-22 GPIO-25

Under the spoiler, a python script for controlling servomotors:

You can see the result on my YouTube video.

 

30

Leave a Reply