Review of myCobot 280 Pi robotic arm with Python and visual programming

myCobot 280 Pi is a versatile robotic arm with a 6 degree of freedom design. It was developed by Elephant Robotics using the Raspberry Pi 4 board as the main controller. The robot is compact and delivers stable operation making it ideal for confined spaces. It can also be programmed in a variety of languages, is easy to use, and offers a lot of features. It is suitable for those who are interested in learning how to program a robotic arm controller and for engineering projects.

Unboxing myCobot 280 Pi

myCobot 280 Pi

The myCobot 280 Pi arm has a working range of 280 mm, weighs 850 grams, and can handle a payload of up to 250 grams. It is powered by 6 servo motors, one for each degree of freedom, and comes with a 5×5 matrix LED display, and supports LEGO parts as well.

myCobot 280 Pi Working RangeControlled by a Raspberry Pi 4 single board computer, the MyCobot 280 can be connected to a camera for image processing applications, supports Ethernet and WiFi connectivity, features four USB ports, and can be connected to a display through the Raspberry Pi 4’s micro HDMI port. Finally, the 40-pin GPIO header is also accessible for expansion with clear markings for each pin, and the rear panel includes a power switch and a DC power barrel jack.

Raspberry Pi 4 robotic arm connectors

The MicroSD card slot is located underneath the MyCobot 280 Pi robot.

myCobot 280 Pi MicroSD card

A 100-240V AC power brick with 8.4V DC output up to 5A (42 Watts) is also included in the package.

myCobot 280 Pi Power Adapter

Other accessories in the myCobot kit include:

  • myCobot-Flat Base
  • 4x Silicon suction cups to make sure the base is firmly attached to the desk
  • myCobot webcam
  • myCobot Suction Pump kit
  • Various connecting wires
  • LEGO Connectors

myCobot 280 Pi Kit

How to attach the flat base plate to myCobot 280 Pi robotic arm

myCobot Pi Flat Base Suction cups
myCobot Pi flat base and silicon suction cups

The assembly is straightforward. Simply insert suction cups in the mounting holes in the four corners and fasten them with the plastic screw head.

myCobot 280 Pi install suction cups

This is what it looks when done.

myCobot 280 Pi Flat Base Suction Cups Installed

The provided LEGO connectors allow you to easily attach accessories to the myCobot 280 Pi robot.

LEGO Connectors

Insert some LEGO connectors in the mounting plate slots as needed.

myCobot 280 Pi Flat Base LEGO Connectors

Finally, place the myCobot 280 Pi robotic arm on top of the base making sure to align it with the threads and LEGO connectors. You can now place the robot on the floor or a desk and firmly screw the suction cups in order to ensure the robot’s base does not move during operation. It’s better to place it on a smooth surface such as glass or marble.

myCobot 280 Pi Flat Base Installation

Ubuntu operating system

myCobot 280 Pi ships with Ubuntu Linux operating system and can be programmed with myBlockly visual programming IDE or/and Python in VSCode.

myCobot 280 Pi Ubuntu

Python

myCobot 280 Pi is programmable in Python which adds the ability to use the camera to detect objects and supports the OpenCV library for Artificial Intelligence, image processing, and Machine Learning.

myCobot 280 Pi Python Programming

ROS

Robot Operating System (ROS) relies on Rviz to simulate the movement of a robotic arm and control the robotic arm remotely through ROS.

myCobot 280 Pi ROS rviz

Programming MyCobot 280 Pi robot with MyBlockly

MyBlockly is a visual development tool using symbols instead of commands. This unit has a group of symbols that include Logic, Loops, Math, Text, Lists, Color, Variables, Functions as well as functions to control the robotic arm and more, so there’s everything we need to easily write a program. You can click on Run in the right corner to start the program. Let’s look at some interesting commands.

myCobot 280 Pi MyBlockly

Time in MyBlockly

The Sleep block allows you to add a delay in seconds.

Sleep visual programmingRaspi-GPIO

This set of blocks controls GPIOs (General Purpose Inputs/Outputs). It’s used to set any of Raspberry Pi GPIO pins to HIGH or LOW when in output mode or configure them as inputs.

Raspi GPIO MyBlockly

ATOM IO

This set of blocks controls the 5×5 LED Matrix of the robotic arm. You can change the value of each LED’s RGB data (Red, Blue, Green) and use PWM control as well.

myCobot Pi MyBlockly ATOM IO

The color of the LEDs will change based on the data we have entered.

myCobot 280 Pi LED Matrix 5x5 1Status

