elephantrobotics / pymycobot

This is a python API for ElephantRobotics product.
MIT License
107 stars 54 forks source link

MyCobot 280 M5 - robot resets occasionally during suction pump usage #65

Closed lalado-o closed 2 weeks ago

lalado-o commented 1 month ago

Describe the bug When the pins used for suction pump activation and deactivation are set to running state, the UI on MyCobot 280 M5 would restart, causing the system to malfunction and skip few processes expected in the code. This happens very occasionally, and there doesn't seem to be a reliable way to trigger it.

It seems setting pin 5 to running state would almost always cause this error

To Reproduce Steps to reproduce the behavior:

  1. Using VSCode and Python and input the following codes:
from pymycobot.mycobot import MyCobot
import time

mc = MyCobot("COM5", 115200)

mc.set_basic_output(2, 0)
mc.set_basic_output(5, 0)
time.sleep(2)

mc.set_basic_output(2, 1)
mc.set_basic_output(5, 1)
time.sleep(2)
  1. connect GND, 5V, G2 and G5 on the suction pump to G, 5V, 2, and 5 as basic inputs respectively
  2. assuming the rest of the wire connections are correct, activate the robot and the above python code

Expected behavior The robot UI shouldn't be restarted

Videos https://github.com/elephantrobotics/pymycobot/assets/172010336/9b65a581-a1d3-4c21-b01d-a007ccf3a5cb

anla-xu commented 4 weeks ago

Please try the following code to see if it works properly:


from pymycobot.mycobot import MyCobot
import time

mc = MyCobot("COM5", 115200)

mc.set_basic_output(2, 0)
mc.set_basic_output(5, 1)
time.sleep(2)

mc.set_basic_output(2, 1)
mc.set_basic_output(5, 0)
time.sleep(2)```