Hi everyone,
I’m using the Cyber Brick remote controller with standard 180° servos, and I’ve noticed that whenever I turn the servo to a new angle, it always snaps back to its neutral (initial) position. This happens regardless of where I move it, it just won’t hold the last position. Here’s the model I’ve printed: Servo Mini Arm V2 - CyberBrick by LucaDilo MakerWorld: Download Free 3D Models
From what I understand, the current firmware logic sends a “stop” command that resets the servo to its neutral angle instead of holding the last commanded position.
I analyzed the Python source code (with AI assistance) and tried monkey-patching the stop method in ServosControllerExecMapper to hold the last angle instead:
# Simple Servo Fix - Alternative approach
from control import ServosControllerExecMapper
servo_mapper = ServosControllerExecMapper()
original_stop = servo_mapper.singleton.stop
def hold_position_stop(servo_idx):
"""Hold position instead of stopping"""
internal_idx = servo_idx - 1
if 0 <= internal_idx < len(servo_mapper.singleton.servos_map):
current_angle = servo_mapper.singleton.servos_info_map[internal_idx]["c_ang"]
duty = int(current_angle * 102 / 180 + 25)
servo_mapper.singleton.servos_map[internal_idx].duty(duty)
servo_mapper.singleton.servos_info_map[internal_idx]["step_en"] = False
print(f"Servo {servo_idx} holding at {current_angle}°")
servo_mapper.singleton.stop = hold_position_stop
servo_mapper.singleton.original_stop = original_stop
print("Servo position hold fix applied!")
Unfortunately, this didn’t solve the problem, possibly because I’m hooking into the wrong place in the execution flow.
My main blockers now are:
-
I’m not sure exactly where to trigger this code. I tried triggering it on the left stick’s X‑axis movement, but it didn’t work.
-
I’m also not sure how to “upload the modified code to the onboard file system of the Controller Core” and then debug it.
Has anyone here tried modifying servo behavior in Cyber Brick?
- Is there a known way to make it hold its last commanded position instead of returning to neutral?
- What’s the best way to deploy and debug modified Python code on the Controller Core?
Thanks in advance!