A set of blocks specific to the MyCobot 280 Pi robot notably to power it on or off, check the working status, and release all servos.

myCobot Pi MyBlockly Status

MDI Model and Operation

Those blocks control the degree of movement of the mechanical arm on each axis. Data can be entered simultaneously including speed control, or you use Coordination mode if you wish. This makes programming the robotic arm very easy.

myCobot Pi MyBlockly MDI Control

JOG Model and Operation

Those blocks also control the degree of movement of the mechanical arm on each axis in separate blocks for each axis.

myCobot Pi MyBlockly JOG Control

Running Status and Settings

Those blocks can set the speed of the mechanical arm, and query the current speed, and the min and max angles of a specific joint.

myCobot Pi MyBlockly Setting

Finding the angle of the robot on each axis

We can find the angle of each axis by reading the values from the program. This useful function helps reduce the time to find the angles by clicking on the right corner.

myCobot Pi MyBlockly Read Angles

A window will pop up. We can manually adjust the angle of the robot arm and click on the Read Angles button in the Quick Move section. The values will be automatically entered into the Set Angle block.

myCobot 280 Pi MyBlockly Read Angles

MyCobot 280 Pi Accuracy Test

We tested the movement accuracy of the myCobot 280 Pi robot and measured +/– 5% accuracy. In the test, the robot arm goes to the color on the paper while changing the LED Matrix display to match that color as you can see from the video below.

YouTube video player

myCobot Suction Pump

A suction pump that can enhance the capabilities of the myCobot 280 Pi robotic arm by enabling the lifting and moving of objects by suction. The maximum weight of an object lifted with the myCobot Suction Pump is 250 grams.

Suction pump highlights

  • Function –  suck objects to lift and move them
  • Maximum weight of the object to be lifted – 250 grams
  • Materials – Photopolymer/nylon 7100
  • Color – White
  • Dimensions – 94 x 74 x 51 mm
  • Weight – 220 grams

myCobot End effector Suction Pump

Mounting the myCobot Suction Pump to the myCobot 280 Pi

Again, we’ll use the LEGO Connectors to attach the myCobot Suction Pump.

myCobot Pi Suction Pump installation

And that’s it. The myCobot Suction Pump can be easily mounted to the myCobot 280 Pi just with LEGO Connectors.

myCobot 280 Pi Suction installation Complete

Wiring the Suction Pump to the robotic arm

We still need to wire the suction pump to the robotic arm. This can be done by connecting four wires to the Raspberry Pi 4’s GPIO header: 5V, GND, G2 (GPIO21), G5, and (GPIO22).

myCobot Pi End effector Suction Pump Port

We’ll use male Dupont cables plugged into the GPIO header with namely 5V, GND, G2 connected to GPIO21, and G5 to GPIO22.

myCobot 280 Pi wirring Suction Pump

Using myCobot Suction Pump with myBlockly

Let’s go to the Raspi-GPIO menu, and select the “Set Mode BCM” block to work with pins 20 and 21 as outputs (OUT) using Set pin command blocks.

Two sets of blocks are used to control the myCobot Suction Pump

  • To make the suction pump work, we’ll set pin 20 and 21 to HIGH
  • To stop it we’ll set both pins to LOW.

That’s all we need to enable and disable the myCobot Suction Pump.

MyCobot 280 Pi Blockly Suction

Test operation of lifting and repositioning with the suction pump

We have tested the robotic arm working together with the suction pump by moving a workpiece of a specific color to a point of the same color. We’ve noted that if the object is heavy it will take a while to suck the object, and if the object is light it will take some time to release it. But the robotic arm and suction pump can work very accurately as you can see from the test video below.

YouTube video player

MyCobot 280 Camera

The camera is lightweight and can be easily mounted to the robotic arm in a couple of minutes. It’s basically plug-and-play and the compact design means you don’t have to worry about it taking up too much space. The USB 2.0 color camera works at up to 720p HD resolution, offers a wide-angle color, and is suitable for a range of applications such as face recognition, smart screen, smart express delivery, automatic vending machines, barcode/QR code scanning, access control, medical equipment, and so on.

myCobot Camera Flange

myCobot 280 Pi image processing

Installing myCobot SuctionPump and myCobot 280 Camera to myCobot 280 Pi

We will now be connecting the MyCobot 280 Camera to the myCobot Suction Pump by first inserting LEGO Connectors into the Suction Pump…

myCobot Pi Suction install with myCobot Camera

… before inserting it into the camera to which we’ll add more LEGO connectors…

