Pybot: Python + 3D Printed Robotic Arm

by jjrobots in Circuits > Robots

11269 Views, 89 Favorites, 0 Comments

Pybot: Python + 3D Printed Robotic Arm

pybot-Robotic-Arm-front-view.jpg
DSC_0048.jpg
Modifiying-your-PyBot-Robotic-Arm.jpg

This 3D printed Pybot SCARA Robotic arm has been created using common and affordable elements from the 3D printed World (NEMA 17 motors, Linear bearings, timing belts...)

The idea was to create a reliable, fast, modifiable and accurate Robotic Arm for everyone who wants to have a very cool desktop robot and/or anyone willing to learn robotics and mechanics. The control APP has been created with Python

Robotic Arm 3D interactive model

We have written a detailed assembly guide, explained the Mechanical design and code on its landing webpage : https://www.jjrobots.com/scara-robotic-arm-by-jjrobots/

The control code has been written in PYTHON, and it has been thoroughly explained and commented for easy understanding.

The control APP for MacOS and Windows is freely available and 100% OPEN. User guide here

All the links to code, assembly guides...etc can be found here: https://www.jjrobots.com/scara-robotic-arm-by-jjrobots/

Video: Two SCARAs collaborating picking up and piling up 3D printed cubes. We are using a LEAP motion sensor to control both arms at the same time.

Scara Robotic Arm GRIPPER (2 DOF)

The Pybot´s clamp doing clamps things

Pybot Robotic Arm features:

  • Google Blockly controllable
  • Trajectory movement (you can add up to 20.000 trajectory points)
  • Real Time control using your mouse or Xbox/PS4 controller
  • Leap Motion gesture control
  • Artificial vision control OPENCV (Use your webcam to tell the robot what to do)
  • 100% OPEN SOURCE (Arduino control board and Python control code)
  • Control it via USB or WIFI
  • Smartphone/ Tablet control APP (for iOS and Android devices)

This pyBot (SCARA type) Robotic Arm has been designed with seven conditioning factors in mind:

  1. Making it "printable" with any 3D printer in the market no matter its capabilities or limitations
  2. Use common elements of the MAKER / 3D printer World
  3. Easy to set-up, OPEN and well documented.
  4. Python code controlled
  5. USB+Wifi controllable
  6. Fun, versatile and easy to modify

Side and Top view of the pybot SCARA Robotic arm.
This robot mounts three NEMA17 stepper motors and 2 servos (SG90/MG90 or SG92R)

Mechanical specifications:

  • Robot frame total height: 270 mm.
  • Nº of axis: 3 (arm) + 2 (clamp)
  • Working height with the clamp mounted: 145 mm
  • Arm (extended) length: 24 cms
  • Working area: 1190 cm2
  • Horizontal max. speed: 22 mm/s
  • Vertical max speed: 25 mm/s
  • Total Weight: 2120 grams
  • Repeatability (mm): 0.4mm
  • Maximum Payload Capacity (arm extended) = approx. 150 g
  • Range of motion per axis: Arm: ~190° Forearm: ~280°
  • Driving motors: 3x NEMA17 1.8° stepper motor
  • Gripper / Actuator drivers: 2x SG90 /MG90 / MG92R servos

The pyBot SCARA type robotic arm sweeps and angle of approx 315° quickly reaching any point inside that extent. This is an advantage over other robotic arms with vertical elbow configuration (Delta and Polar types) as just one or two simple motor action/s is required to move the arm. Once retracted, the robot is compact and its volume minimal

SCARA arms are good for vertical assembly operations, such as inserting pins in holes without binding or pick and place objects to a certain location when you need speed and accuracy once reached the target. The joints are load points that need robust bearings and high-torque motors or reductions to handle the loads when the arm extends.

They are suitable for complex movements that simulate a human arm with its elbow — reaching under something to grab a part and place it on a conveyor, for example.

Arm´s covered angle. Due to the mechanical relationships between arm and forearm, a proper control of the forearm is a must during the arm movement. The forearm can cover up to 280°. While moving the forearm, the arm´s motor has to be steady (holding itself in position) A regular servo (SG90, MG90 or SG92R) will work as wrist and will be mechanically limited to a (approx) 160° angle. The control software has the capability to keep it straight during the movements (to a certain point, limited by the physical construction of the servo)

The main frame: Created using 3 x8 mm stainless steel round bars that will work are rails. A perfect alignment of the 3 bars is mandatory. To help the base´s bars channels to keep the rails straight, a support triangle placed 2 cm over the base with hold the rails firmly. That piece and the top triangle (light grey) will prevent the frame to vibrate when the Z-platform is moving fast up and down.

Moving UP and DOWN

There is a stepper motor embedded in the robot´s base. That motor, rotating, will lift or low the Z-platform. The arm is fitted to this platform so if we lift the platform, we are lifting the arm too.

