yahboom
HomeTutorialsProduct
Solution
Blog
Online Store
About Us
EN/中文
Store
myCobot 320 Arm📖
1.Product Feature
  • 1.Functional Parameters
  • 2.Controller Parameters
  • 3.Structural Parameters
  • 4.Electronic Parameters
  • 5.Coordinate System
  • 6.Introduction of Adaptive Gripper
  • 7.Introduction of force-controlled gripper
2.Common Problem
  • 1.how to ask
  • 2.driver
  • 3.software
  • 4.hardware
3.First Install and Use
  • 1.Product Standard List
  • 2.Product Unboxing Guide
  • 3.Power-on Test Guide
4.Basic Application
1. miniRoboFLow
  • 1. miniRoboFLow
  • 2. Drag & Play
  • 3. Joint Calibration
  • 4. Computer Connect
  • 5. Robot Information
2.1 myblockly
  • 1. What is myBlockly
  • 2. Preparations before using myBlockly
  • 3. myBlockly download and install
  • 4. myBlockly interface display and use of basic functions
  • 5. Control RGB light panel
  • 6. Control the robotic arm to return to the origin
  • 7. Control single joint movement
  • 8. Control multiple joints
  • 9. Use of adaptive grippers
  • 10. Use of force-controlled grippers
  • 11. Q&A
  • 12. API
2.2 myStudio
  • 1. myStudio
  • 2. myStudio environment setup
  • 3. Install driver
  • 4. Burn and update firmware
3. Firmware Description
  • 1.Firmware Description
  • 2.Burn Firmware
5.Mobile APP control
  • Mobile APP control
6.SDK Development
1.Development Environment Construction
  • 1.Development Environment Construction
2.Python
  • 1.What is Python
  • 2.Environment Building
  • 3.Python API usage instaructions
  • 4.TCP IP
  • 5.Drag to teach
  • 6.Use Cases
  • 7.Use of adaptive grippers
  • 8.Use of force-controlled grippers
3.ROS1
  • 1.ROS
  • 2.Environment Building
  • 3.ROS basics
  • 4.Rviz use
  • 5.Basic function case
  • 6.Use of adaptive grippers
  • 7.Use of force-controlled grippers
4.ROS2
  • 1.ROS2 introduction
  • 2.Environment Building
  • 3.ROS2 basics
  • 4.Rviz2 use
  • 5.Basic function case
