How to avoid wrapping the pan/tilt cable around the spindle

We’re using an XM430-W350 mounted to the front of a mobile robot that records video. The user can position the camera using our software, which uses the C# interface in the Dynamixel SDK 3.7.42.

Before I explain, remember that the absolute position in a single revolution starting at 0 (bottom center) is tracked as a number between 0 and 4095, increasing in value in a counter-clockwise direction such that 4095 is adjacent to 0 on the left.

We were using extended position control, and only allowing a range between 1024 and -1024 to keep the cable from wrapping around the spindle. The idea is to only allow the pan to move counter-clockwise to return to center (0 position) if it’s left of center, and clockwise to return to 0 if it’s right of center. This works fine when your initial position is exactly 0, but when the device is rebooted and the initial position is left of center, what the software previously understood as position -1024 is now reported as approximately position 3072! The way to reconcile this position using extended position control is to maintain what I’ll refer to as “relative zero.” If the initial position when the device reboots is left of center (position 2048-4095), relative zero is 4095 instead of 0; if the initial position is right of center, relative zero is 0. So, in my case where the initial position was 3072, I went to position 4095 (relative zero) to center the pan, moving it counter-clockwise to avoid wrapping the cable around the spindle. To move it right in to get to absolute position 1024, I have to consider that relative zero is 4095 and move to extended position 5119.

I hope this makes sense and saves you some time.

Hi @mcostanzotn :slight_smile:

Unfortunately, the given context provide much information that makes me difficult to understand your point of query. :frowning:

Can you share video or pictures of application that can explain your issue and main point of your query??? That would help me what I should say !

I wonder if your problem has something to do with this note found in the Robotis e-Manual for the XM-430

If this is the case, I am not sure that there is a simple “programming” solution to your issue.

Perhaps, you can use two LED arrays on each side of the 0/4095 position to tell which side the servo stopped last time? Your robot can query your LED arrays for this purpose. Or perhaps some kind of custom potentiometer? Or proximity sensors? Or another camera watching this servo?