myCobot Pi Suction install with myCobot Camera Complete

… in order to install it on the MyCobot 280 Pi robotic arm.

myCobot 280 Pi Suction Pump Camera

Perfect! It could not be easier.

robotic arm with suction cup camera

Installing OpenCV and Numpy with pip

We’ll need to install libraries, namely OpenCV and Numpy, in order to run Image Processing workloads on the robot. We can install those through the Terminal in the robot’s operating system.

OpenCV is a popular library for basic image processing such as blurring, blending, enhancing image quality, increasing video quality, object recognition, detection of faces or objects in images and videos, as well as color separation which we will use in this project/review.


Numpy is a Python extension module with mathematical functions that are typically used for the manipulation of data sets (Arrays) and matrices.

Image Thresholding

Thresholding is one of the techniques for separating an object from a background image. This works by taking a gray image and converting it to a binary image with pixel values of 0 (black) or 255 (while) with a constant threshold used to sort each pixel of the image into black or white. I wrote a Python program in VSCode that can detect objects with 3 different colors. The next step of the program will try to find the red object first using the camera input. The following lower and upper ranges were defined for the red color: lowerR = np.array([142, 114, 181]) and upperR = np.array([194, 255, 255])

myCobot Pi Thresholding Red

In the case of blue objects, we’ll use the following values: lowerB = np.array([83, 228, 206]) and upperB = np.array([106, 255, 255])

myCobot Pi Thresholding Blue

And finally, here are the values for green objects: lowerG = np.array([54, 82, 228]) upperG = np.array([81, 255, 255])

myCobot Pi Thresholding Green

Thresholding sample code in Python

Two modules are imported: cv2 to manipulate images and numpy to manipulate arrays and matrices.

Using myCobot 280 Pi with a conveyor belt to sort objects (Color Sorting)

We’ll make the myCobot 280 Pi robotic arm work with a conveyor belt to sort objects of different colors. The project is comprised of two parts:

  • The conveyor belt relies on an Arduino board to control its motor, and a program/sketch checks the condition of the sensor to measure the stopping distance of the object according to the belt position.
  • The myCobot 280 Pi detects the colors with Image Thresholding and selects and moves the Red, Blue, or Green object to a bucket of the same color using the Suction Pump. Four positions were set:
    1. Red box position
    2. Blue box position
    3. Green box position
    4. Initial position to detect colored objects in a location convenient for the myCobot 280 Pi. We can move the robot arm to that position and read the values from the Serial Monitor and put the obtained values into the program, which is a very good point to find different positions

myCobot 280 Pi Conveyor Color Sorting

myCobot 280 Pi Color Sorting sample code

The library MyCobot is invoked to control the robotic arm, the library RPi.GPIO is used to enable/disable the suction pump, the cv2 library is used to manipulate images, and numpy to manipulate arrays and matrices.


Watch the videos below to see myCobot 280 Pi’s color sorting in action.

YouTube video player

YouTube video player

I would like to thank Elephant Robotics for sending me the myCobot 280 Pi robot kit with accessories for review and play.

The myCobot 280 Pi has a lot more features. It is suitable for beginners in robotics education, and with a starting price of $799 it can be used for teaching from high school to university level. The myCobot 280 Pi robotic arm can also be a great way to learn how to use robots in industrial applications. As you’ll see from our samples above, it will very easy to write programs to read the angles of the arm, and it can also be used to study forward and inverse kinematics to control a robot.

If anyone is interested, you can learn more and/or purchase a kit in Elephant Robotics’ shop.

This article was originally published in Thai language on CNX Software Thailand and written by Kajornsak Janjam.

Share this:
FacebookTwitterHacker NewsSlashdotRedditLinkedInPinterestFlipboardMeWeLineEmailShare

Support CNX Software! Donate via cryptocurrencies, become a Patron on Patreon, or purchase goods on Amazon or Aliexpress

ROCK 5 ITX Rockchip RK3588 mini-ITX motherboard

One Reply to “Review of myCobot 280 Pi robotic arm with Python and visual programming”

  1. This looks really awesome and fun, but the price tag is still way too high for exploration and just as a toy. At that price it’s easier to justify a DIY build.

Leave a Reply

Your email address will not be published. Required fields are marked *

Boardcon Rockchip RK3588S SBC with 8K, WiFI 6, 4G LTE, NVME SSD, HDMI 2.1...
Boardcon Rockchip RK3588S SBC with 8K, WiFI 6, 4G LTE, NVME SSD, HDMI 2.1...