Setting velocity using SET_POSITION_TARGET_GLOBAL_INT gives sluggish performance

I have a well tuned drone and when I twiddle the joystick on the transmitter, it responds quickly and stably in LOITER and STABILIZE modes.

These are my params: params.param (16.7 KB)

EDIT: here is the log:

Now I am trying to achieve the same responsiveness as this in software in GUIDED mode by talking to my Pixhawk (v4.1.5 - only upgraded just now to v4.2.0) via Mavlink. I send the SET_POSITION_TARGET_GLOBAL_INT message with the SET_POSITION_TARGET_GLOBAL_INT Mavlink message with just the velocity fields set (and appropriate typemask).
I alternate between these sets of values at 300ms intervals for a total of 6 seconds:

vx=5, vy=-5, vz=0
vx=-5, vy=5, vz=0

but when I do this, the best my drone does is to gently twitch one way then the next and it barely changes pitch/roll (ANGLE_MAX=80 degrees). I did do a test with 1000ms interval and I saw the same behviour (sadly the dataflash log is missing from the Pixhawk).

  • I have read that WPNAV_ params can affect GUIDED mode performance so is it as simple as increasing these?
  • What about using the afx/afy/afz acceleration terms in SET_POSITION_TARGET_GLOBAL_INT that apparently are now supported by Arducopter?
  • Is it as simple as modifying GUID_OPTIONS “Do not stabilize VelocityXY” or “Do not stabilize PositionXY”?
  • How can I make my drone behave in the same agile manner as I see when I am in LOITER or STABILIZE mode using position targets?

I wanted to get a proper answer rather than relying on guesswork as the place that I fly at is 45 minutes away. I’d really appreciate getting this sorted out as my application requires a fair degree of agility. Many thanks to those that read this.

Hi @arduouspilot,

I think you might get more movement by increasing WPNAV_ACCEL (although I see you’ve already increased it to 250) and maybe WPNAV_JERK.

The vehicle isn’t capable of accelerating up to 5m/s in just 0.3 sec of course so the result is instead going to be limited by the maximum acceleration and jerk (which is the change in acceleration).

You should be able to test this in the simulator as well somehow I think.

1 Like