The motor´s shaft in connected to a threaded rod (2mm/rev) mounting a coupler. This element will do the job of continuing the physical connection between motor and rod and reducing vibrations during any vertical movement. But, how the threaded rod push or pull the Z-platform? There is a threaded nut fitted tight in the platform, so every complete turn of the threaded rod, the nut, will push the platform up, 2mm if rotates clockwise and down if rotates anti-clockwise.

Side view of the frame with the Z-platform already placed and the Z-motor embedded. All the elements displayed have a role when the robot moves up/ down the Z-platform. The nut (red arrow) does the real job of moving the Z-platform up and down.

The Robotic arm has been designed placing the motor1 and 2 (you will know more about them if you keep reading this document) opposing the weight of the arm and any object lifted by the robot´s gripper. Looking for a good general balance so the linear bearings embedded in the Z-platform does not suffer from any angular force. This will allow to considerably reduce the friction letting the Z axis to be agile and fast.


Moving the arm and forearm

TOP VIEW of the Z-platform. The motor1 making use of a pulley reduction (16 to 72)

The ARM element will be moved by a NEMA17 motor (motor1) transferring the shaft´s rotation to the component using a gear reduction of 16 to 72. The motor´s shaft has a 16 teeth pulley, which transmits the movement to a 72 teeth gear located on the Robot´s arm. Doing this, we are reducing the rotational speed 4,5 times + increasing the power delivered 4,5 times: We have to rotate the motor1 10° to get a 45° arm rotation

Simplified representation of the motor1 (green) -driving element- and the arm (red) -driven element-. This gear-belt reduction allows to increase the arm´s power and, at the same time, the accuracy of the arm TOP VIEW; Transferring the movement to the forearm from the motor2 using a 16 to 62 teeth and a 33 to 62 teeth reductions.

To drive the forearm, the robotic arm uses the same mechanism: reduction, in this case two reductions chained. 16 to 62 (x3,875) and 33 to 62 (x1,879), that means we are applying a reduction of speed of approx 7.28 times (3,875 x 1,879) and increasing the power the same amount. Keep in mind that reducing the rotational speed increases the accuracy of the forearm reaching any target point.


Controlling two rotational articulations

A SCARA type robot, beside its advantages has an inherent problem: how to properly control the motors so you can get good speed and precision drawing simple geometric figures achieving good repeatability. It is not a simple thing to draw on a paper a straight like with a SCARA. A Cartesian robot (like a regular 3D printer or the iboardbot) is way easier to control as you only need to spin its controlling motors shafts certain number of steps (you can add a reduction but that will not change the way the robot moves). But a SCARA pivots around two points, the "shoulder" and the "elbow". We have created a powerful yet simple algorithm of control. You can take a look at it already implement in Python here, in the "HOW TO CONTROL THE SCARA Robotic Arm. CODE"

With a good motor control algorithm, even with the arm completely extended, the SCARA Robotic arm can achieve a 0.2 mm repeatability accuracy.

Bill of Materials + 3D Printed Parts

3D PARTS SCARA ROBOTIC ARM ALL.png
PyBot KIT components (with optionals) V1.1..png
3D PARTS SCARA ROBOTIC ARM SUPPORT.png
  • SCARA Arm 3D printed parts SET
  • 3x Steel Rod (Stainless 304/306) Ø 8 mm 250 mm
  • 3x NEMA 17 stepper motor (high torque)
  • 12V/2A Power supply with 2.1 mm POWER JACK
  • LIDAR distance sensor + i2C cable
  • 2x MOTOR CABLES (45 cm)
  • 1x MOTOR CABLE (14 cm)
  • 2x 16 teeth GT2 pulley
  • 2x Linear Bearing LM8UU
  • 1x Linear Bearing LM8LUU
  • 5x Circular Ball bearing 623zz
  • 1x Circular Ball bearing 608zz
  • 3x Circular Ball bearing 6002RS
  • 2x SERVO carbon gears MG92R
  • 1x Threaded Steel Rod (Z axis) + nut Ø 8 mm 200 mm
  • 3x Timing belt 280 GT2
  • 2x Cable SERVO extender 50 cm
  • 1x Cable wrap 50 cm (fabric)
  • 1x Aluminum axis coupler (8to5)
  • 1x Evo Foam 15 × 30 mm (to increase the gripper friction)
  • 4x Rubber bands (25 mm diameter approx.)
  • DEVIA control Board
  • 3x Motor drivers A4988 + heat sinks
  • USB cable 1 m (micro USB connector)
  • Set of M3 BOLTS, WASHERS and NUTS (6, 10, 15, 40 mm) + Allen Keys

The 3D parts models can be found here (thingiverse repository)

Printing settings:

Rafts: No

Supports: Yes

Resolution: 0.22

Infill: 25%

Filament brand: Any good filament

Filament material: PLA, PLA+, PETG, ABS

Notes: All the parts are easy to print but you will need to add SUPPORT to two:REDUCTION and FOREARM. In the images attached to the gallery you will see the recommended orientation for every element to be printed. Gently remove the support once printed. The REDUCTION part is a critical part of the robot. Print is slowly.

