Servo gimbal (mount) setup

Hi,

I’m trying to set up a single-axis servo gimbal, using PX4 1.6.5 on a CUAV Pixhack 2.83 on a quadrotor.

I can control the servo using RC passthrough if I plug it into output 6 and map a radio channel to AUX1 (and press the safety button).

If I plug the servo into output 8, set MNT_MODE_IN=RC, reboot, and set MNT_MAN_PITCH=AUX1, I can control the servo using RC passthrough but it does not respond to attitude changes. At the console, if I run “vmount stop” and then “vmount start” it outputs a steady stream of “ERROR [uorb] mount_orientation advertise failed”.

Am I doing something wrong?

Regards,
Mono :slight_smile:

You might be looking at two problems

  1. “it does not respond to attitude changes”: I take that to mean that the output of vmount does not try to stabilize the gimbal? That seems to stem from this line:
    https://github.com/PX4/Firmware/blob/349a468f81476419112c031f7a871d96260540ba/src/drivers/vmount/input_rc.cpp#L135
    You can try changing that to true to see if that gets your desired behavior.

  2. “ERROR [uorb] mount_orientation advertise failed”: This is a problem when re-starting the app. It should be fixed in master.

There are several fixes concerning vmount in master that are not yet in the stable release. I suggest you use the latest version, as older versions of vmount can cause vehicle freezes.

Yes, I meant that the output of vmount does not try to stabilize the gimbal.

I can confirm that restarting the app works in master. Thanks for pointing out the vehicle freeze patches since 1.6.5.

I’ll try changing the line you’ve pointed out, although I’m having trouble with my build environment at the moment. If InputRC disables stabilization whenever it updates, what is its purpose?

Edit: I can confirm changing that line to true makes it behave how I expect.

Good to know. I’m not sure why it was chosen to not stabilize InputRC. I guess it is just supposed to be a simple RC passthrough.
If you think stabilization has value in this mode, could you open an issue or even make a PR to change this? Perhaps a parameter that lets the user decide if it should be stabilized would be good.