From f4c4f2a657d20281249a31d0bd59d2504db6aadd Mon Sep 17 00:00:00 2001 From: DzC-0i <11778119+DzC-0i@user.noreply.gitee.com> Date: Thu, 28 Nov 2024 16:14:29 +0800 Subject: [PATCH 1/2] =?UTF-8?q?Update=20v1.0.10=20=E4=BF=AE=E6=94=B9motor?= =?UTF-8?q?=E4=B8=AD=E4=B8=8A=E4=B8=80=E6=97=B6=E5=88=BB=E9=80=9F=E5=BA=A6?= =?UTF-8?q?=E5=8F=96=E5=80=BC=E7=BB=86=E8=8A=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Controller/driver/motors/dmbots/motor.py | 2 +- README.md | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Controller/driver/motors/dmbots/motor.py b/Controller/driver/motors/dmbots/motor.py index 52f6c2f..bf45605 100644 --- a/Controller/driver/motors/dmbots/motor.py +++ b/Controller/driver/motors/dmbots/motor.py @@ -240,7 +240,7 @@ class Sync(threading.Thread): target_velocity = pvt[1][0] target_position = pvt[0][0] if target_position != 0: - last_velocity = target_velocity + last_velocity = pvt[1][0] else: # target_velocity = self.__target_velocity if self.__motor_control_mode == POS_VEL or self.__motor_control_mode == Torque_Pos: diff --git a/README.md b/README.md index e3f2607..394d153 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,9 @@ Coarm机械臂底层运动控制库 ## 更新说明 +### Update v1.0.10 +1. 修改motor中上一时刻速度取值细节 + ### Update v1.0.9 1. 修改轨迹运动部分,在到位精度内关节不运动 2. 增加运动完成时间比率 -- Gitee From 828aca5f1e45f02ad80dbaf6ddb62020cc2dbd03 Mon Sep 17 00:00:00 2001 From: DzC-0i <11778119+DzC-0i@user.noreply.gitee.com> Date: Fri, 29 Nov 2024 14:40:45 +0800 Subject: [PATCH 2/2] =?UTF-8?q?Update=20v1.0.10.2=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E7=94=B5=E6=9C=BA=E5=8F=8D=E9=A6=88=E5=B8=A7=E8=A7=A3=E7=A0=81?= =?UTF-8?q?=E5=87=BD=E6=95=B0=EF=BC=8C=E6=8F=90=E5=8F=96=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E4=BD=8D=E9=AB=98=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Controller/driver/motors/dmbots/motor.py | 3 ++- README.md | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Controller/driver/motors/dmbots/motor.py b/Controller/driver/motors/dmbots/motor.py index bf45605..911b795 100644 --- a/Controller/driver/motors/dmbots/motor.py +++ b/Controller/driver/motors/dmbots/motor.py @@ -132,7 +132,7 @@ class Sync(threading.Thread): return numpy.uint16((value - min_value) * (((1 << bits) - 1) / (max_value - min_value))) def decode_response_frame(data): - status = (data[0] & 0x10) >> 4 + status = (data[0] & 0xF0) >> 4 position = uint_to_float((data[1] << 8) + data[2], -12.5, 12.5, 16) velocity = uint_to_float((data[3] << 4) + (data[4] >> 4), -30, 30, 12) torque = uint_to_float(((data[4] & 0x0F) << 8) + data[5], -10, 10, 12) @@ -496,6 +496,7 @@ class Motor(MotorBase): time.sleep(0.1) # Clear Error self.sync.clear_error() + time.sleep(0.1) # Switch motor control mode self.switch_control_mode(self.motor_control_mode) # Power on motor and set motion to PP mode diff --git a/README.md b/README.md index 394d153..96578c9 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,7 @@ Coarm机械臂底层运动控制库 ### Update v1.0.10 1. 修改motor中上一时刻速度取值细节 +2. 修改电机反馈帧解码函数,提取数据位高位 ### Update v1.0.9 1. 修改轨迹运动部分,在到位精度内关节不运动 -- Gitee