Copter yaw problem in auto and poshold mode

Hello Friends,
We are building a quadcopter(V frame) max payload of up to 40kg (for agricultural purposes). We are using hobby wing motors. I have attached the log file link for your reference.

Link: https://drive.google.com/file/d/1qmEB-xjwrAruNRy4SEvg18g19Nia4gRi/view?usp=sharing

I am facing some stability issues and yaw movement adjusting every turn in auto mode. even in pos hold mode also yaw tries to recorrect continuously. In pos hold mode, after leaving the roll stick copter moved some 0.5-1 meter distance and stopped. instant stopping is needed for my application. In the log, I did multiple auto flights and a few pos hold flights for the yaw movement observations. Kindly help me to find the issue.

Thanks in advance

Do not use pos_hold, use LOITER flight mode instead.

Are you sure this is is a FRAME_TYPE V? It’s uncommon and frames that may look like V’s will often fly better on X

Set these back to default:
ATC_RAT_YAW_I,0.04 (.009)
ATC_RAT_YAW_P,0.5 (.09)

Set this back to default:
AUTOTUNE_AGGR,0.05 (0.1)
Set these (you need to configure the dynamic notch filter):
INS_ACCEL_FILTER,10
INS_LOG_BAT_MASK,1
INS_LOG_BAT_OPT,4

Then make a simple flight in AltHold or Loiter and post that log. No auto tune, no auto mission, a simple flight.

Thanks for the quick reply dave,
I will upload the logs as you requested ASAP.
thanks again.

Thanks for the suggestion lucas

Use the loiter which has many parameters to adjust for your application. In loiter, in addition to other parameters, you should set this parameter to 0 to have immediate stop

LOIT_BRK_DELAY,0

1 Like

Coincidentally I just answered that question in another thread :grinning:

PosHold is old and superseded by Loiter.
Here are the available parameters for PosHold:
PHLD_BRAKE_ANGLE,3000
PHLD_BRAKE_RATE,8

Here are the parameters available for Loiter:
LOIT_ACC_MAX,500
LOIT_ANG_MAX,0
LOIT_BRK_ACCEL,250
LOIT_BRK_DELAY,1
LOIT_BRK_JERK,500
LOIT_SPEED,1250

A much more comprehensive set to tune how you like. PosHold should be deprecated to save a bit of valuable flash!

1 Like

Okay for this thread too Dave :slight_smile:

Hi Dave,
I have attached the log of loiter flight mode. please go through and give your feedback.

Link: https://drive.google.com/file/d/1iD_ab03bd1WLSb72eQ0rwlvmLvezCmDc/view?usp=share_link

I changed the parameters to
ATC_RAT_YAW_I,0.04
ATC_RAT_YAW_P,0.5
to a minimum value.

I am waiting for your reply.
Thanks

This needs to be at 4 not 3 as I suggested:
INS_LOG_BAT_OPT
And set AUTOTUNE_AGGR back to default (0.1) as at no time would you want to run this at 0.05.

Then make another hover flight. The goal here is to set the dynamic notch filter so you can then run Auto Tune.

It would be a good idea to use Magfit to produce the Compass calibration offsets and motor compensation Magfit Using MAVExplorer is an easy way to do this.

Hello dave,
Good day
As you suggested I changed the parameters, I did loiter flight for around 2min. Kindly go through it and give feedback. As you said I will try magfil also.

Link: https://drive.google.com/file/d/1Ert5X4z8se9rNbv84F7FC1vvfgRLvoyU/view?usp=share_link

Thanks.

Hello Dave,
I tried MAGFIT and i chnaged compass parameters, but in controller MAGFIELD high error came after changing the parameters, so I calibrate compass again and the error is resolved. Compass values are again changed to old values.
Flight controller: CUBE orange
GPS: HERE 3

Waiting for your reply,
Thanks in advance.

OK set these for the Dynamic Notch Filter. It might require a static notch also but let’s see:
INS_HNTCH_ENABLE,1 (then refresh parameters)
INS_HNTCH_ATT,40
INS_HNTCH_BW,36
INS_HNTCH_FM_RAT,1
INS_HNTCH_FREQ,72
INS_HNTCH_HMNCS,3
INS_HNTCH_MODE,1
INS_HNTCH_OPTS,0
INS_HNTCH_REF,0.265

Make another flight.

I have never seen this so perhaps you did something wrong. The log file you use for it must contain a lot of yaw action and if you want motor compensation some throttle action also. Then you need to window the graph so the take-off and landing segments are not shown. It’s all in the video ion the Magfit Wiki page.

Hello dave,
Sorry for the delayed reply.
A few days before, the drone crashed and burnt due to some battery issue. We build a new quad and we are starting trails now. The yaw issue remains the same as the last quad(V frame). But, I am facing another problem now. As I mentioned earlier, ours is hybrid drone, once the engine starts(generator system), a gyro inconsistent error comes. Once the engine shut off the error is not coming. I am using HERE3 GPS as the primary compass.
I need to know:

  1. Is This error because of engine vibration?
  2. Is there any parameters for vibration limitation in the ardupilot?
  3. Does This gyro error come from cube orange or HERE 3 GPS?
  4. Is there any way to avoid the vibration in the GPS and cube?

Thanks in advance.

Post a link to a .bin flight log where was experianced.

Hello Dave,
Thanks for the quick response.
I didn’t arm the vehicle.
That is a prearm error.
I tried to arm in poshold mode.that time this error came.

Ok. Then enable LOG_DISARM and post that. Disable it after that.

Hello Dave,

Good day.

As you suggested, I took a log with log_disarm.

Log link:https://drive.google.com/file/d/1CY6pGHXB-XI7aExC9vkMAE6d8X7EqL-E/view?usp=share_link

Thanks.