Helicopter compass problems with HERE+ on a mission

My helicopter run perfect at ACRO / ATTI / LOITER, but when I execute a mission this happens:

I have tried all the options:

  • have put HERE+ in nose.
  • have put HERE+ at tail boom.
  • I have made some calibration with Mission Planner.
  • I have made some calibration with QGC.

I use ardupilot 4.0 with CUBE and this is Tlog files:

With MP “Magfield” is external compass and “Magfield3” is internal compass.

I have adjusted several helicopters and this has never happened to me, any help would be appreciated.
Thanks in advance.

@ChrisOlson do you have any advice?

I have no clue on that one. I have never used dual GPS since it is pointless. If one receiver has a bad signal, they’ll both get bad signal. Unless a receiver fails, which I have never seen happen. If it loses GPS it’s usually because of a bad signal, multi-pathing, atmospheric refraction, radio frequency interference, etc… Which will affect both receivers.

I notice even in Loiter it does not seem to hold position and seems to want to “hunt” back and forth, front to rear. Maybe it is switching back and forth between the GPS receivers and is confused about which one to use? Just a guess. I really don’t know.

If it were me I’d disconnect one of those receivers and try it with just one.

Hi Chris,
I am not using double gps, only one.
First I put the GPS in nose and then the same gps I put it tail boom.

OK, I saw in your settings where it will switch automatically (if it has two), and from your description I thought maybe you had installed two of them. Maybe that is the default for that setting in case two of them is installed. I have GPS_AUTO_SWITCH set to zero in my heli’s, so never really tried that before.

Otherwise, I noticed this pitching up and down in Loiter, and the helicopter moves and is not stable in Loiter. You used the same procedure I use for takeoff - acro to make sure everything seems to respond correctly, with bailout already set in case there is a flameout after liftoff. Switch to Loiter (or Pos Hold) to verify the nav system is working ok. Then finally to Auto and let it go.

What I see in your log, would not pass the Loiter test for me and I would abort at that time.

This does not appear to be a flybar helicopter but the attitude controller has not been set up. The Rate PID’s are still set to zero so it is only using feedforward of 0.15

After setting that, there is the position controller settings to think about, in particular the velocity xy P, I and D but these normally don’t need to be changed.


In other helicopter models I never had to touch those values Rate PIDs.
It is true that the LOITER mode has a bit of TBE.
I will follow your advice and I will test increment values of 0.001 in D and 0.05 in P.
Thanks Chris.

Please post a log file rather than a tlog. I’ll be able to determine more from the log file. Thanks!

Hi @bnsgeyer,
thanks for your help.

@Loren_DS In looking over your params, it appears that you have done very little to tune your aircraft. As you said in a previous post, all pitch and roll, P, I and D gains are zero. You have no filtering for vibrations and you have not adjusted the target response (ATC_ACCEL_P_MAX, ATC_ACCEL_R_MAX or ATC_INPUT_TC. These are all default values. The only parameter that you have changed is the ATC_ANG_P and ATC_ANG_R. So these params have helped keep actual attitude close to target attitude. The hunting around in loiter mode is in part due to the attitude controller tuning but also due to position controller tuning.

The first thing you really need to do is determine whether the vibrations are creating a problem with tuning. You will need to fly the aircraft in stabilize or acro with the LOG_BITMASK parameter set to 131071. This will allow you to look at the RATE and PID messages with higher sample rates. I think you have some significant vibration in the roll and lateral axis.

You can see in this plot that the roll rate is at a much higher magnitude and doesn’t even appear to be following the target roll rate. Some of this could be due to the high ATC_ANG_R parameter but I also think there are some high vibrations.

After you get the vibrations figured out then I would suggest that you tune the target response to something you like. Maybe the default values are right for you but I think a more appropriate values are needed. For most helicopters INPUT_TC of 0.15 is not appropriate as well as the ACCEL Max .

Please follow the traditional heli tuning guide to tune P and D gains. You may want to back off on the ANG_P gain. Maybe start with 6 in pitch and roll

So after you tune the attitude controller by the steps above, then you can look at the position controller. Again I’m not saying the attitude controller tune is completely the problem but the velocities as you can see in the graph below are not in phase with each other. So some adjustments may be needed with the position controller too. But you need to tune your attitude controller before we can move to the position controller.

I realized I didn’t give you any suggested values. I think better values for ATC_INPUT_TC for heli’s are around 0.2. as far as max accel Params, that depends on the size and for 600 to 700 size heli’s, this number is down around 50000-60000. Once you tune up the PIDs, then see how the heli feels and then you can adjust them from there.

I have a three blade 900mm, will follow your advice.
Thanks @bnsgeyer