Assembly Guide

BEFORE STARTING: Most of this Robot elements have been "3D printed". The "official" KIT comes with PLA Ingeo 870 printed parts, much more durable and with higher resistance to impact than the regular PLA. Of course, you can print the parts by yourself in ABS or PLA but keeping this in mind: You can break it if you apply too much force or tight a screw more that you should. We will let you know, during this assembly guide, when you can tighten the screws as much as you can or where you should just fix a part to another not forcing it at all.

If you choose to print the parts by yourself: every filament (PLA, PLA+, ABS, PETG...) has its own set of "perfect printing" parameters in order to achieve the flawless 3D-printed parts, if you overheat the filament, the layer thickness will be increased and the different part´s tolerances may be compromised. This should not be a problem but using a knife to clean the parts a little bit may be mandatory.

During the design process, we have tested many 3D printers and a bunch of filament brands and if you print the parts carefully, you will not find problems at all.

We have uploaded a 3D model of the SCARA Robot Arm to Skecthfab as a visual reference. If you get lost or just want to get a good idea of where everything goes, just check it out


SCARA ROBOTIC ARM ELEMENTS (BOM):

SCARA Arm 3D printed parts
NEMA 17 stepper motor (MT-1703HS168A or equivalent)3
MOTOR CABLES (45 cms)2
MOTOR CABLES (14 cms) 1
16 teeth GT2 pulley 2
Linear Bearing LM8UU2
Linear Bearin LM8LUU1
Circular Ball bearing 623zz5
Circular Ball bearing 608zz1
Circular Ball bearing 6002RS or 6002ZZ3
SERVO MG92R (to open/close gripper and wrist)2
Steel Rod (Stainless 304/306) Ø 8mm 250mm3
Threaded Steel Rod (Z axis) + nut Ø 8mm 200mm 1
Timing belt 280 GT23
Cable SERVO extender 50 cm2
Cable wrap 50 cms (not mandatory but recommended)1
Aluminium axis coupler (8to5)1
Evo Foam 15 x 30mm (to increase the gripper friction)1
Rubber bands (25mm diameter aprox.)4
DEVIA control Board (or equivalent Arduino M0, ESP8266 + 3xstepper motor shield)1
Motor drivers A4988 + heatsinks3
USB cable 1m (micro USB connector) 1
12V/2A Power supply with 2.1mm POWER JACK1
BOLTS and NUTS
M3 6mm bolt 26
M3 10mm bolt 10
M3 15mm bolt 8
M3 45mm bolt 3
M3 nuts10
M3 washers4
headless M3 bolt2
ALLEN Key (hexagonal) 1.5mm1
ALLEN Key (hexagonal) 2mm1

FRAME. Setting everything up

First, gather all the elements to create this Robot. If you have printed the parts by yourself, gently remove the burr and the support of the FOREARM piece. With the kit you will get 2 Allen type keys but you will need a screwdriver and maybe pliers too.


GRIPPER. Assembly guide

Follow this link to the Gripper assembly guide.

ELECTRONICS. How to connect everything

We will to precisely move 3x Stepper motors and 2x Servos. The SCARA Robotic Arm will be controlled via USB cable or WIFI. We have opted to create our own Robotics Control Board, the DEVIA. It has a powerful ARM Cortex M0 processor and a bunch of input/output ports + sensors. Perfect for this purpose. Below, the diagram of the electronics in charge of controlling the Robot. You can use an Arduino ZERO and external shields to control the motors. Here is the DEVIA control board electronics schematic.

Above: Electronic Scheme of the DEVIA control board and how every actuator is connected You can fix the DEVIA control board to the SCARA´s BASE using two M3 6mm bolts as above.

Above: Connect the motors and servos as indicated. Use the SERVO CABLE Extenders (50cm) to connect the servos to the electronics and the pick the right motor cables length according to the scheme. Never connect, disconnect anything while the power supply is plugged in to the Control Board.

There are two types of cables to be connected to the control board, the motor cables and the servo extenders. Double check the connections. It is easy to make mistakes: they have the same colors! The cable wrap will save you problems: Pack several cables up inside the the wrap and fix it to the base and between the motors on the Z-platform. The SCARA´s frame have several holes / channels meant to be zip-ties fixing point.

Cables slack: Keep in mind that the cables must let the arm move freely. If they are too tight, they will limit the robot movement (and possibly they will get broken). So, run the cables from the actuators to the control board and move the robot´s arm to its physical limits ( fully retracted, fully extended, gripper completely rotated, raise the Z-BASE to the top...). Once you are sure the cables are not interfering with the movements, fix them using zip ties. You can use the cable wrap to tidy everything up a little bit.


Useful Links

Gcode-interpreter (1).gif
xbox_controller_1_1 (1).gif
Editint_the_waypoints_1_1 (1).gif
picking_up_MandM_1_1 (1).gif

---------------------------------------------------------------------------

Follow us for project updates: Instructables / Facebook or Twitter