EN RU CN
Yaw axis going through back
  • Hello,
    I have a problem with yaw axis.
    Right now i am using 2.70b2 firmware (for mavlink 2 support). I have encoders on all axis, and i have set limits on all axis (-130 to 130 for yaw in encoder tab).
    When I send do_mount_controll 110 on yaw, wait for gimbal to move to position, and then send do_mount_controll to -110 on yaw, gimbal is trying to move "from back" (110 -> 180 ->250) meaning it is trying to turn through position that is locked by encoders and is getting stuck on 130 deg position.
    If i try to execute command "Rotate YAW +/- 180 from current position" gimbal is correctly finding its way through home position (110 -> 0 -> -110).
    Is there any way to force gimbal to go through 0 position when changing from -110 to 110 position ?
  • Hello,

    Concerning the reason for the problem, here is an explanation: when processing a setpoint angle, the controller does a "phase unwrapping" to convert a limited value in a range from -180 to 180 to a continuous infinite angle. For example, if you need to rotate to angles 170, 180, 190, 200 but you can't send values outside +-180 range in the command due to protocol restrictions, you should send 170, 180, -170, -160.

    But our phase unwrapping algorithm does not take into account the encoder limits. As you noted, the command "Rotate +-180" does it. It will be good to have this check in the MavLink commands as well, and we will add it into next release 2.70b5: it will go by the shortest way only if there is no limits in any motor on the trajectory.

    With the firmware you have, the solution would be sending several commands in a sequence to let our phase unwrapping filter properly detect the correct direction. Two consecutive сommands should have the distance between points less than 180 degrees. In your example, it might be -110, 0, 110. You can send two commands YAW=0 and YAW=110 w/out pause in between.
  • Thanks for explanation. I was wondering if I have something wrong in configuration, but it seems like I will have to wait for next release. In meantime I will work on some workaround.

    Any possible date of next release ?
  • We issue release each month or so, when accumulating some number of changes.