SMARS QUAD ROBOT Quick start guide

QUAD ROBOT
WIRING DIAGRAM
SMA SR
SMARS - the Screwless Modular Assembleable Robotic System.
To download the files visit https://www.thingiverse.com/thing:2755973 1
0 1
GND
V+
POWER
16x12-bit PWM
PCA9685
PWM
V+
GND
2 3
GND
OE
SCL
SDA
VCC
V+
I2C Address
(Open=0/Closed=1)
GND
OE
SCL
SDA
VCC
V+
4 5 6 7 8 9 10 11 12 13 14 15
A5 A4 A3 A2 A1 A0+RW
Servo 4 Back Left
Servo 3 Back Left Foot
Base
Servo 2 Top Left
Servo 5 Back Right Foot
Servo 1 Top Left Foot
Servo 6 Top Right
Servo 7 Back Right
Servo 8 Top Right
5
4
7
6
FRONT
3
1
2
0
Connect the Servos to the servo driver board using the corresponding port numnbers as shown below.

SMARS - the Screwless Modular Assembleable Robotic System.
To download the files visit https://www.thingiverse.com/thing:2755973 2
1Print the frame
2Print the servo holders
Print 4x Servo holder & 4x Servo holder M (M is
a mirror image of the servo holder)
SG90
Servo
Servo Holder Servo Holder M
3Fit the servo into the servo holder
x8
4Fit the servo holders into the frame
The following instructions show how to assemble the SMARS Quad Robot. A bill of materials is provided at
the back of this guide along with links to where to buy the components from. Links to the 3d printed
parts are also provided at the back of this guide.
QUAD ROBOT
PRINT PARTS
SMA SR

SMARS - the Screwless Modular Assembleable Robotic System.
To download the files visit https://www.thingiverse.com/thing:2755973 3
5Print the servo arms
6Mount the servo holder in the servo arm
7Check the servo rotation
x4
8Attach the other servo holders to the frame
SG90
Servo
Insert the servo
horn onto the
servo and screw
in securely to
the servo arm
Ensure the servo can move equally in each
direction before tightening the screw.
QUAD ROBOT
FITTING SERVOS
SMA SR

SMARS - the Screwless Modular Assembleable Robotic System.
To download the files visit https://www.thingiverse.com/thing:2755973 4
9Print the feet x4
10 Mount the foot on the servo holder
11 Check the servo rotation
12 Download the python code
x4
x4
0
10
20
30
40
50
60
70
80
90
180
170
160
150
140
130
120
110
100
Feet need a rotation
of between 50ºto 150º
degrees
From the raspberry pi command line type:
git clone https://www.github.com/kevinmcaleer/smars
Then look in the folder at the python files.
cd smars
ls smars
QUAD ROBOT
FITTING THE FEET
SMA SR

SMARS - the Screwless Modular Assembleable Robotic System.
To download the files visit https://www.thingiverse.com/thing:2755973 5
Connect the Raspberry pi Zero using the following pins:
PCA9685 GND to RPI Pin 39 (or Pin 6) - Black wire
PCA9685 V+ to RPI Pin 2 - Red wire
PCA9685 SCL to RPI Pin 5 (SCL) - Green wire
PCA9685 SDA to RPI Pin 3 (SDA) - Blue wire
Note that the input voltage for the PCA9685 is 3.3v or 5v into the VCC. The V+ is for powering the
servo motors and requires more power than the raspberry pi can provide, which is why it is separate.
You can use a 9v battery to drive this, using the SMARS 9v case.
The raspberry pi communicates with the servo driver board using I2C, which only requires 2 wires:
System Clock (SCL) and System Data (SDA). These are marked on servo driver board, and on pins 3 & 7
on the Raspberry Pi Zero.
0 1
GND
V+
POWER
16x12-bit PWM
PCA9685
PWM
V+
GND
2 3
GND
OE
SCL
SDA
VCC
V+
I2C Address
(Open=0/Closed=1)
GND
OE
SCL
SDA
VCC
V+
4 5 6 7 8 9 10 11 12 13 14 15
A5 A4 A3 A2 A1 A0+RW
2
4
6
8
10
12
14
16
18
20
22
24
26
28
30
32
34
36
38
40
5v Power
5v Power
Ground
BCM 14 (TXD)
BCM 15 (RXD)
BCM 18 (PWM0)
Ground
BCM 23
BCM 24
Ground
BCM 25
BCM 8 (CE0)
BCM 7 (CD1)
BCM 1 (ID_SC)
Ground
BCM 12 (PWM0)
Ground
BCM 16
BCM 20 (MOSI)
BCM 21 (SCLK)
1
3
5
7
9
11
13
15
17
19
21
23
25
27
29
31
33
35
37
39
3v3 Power
BCM 2 (SDA)
BCM 3 (SCL)
BCM 4 (GPCLK0)
Ground
BCM 17
BCM 27
BCM 22
3v3 Power
BCM 10 (MOSI)
BCM 9 (MISO)
BCM 11 (SCLK)
Ground
BCM 0 (ID_SD)
BCM 5
BCM 6
BCM 13 (PWM1)
BCM 19 (MISO)
BCM 26
Ground
QUAD ROBOT
PI ZERO SETUP
SMA SR

