Motor keeps taking long path

Hello, I have an issue where whenever it goes from negative to positive angle value, (im using -180 to 180 degrees setup instead of 0 to 360) the motor just turns like 360 or 180 degrees for some reason; taking the longer path. is there a way to make it take the short path so it doesnt have to spin all around to get to the next angle?

im using position mode, and im using this method to turn the angle into position:

def rad_to_pos(rad, offset=0.0):
rad = wrap_to_pi(rad + offset)
deg = np.rad2deg(rad)
deg = (deg + 360) % 360
return int(deg * 4095 / 360)

Which is exactly the DXL actuator model that you are using? Because some actuators have different ways to handle this issue.

Also you have a subtle conversion error that everybody makes, including me in my beginning career :face_with_open_eyes_and_hand_over_mouth:. For robotis actuator: 0 corresponds to 0 degrees and 360 deg corresponds to 4096 (not 4095)

One important question regarding your project. Do you need your DXL to actually travel more than 360 deg. in the physical world from its Init Position?