PX4 / PX4-Autopilot

PX4 Autopilot Software
https://px4.io
BSD 3-Clause "New" or "Revised" License
8.2k stars 13.37k forks source link

Servo gimbal range scaling incorrect #21146

Open dynamicUAVsolutions opened 1 year ago

dynamicUAVsolutions commented 1 year ago

Using a 2 axis servo gimbal on a quadcopter on main branch, Ark Fmu-V6x FC with control allocation, dshot output on outputs 1-4 (motors), and PWM 400hz on outputs 5&6 for gimbal servos.

mnt_mode_in = AUX

Servo throws are way too large compared to vehicle attitude changes while mnt_do_stab is enabled. Limiting output ranges on 5&6 only constrain the over compensation of the servos to a smaller throw distance. Increasing mntrange(axis) parameters have some effect in reducing this behavior, but still the gimbal is in an unusable state.

Note: this is not limited to just PWM servos (or the Ark FC). UAVCAN Servos have the same issue. In the past I have been able to mitigate with the mnt_range adjustments to achieve a workable scale (but not always).

Due to some servos having different hard internal ranges, It seems like there should be an actuator scaling parameter for servos.

Issue/Feature request?

Is anyone else experiencing these issues?

Any thoughts @dagar , @AlexKlimaj ?

AlexKlimaj commented 1 year ago

Hm, I don't have any experience with the gimbal logic. However, it shouldn't be too difficult to add a scale parameter to the control allocator for gimbals.

RybalkaOleksii commented 3 weeks ago

Hi!

@dynamicUAVsolutions did you get any way to fix this issue? I'm facing the same problem, and the setting via mnt_range doesn't suit me, as it still doesn't work to hold the horizon over the full range of the gimbal.