diff --git a/Controller/driver/motors/dmbots/motor.py b/Controller/driver/motors/dmbots/motor.py index 52f6c2f96c99e1754847fc2550d922eee2975e76..911b7953ab8164c523da3e8c6a2a374b4c1a4494 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) @@ -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: @@ -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 e3f26070f6b4b1f4665b0b7b63a55419b9143e68..96578c9ab8ad00d3ee19ef914af6698bd5840004 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,10 @@ Coarm机械臂底层运动控制库 ## 更新说明 +### Update v1.0.10 +1. 修改motor中上一时刻速度取值细节 +2. 修改电机反馈帧解码函数,提取数据位高位 + ### Update v1.0.9 1. 修改轨迹运动部分,在到位精度内关节不运动 2. 增加运动完成时间比率