SMARS - the Screwless Modular Assembleable Robotic System.
To download the files visit https://www.thingiverse.com/thing:2755973 6
0
10
20
30
40
50
60
70
80
90
180
170
160
150
140
130
120
110
100
Each servo has a range of motion
between 0ºand 180ºdegrees. However
the each robot leg only needs between
0 and 90 degrees of rotation.
The servos are oriented differently
for each leg, so the degrees of
rotation for each needs to be
understood and set correctly in the
code.
Range of Motion
Front Left = 0 to 90
Front Right = 90 to 180
Back Left = 90 to 180
Back Right = 0 to 90
180
170
160
150
140
130
120
110
100
90
180
170
160
150
140
130
120
110
100
90
0
10
20
30
40
50
60
70
80
90
0
10
20
30
40
50
60
70
80
90
FRONT
QUAD ROBOT
RANGE OF MOTION
SMA SR

SMARS - the Screwless Modular Assembleable Robotic System.
To download the files visit https://www.thingiverse.com/thing:2755973 7
Quad Robot Software Configuration
Once you’ve downloaded the python code you can
begin checking the configuration of the servos:
Python environment setup
The PCA9685 servo driver library is provided by
Adafruit and needs to be installed before setup
and using the SMARS Quad robot.
To download the adafruit servo library first
logon to the Raspberry Pi and then type:
sudo apt-get install git build-essential python-dev
cd ~
git clone https://github.com/adafruit/
Adafruit_Python_PCA9685.git
cd Adafruit_Python_PCA9685
sudo python setup.py install
Python is now setup for the servo
driver.
python limb_setup.py
Use the menu to select the channel you
want to configure. There are 16
channels, one for each servo.
The channels start at 0, and end at 15.
Menu
----
1) select channel
2) select angle
0) quit
current channel is: 0
current angle is: 0
enter number
Type ‘1’ to change the current channel.
Select Channel
--------------
currently selected channel is: 0
type channel number:, or q to return to the main menu
Next, type 0 to configure channel 0
Type ‘1’ to change the current channel.
Select Channel
--------------
currently selected channel is: 0
type channel number:, or q to return to the main menu
Next, type ‘0’ to configure channel 0
Then type ‘q’ to return to the main
menu.
Menu
----
1) select channel
2) select angle
0) quit
current channel is: 0
current angle is: 0
enter number
Type ‘2’ to set the angle for the
current channel.
Select Angle
------------
current angle is: 0
Type angle to set servo to, or press q to exit90
90
Angle is: 90
Angle = 90
Angle as a percentage = 50.0
pulse = 375
map Max = 450
current angle: 90
Type angle to set servo to, or press q to exit
Type ’90’ to set the angle to 90
Degrees.
Then type ‘q’ to return to the main
menu.
Repeat this until you have set each
limb correctly.
Finally type ‘0’ to quit the limb setup
programme.
QUAD ROBOT
SOFTWARE SETUP
SMA SR

SMARS - the Screwless Modular Assembleable Robotic System.
To download the files visit https://www.thingiverse.com/thing:2755973 8
About this Guide
This guide was written by Kevin McAleer and is provided freely to the SMARS community.
Social Media
If you haven’t already, please join the facebook community -
https://www.facebook.com/groups/141101273276325/
QUAD ROBOT
NEXT STEPS
SMA SR
Table of contents