Hi Jonathon
Thanks your reply.
But I test ClearMultiTurn() in H42-20-S300-R it’s always not work, I get the error message.
[RxPacketError] Hardware error occurred. Check the error at Control Table (Hardware Error Status)!
Here is my test code, I set H42 to position 0 & position 910635 (this value may turn 1.5 circle), using ClearMultiTurn() after turn to position 910635 then turn back to positon 0, if this success, present position value must reset position 910635 to 1 circle’s value, then turn 0.5 circle to position 0, not turn back 1.5 circle to position 0.
# !/usr/bin/env python
# DYNAMIXEL PRO H42-20-S300-R
# Model Number : 51201 (H42-20-S300-R(A))
# Firmware Version : 13
# ID : 1
# BaurRate : 57600
from dynamixel_sdk import *
port = PortHandler('COM15')
packet = PacketHandler(2.0)
if port.openPort():
print("port open")
port.setBaudRate(57600)
# change to position mode & reset position value
packet.write1ByteTxRx(port, 1, 11, 3)
# change to extendend position mode
packet.write1ByteTxRx(port, 1, 11, 4)
# torque on
packet.write1ByteTxRx(port, 1, 512, 1)
# move to position 0
packet.write4ByteTxRx(port, 1, 564, 0)
while 1:
pos, result, error = packet.read4ByteTxRx(port, 1, 580)
print(pos)
if pos == 0:
break
# move to position 910635
packet.write4ByteTxRx(port, 1, 564, 910635)
while 1:
pos, result, error = packet.read4ByteTxRx(port, 1, 580)
print(pos)
if pos == 910635:
break
time.sleep(1)
# clear multiturn function & show present position
result, error = packet.clearMultiTurn(port, 1)
print("%s" % packet.getTxRxResult(result))
print("%s" % packet.getRxPacketError(error))
pos, result, error = packet.read4ByteTxRx(port, 1, 580)
print(pos)
# move to position 0
packet.write4ByteTxRx(port, 1, 564, 0)
while 1:
pos, result, error = packet.read4ByteTxRx(port, 1, 580)
print(pos)
if pos == 0:
break
# torque off
packet.write1ByteTxRx(port, 1, 512, 0)```