mirror of
https://github.com/huggingface/lerobot.git
synced 2026-06-18 16:57:12 +00:00
remove set phase
This commit is contained in:
@@ -223,7 +223,7 @@ class FeetechMotorsBus(MotorsBus):
|
||||
for motor in self.motors:
|
||||
# By default, Feetech motors have a 500µs delay response time (corresponding to a value of 250 on
|
||||
# the 'Return_Delay_Time' address). We ensure this is reduced to the minimum of 2µs (value of 0).
|
||||
self.write("Return_Delay_Time", motor, 0)
|
||||
# self.write("Return_Delay_Time", motor, 0)
|
||||
# Set 'Maximum_Acceleration' to 254 to speedup acceleration and deceleration of the motors.
|
||||
# Note: this address is not in the official STS3215 Memory Table
|
||||
self.write("Maximum_Acceleration", motor, 254)
|
||||
|
||||
@@ -327,34 +327,11 @@ class SO101FollowerT(Robot):
|
||||
with self.bus.torque_disabled():
|
||||
self.bus.configure_motors()
|
||||
for motor in self.bus.motors:
|
||||
phase = int(self.bus.read("Phase", motor, normalize=False))
|
||||
if phase & 0x10: # bit-4 set = multi-turn
|
||||
new_phase = phase & ~0x10
|
||||
print(f"Switching {motor} to single-turn: 0x{phase:02X} → 0x{new_phase:02X}")
|
||||
self.bus.write("Phase", motor, new_phase, normalize=False)
|
||||
|
||||
self.bus.write("Operating_Mode", motor, 2, num_retry=2) # Set to current mode
|
||||
self.bus.write("Torque_Limit", motor, 1000, num_retry=2) # 100%
|
||||
self.bus.write("Max_Torque_Limit", motor, 1000, num_retry=2) # 100%
|
||||
self.bus.write("Return_Delay_Time", motor, 0, num_retry=2)
|
||||
self.bus.write("Protection_Current", motor, 1000, num_retry=2)
|
||||
|
||||
# Disable interfering protection systems for better torque response
|
||||
# Read current unloading condition and disable current/overload protection
|
||||
current_unload = int(self.bus.read("Unloading_Condition", motor, normalize=False))
|
||||
|
||||
# Disable multiple protection systems that can interfere with torque control:
|
||||
# Bit 32 (0x20): Load overload protection - causes torque limiting
|
||||
# Bit 16 (0x10): Current protection - causes current limiting during high torque
|
||||
# Bit 8 (0x08): Speed protection - can interfere with velocity control
|
||||
safe_unload = current_unload & ~(32 | 16 | 8) # Remove bits 32, 16, 8
|
||||
|
||||
self.bus.write("Unloading_Condition", motor, safe_unload, num_retry=2)
|
||||
print(f"Motor {motor}: Unloading condition 0x{current_unload:02X} → 0x{safe_unload:02X}")
|
||||
print(
|
||||
" Disabled: Load overload (bit 32), Current protection (bit 16), Speed protection (bit 8)"
|
||||
)
|
||||
|
||||
def setup_motors(self) -> None:
|
||||
for motor in reversed(self.bus.motors):
|
||||
input(f"Connect the controller board to the '{motor}' motor only and press enter.")
|
||||
|
||||
Reference in New Issue
Block a user