Catch Unit

Catch is a gripper that uses a SG92R servo as a power source. The servo uses a PWM signal to drive the gripper gear to rotate and control the gripper for clamping and releasing operations. The structure adopts a design compatible with Lego 8mm round holes. You can combine it with other Lego components to build creative control structures, such as robotic arms, gripper carts, etc.

Support the following products:

CatchUnit

Micropython Example:

 1# SPDX-FileCopyrightText: 2024 M5Stack Technology CO LTD
 2#
 3# SPDX-License-Identifier: MIT
 4
 5import os, sys, io
 6import M5
 7from M5 import *
 8from unit import CatchUnit
 9import time
10
11
12catch_0 = None
13
14
15import random
16
17
18def setup():
19    global catch_0
20
21    M5.begin()
22    Widgets.fillScreen(0x222222)
23
24    catch_0 = CatchUnit((8, 9))
25
26
27def loop():
28    global catch_0
29    M5.update()
30    catch_0.set_clamp_percent(random.randint(1, 100))
31    time.sleep_ms(100)
32
33
34if __name__ == "__main__":
35    try:
36        setup()
37        while True:
38            loop()
39    except (Exception, KeyboardInterrupt) as e:
40        try:
41            from utility import print_error_msg
42
43            print_error_msg(e)
44        except ImportError:
45            print("please update to latest firmware")

UIFLOW2 Example:

example.png

cores3_catch_example.m5f2

class CatchUnit

Constructors

class CatchUnit(port: tuple)

Initialize the Servo.

参数:

port (tuple) – The port to which the Servo is connected.

UIFLOW2:

init.png

Methods

CatchUnit.clamp() None

Clamp the gripper.

UIFLOW2:

clamp.png

CatchUnit.release() None

Release the gripper.

UIFLOW2:

release.png

CatchUnit.set_duty(duty: int) None

Set the duty cycle.

参数:

duty (int) – The duty cycle. from 20 to 54.

UIFLOW2:

set_duty.png

CatchUnit.set_clamp_percent(percent: int) None

Set the clamping percentage.

参数:

percent (int) – The clamping percentage. from 0 to 100.

UIFLOW2:

set_clamp_percent.png

CatchUnit.deinit() None

Deinitialize the Servo.

UIFLOW2:

deinit.png