AL5B joints position

hello to all
I writing a matlab code to control the al5b.
I want know each joint is in which position.
for example I want know the base joint is in which position to calculate the error for this joint.

thanks for your help

Te Hitec (RC Hobby) servos do not have any feedback. You send them the position command and expect that they move to that position. The only reason they cannot move to a specific position would be if the torque required is too strong, the servo is blocked or if it is defective. You would need to add an external feedback mechanism if you wanted to calculate position error.