5.C Sharp(C#)
  • 1.C#
  • 2.Environmental construction
  • 3.Mechanical control
  • 4.myCobot API
  • 5.Use Cases
  • 6.Use of adaptive grippers
6.c plus plus (C++)
  • 1.C++
  • 2.CPlus Download
  • 3.build
  • 4.API
  • 5.example
7.Arduino
  • 1.Arduino
  • 2.Arduino Download
  • 3.API
  • 4.example
  • 5.Use of adaptive grippers
8.Serial communication
  • 1.Serial communication
  • 2.Use of force-controlled grippers
7.Documents Download
  • 1.Product Brochure
  • 2.Software and Source Code
  • 3.System lnformation
Download
  • 3D_Model_File
  • Android Mobile APP
  • Manual
Download ZIP

Welcome to myCobot 320 Arm repository

6.Use Cases

Use Cases

1 Controlling RGB Light Panel

​x
from pymycobot.mycobot320 import MyCobot320
import time

# The above needs to be written at the beginning of the code, which means importing the project package

# MyCobot320 class initialization requires two parameters:
#   The first is the serial port string, such as:
#       linux: "/dev/ttyUSB0"
#          or "/dev/ttyACM0"
#       windows: "COM3"
#   The second is the baud rate:
#       M5 version is: 115200
#
#    Example:
#       mycobot-M5:
#           linux:
#              mc = MyCobot320("/dev/ttyUSB0", 115200)
#          or mc = MyCobot320("/dev/ttyACM0", 115200)
#           windows:
#              mc = MyCobot320("COM3", 115200)

# Initialize a MyCobot320 object
# Create object code here for windows version
mc = MyCobot320("COM13", 115200)

i = 7
# loop 7 times
while i > 0:
    mc.set_color(0, 0, 255)  # blue light on
    time.sleep(2)  # wait for 2 seconds
    mc.set_color(255, 0, 0)  # red light on
    time.sleep(2)  # wait for 2 seconds
    mc.set_color(0, 255, 0)  # green light on
    time.sleep(2)  # wait for 2 seconds
    i -= 1

2 Controlling Arms to Move Them to Starting Point

xxxxxxxxxx
from pymycobot.mycobot320 import MyCobot320

mc = MyCobot320("COM3", 115200)

# Check whether the program can be burned into the robot arm
if mc.is_controller_connected() != 1:
    print("Please connect the robot arm correctly for program writing")
    exit(0)

# Fine-tune the robotic arm to ensure that all the bayonets are aligned in the adjusted position
# Subject to the alignment of the mechanical arm bayonet, this is only a case
mc.send_angles([0, 0, 0, 0, 0, 0], 30)

3 Single-Joint Motion

xxxxxxxxxx
from pymycobot.mycobot320 import MyCobot320
import time

mc = MyCobot320('COM3', 115200)

# Robotic arm recovery
mc.send_angles([0, 0, 0, 0, 0, 0], 40)
time.sleep(3)

# Control joint 3 to move 70°
mc.send_angle(3, 70, 40)
time.sleep(3)

# Control joint 4 movement -70°
mc.send_angle(4, -70, 40)
time.sleep(3)

# Control joint 1 to move 90°
mc.send_angle(1, 90, 40)
time.sleep(3)

# Control joint 5 movement -90°
mc.send_angle(5, -90, 40)
time.sleep(3)

# Control joint 5 to move 90°
mc.send_angle(5, 90, 40)
time.sleep(3)

4 Multi-Joint Motion

xxxxxxxxxx
import time
from pymycobot import MyCobot320

# MyCobot320 class initialization requires two parameters:
#   The first is the serial port string, such as:
#       linux: "/dev/ttyUSB0"
#          or "/dev/ttyACM0"
#       windows: "COM3"
#   The second is the baud rate:115200
#
#    Example:
#       mycobot-M5:
#           linux:
#              mc = MyCobot320("/dev/ttyUSB0", 115200)
#           windows:
#              mc = MyCobot320("COM3", 115200)
#
#
# Initialize a MyCobot320 object
mc = MyCobot320('COM3', 115200)

# Robotic arm recovery
mc.send_angles([0, 0, 0, 0, 0, 0], 50)
time.sleep(2.5)

# Control different angles of rotation of multiple joints
mc.send_angles([90, 45, -90, 90, -90, 90], 50)
time.sleep(2.5)

# Return the robotic arm to zero
mc.send_angles([0, 0, 0, 0, 0, 0], 50)
time.sleep(2.5)

# Control different angles of rotation of multiple joints
mc.send_angles([-90, -45, 90, -90, 90, -90], 50)
time.sleep(2.5)

5 Coordinate control

xxxxxxxxxx
from pymycobot.mycobot320 import MyCobot320
import time

# MyCobot320 class initialization requires two parameters:
# The first one is the serial port string, such as:
      # linux: "/dev/ttyUSB0"
      # windows: "COM3"
      # The second is the baud rate:
      # M5 version is: 115200
        #   like:
        # mycobot-M5:
          # linux:
          # mc = MyCobot320("/dev/ttyUSB0", 115200)
          # windows:
          # mc = MyCobot320("COM3", 115200)

# Initialize a MyCobot320 object
# Create the object code below for the windows version
mc = MyCobot320("COM3", 115200)

# Get the coordinates and posture of the current head
coords = mc.get_coords()
print(coords)

# Send angular motion to a certain attitude for coordinate control, with a speed of 50
mc.send_angles([0, 0, -90, 0, 90, 0], 50)
time.sleep(2.5)

# Intelligent planning of the route, allowing the head to reach the coordinates of [-2.3, -153.2, 400.8] in a linear manner, and maintain the posture of [-120.0, 0.7, 179.73], with a speed of 40mm/s
mc.send_coords([-2.3, -153.2, 400.8, -120.0, 0.7, 179.73], 40, 1)

# Set the waiting time to 1.5 seconds
time.sleep(1.5)

# Intelligent planning of the route, allowing the head to reach the coordinates of [0.0, -120.4, 500.3] in a linear manner, and maintain the posture of [-70.81, -22.17, -163.49], with a speed of 50mm/s
mc.send_coords([0.0, -120.4, 500.3, -70.81, -22.17, -163.49], 50, 1)

# Set the waiting time to 1.5 seconds
time.sleep(1.5)

# Only change the x-coordinate of the head, setting the x-coordinate of the head to 100. Let it intelligently plan the route to move the head to the changed position at a speed of 70mm/s
mc.send_coord(Coord.X.value, 100, 70)

6 Control the robot arm to swing left and right

xxxxxxxxxx
from pymycobot.mycobot320 import MyCobot320

import time
# Initialize a MyCobot320 object

# M5 version
mc = MyCobot320("COM3", 115200)
# Get the coordinates of the current position
angle_datas = mc.get_angles()
print(angle_datas)

# Use a sequence to pass the coordinate parameters and let the robot move to the specified position
mc.send_angles([0, 0, 0, 0, 0, 0], 50)
print(mc.is_paused())
# Set the waiting time to ensure that the robot has reached the specified position
# while not mc.is_paused():
time.sleep(2.5)

# Move joint 1 to the position of 90
mc.send_angle(1, 90, 50)

# Set the waiting time to ensure that the robot has reached the specified position
time.sleep(2)

# Set the number of loops
num = 5

# Let the robot swing left and right
while num > 0:
    # Move joint 2 to position 50
    mc.send_angle(2, 50, 50)
    # Set the waiting time to ensure that the robot has reached the specified position
    time.sleep(1.5)
    # Move joint 2 to position -50
    mc.send_angle(2, -50, 50)
    # Set the waiting time to ensure that the robot has reached the specified position
    time.sleep(1.5)
    num -= 1
# Retract the robot. You can manually swing the robot, and then use the get_angles() function to get the coordinate sequence,
# Use this function to make the robot reach the position you want.
mc.send_angles([88.68, -135, 145, -128.05, -9.93, -15.29], 50)

# Set the waiting time to ensure that the robot arm has reached the specified position
time.sleep(2.5)
# Let the robot arm relax and you can swing it manually
mc.release_all_servos()

7 Controlling the robotic arm to dance

xxxxxxxxxx
from pymycobot.mycobot320 import MyCobot320
import time

if __name__ == '__main__':
    # MyCobot320 class initialization requires two parameters:
    # The first is the serial port string, such as:
        # Linux: "/dev/ttyUSB0"
        # Windows: "COM3"
    # The second is the baud rate:
        # M5 version: 115200

    # Example:
        # mycobot-M5:
            # Linux:
              # mc = MyCobot320("/dev/ttyUSB0", 115200)
            # Windows:
              # mc = MyCobot320("COM3", 115200)

    # Initialize a MyCobot320 object
    # M5 version
    mc = MyCobot320("COM3",115200)

    # Set the start time
    start = time.time()
    # Let the robot reach the specified position
    mc.send_angles([-1.49, 115, -145, 30, -33.42, 137.9], 80)
    # Determine whether it has reached the specified position
    while not mc.is_in_position([-1.49, 115, -145, 30, -33.42, 137.9], 0):
        # Let the robot resume movement
        mc.resume()
        # Let the robot move for 0.5s
        time.sleep(0.5)
        # Pause the movement of the robot
        mc.pause()
        # Determine whether the movement has timed out
        if time.time() - start > 3:
            break
    # Set the start time
    start = time.time()
    # Let the exercise last for 30 seconds
    while time.time() - start < 30:
        # Let the robot quickly reach this position
        mc.send_angles([-1.49, 115, -145, 30, -33.42, 137.9], 80)
        # Set the color of the light to [0,0,50]
        mc.set_color(0, 0, 50)
        time.sleep(0.7)
        # Let the robot quickly reach this position
        mc.send_angles([-1.49, 55, -145, 80, 33.42, 137.9], 80)
        # Set the color of the light to [0,50,0]
        mc.set_color(0, 50, 0)
        time.sleep(0.7)

8 Controlling Gripper

xxxxxxxxxx
from pymycobot.mycobot320 import MyCobot320
import time

# MyCobot320 class initialization requires two parameters:
#   The first is the serial port string, such as:
#       linux: "/dev/ttyUSB0"
#          or "/dev/ttyACM0"
#       windows: "COM3"
#   The second is the baud rate::
#       M5 version is: 115200
#
#    such as:
#       mycobot-M5:
#           linux:
#              mc = MyCobot320("/dev/ttyUSB0", 115200)
#          or mc = MyCobot320("/dev/ttyACM0", 115200)
#           windows:
#              mc = MyCobot320("COM3", 115200)

# Initialize a MyCobot320 object
mc = MyCobot320("COM13", 115200)
# make it move to zero position
mc.send_angles([0, 0, 0, 0, 0, 0], 40)
time.sleep(3)
# Pro adaptive gripper needs to be set to transparent transmission mode before use
mc.set_gripper_mode(0)
time.sleep(1.5)

num = 5
while num > 0:
    # Set the state of the gripper to quickly open the gripper at a speed of 70, Parameter 1 represents pro adaptive gripper type
    mc.set_gripper_state(0, 70, 1)
    time.sleep(3)
    # Set the state of the gripper to quickly close the gripper at a speed of 70, Parameter 1 represents pro adaptive gripper type
    mc.set_gripper_state(1, 70, 1)
    time.sleep(3)
    num -= 1

num = 3
while num > 0:
    # Set the gripper value to 0 and the speed to 70, Parameter 1 represents pro adaptive gripper type
    mc.set_gripper_value(0, 70, 1)
    time.sleep(3)
    # Set the gripper value to 50 and the speed to 70, Parameter 1 represents pro adaptive gripper type
    mc.set_gripper_value(50, 70, 1)
    time.sleep(3)
    # Set the gripper value to 0 and the speed to 70, Parameter 1 represents pro adaptive gripper type
    mc.set_gripper_value(0, 70, 1)
    time.sleep(3)
    num -= 1

# Get the value of the gripper
print("gripper value:", mc.get_gripper_value())
Drag to teach
Use of adaptive grippers

COMPANY

  • About us
  • Team Style
  • Blog

LEARNING & EXPLORATION

  • Tutorials
  • Edge AI hardware
  • Educational robots
  • Embedded intelligent hardware

WHERE TO BUY

  • Yahboom Online Store
  • Amazon
  • Alibaba
  • AliExpress
  • Mercado

TECHNOLOGY SUPPORT

  • Email: support@yahboom.com

BE A DISTRIBUTOR

  • Email: sales@yahboom.com
QR Code

Copyright © 2017-2026 Yahboom. All Rights Reserved.

EN/中文