AHRS: Waiting for Home

So having resolved all the battery issues ( the batteries were all depleted)

I am trying with Angle and ALT hold mode ( they are working well)

When I try POSHOLD it seems it isn’t activating. ( on the messages I can see AHRS:Waiting for Home)
GPS is ok 8 Sats and 1.9 HDOP.

Is there a setting that I have missed ( home poinjt should be set at ARM location) or is the GPS signal not good enough?

Thanks.

That means GPS position is not good enough to set a Home position.
HDOP 1.9 is poor. Small copters can have trouble getting a good GPS signal down on the ground.
Any GPS-assisted mode wont be armable until the position is good enough - even in air, so if you dont have any telemetry or feedback of some sort you may not realise a mode change was rejected.

If you set FENCE_ENABLE,1 then you cant arm in any mode until Home can be set - you may not want this unless this is a big copter. At least then you know everything should work as planned.

Use Loiter instead of PosHold - there’s some extra tuning parameters.

Hi there Shawn,

That’s what I figured but wasn’t sure. I guess I really have to test it out doors.
And yes sorry this was Loiter Mode,

I want to try and tune it as much s possible (though its quite good as is) but I may have to wait for outdoors to be an option as I am in Canada. Can the VTOL tune be completed in a limited height area? say 10ft? ( sry I see that it required Loiter Mode)

Let me pull some logs and share.

Thanks.

You can do the VTOL Quick Tune script and the aircraft will hardly move around at all.
There is some setup involved, enabling scripting, coping the scripting into the correct folder, check the params, setting a switch and RC channel. Most is easier that it sounds there, just casting your eyes over everything to make sure you understand how to stop and start the script, and so on.

Read through the .md (readme) file, then download the .lua file

EDIT: yeah, Loiter required :frowning: Not sure if it work from AltHold mode

So this is will have to wait till I can test outdoors.

I attached a log here. I have checked things like VIBE ( Vibe seems ok, all less than 15) and EKF (all bars below limit)

I do see in the Review log function “yaw inconsistent by 23 deg”. or “Ground mag anomaly- re-align” I can see at times the copter will yaw about 20 deg and it required the user to apply yaw input to correct.

Is there something up I need to adjust with “Magfit”?

Thanks.

No log.
But yaw inconsistent can mean the GPS path doesnt match the calculated path and direction - that sort of thing. You might have to wait until you get outside with a good GPS fix and do some circles and turns - then we can nail down the compass settings.

sorry too many things going on today.

log link here.

Thanks.

Y axis vibrations are bad, so check prop balance, anything pushing or pulling on the flight controller, even touching it. Wiring not secured can be a problem.

You can see on the map how the IMU-calculated position and the GPS never agree - this is because of the vibrations

So just to be clear I am inside this building so would you expect the GPS and IMU to match? I suspect there is lots of multi-path errors occurring.

(Just so I can understand for the future, I see in the VIBE Y is around 20, I know this is higher than the others but i though 30 was the limit.)

Thanks.

So I replaced 1 prop and adjusted a few wires and secured the tower that holds the GPS to be sure (with no vibrations)

It reduced the Y vibration from max 19 mean 11, to max 17 mean 8, this is better but I’m not sure if its good enough. (this copter also has a prop guard cage and is quite flimsy so I am tempted to try without).

Thanks Tristan.

Oh yeah, prop guards might be useless if they are already flimsy. Anything that moves, shakes or vibrates is bad.
You did well fixing the vibrations.

Inside the building you could have multiple compass and GPS related issues because they constantly disagree.

You can set these parameters:

ATC_THR_MIX_MAN,0.5
GPS_GNSS_MODE,67
INS_ACCEL_FILTER,10
INS_HNTCH_ENABLE,1  // write this then refresh params to see the rest
INS_HNTCH_MODE,1
INS_HNTCH_BW,40
INS_HNTCH_FREQ,90
INS_HNTCH_FM_RAT,0.7
INS_HNTCH_HMNCS,3
INS_HNTCH_REF,0.19
INS_LOG_BAT_MASK,1
INS_LOG_BAT_OPT,4
PSC_ACCZ_I,0.44
PSC_ACCZ_P,0.22

These wont really improve the attitude control, but will allow for better results from Autotune when you get a chance to do that outside with plenty of space.
Do a test flight with mostly hover, and some gentle pitch and roll, no need for aerobatics. This will allow us to refine that notch filter.

If you are OK with immediately landing if there is an attitude control issue, give these a try too, maybe as a second flight:

ATC_ANG_PIT_P,6.0
ATC_ANG_RLL_P,6.0
ATC_RAT_PIT_I,0.12
ATC_RAT_PIT_P,0.12
ATC_RAT_RLL_D,0.006
ATC_RAT_RLL_I,0.12
ATC_RAT_RLL_P,0.12
ATC_RAT_RLL_D,0.006

Thanks for the recommendations Shawn.

I adjusted the first set of settings and did a short test flight. Don’t worry, no acrobatics from me lol, Just basic figure 8’s. Flight was ok, but still get the ground mag error but seems stable otherwise.

Looking at the VIBE data it seems worse? is this possible? no other changes were made.

Should I re test or go for the ATC settings?

Thanks!

X and Y axis do still have significant vibrations, Y axis the most. Can you supply a photo of the flight controller and wiring?

Adjust these to get the notch filter going properly:

INS_HNTCH_FREQ,75
INS_HNTCH_REF,0.21

Give that another test, maybe it will be a little less nervous.
You could try those ATC_ parameter changes if you like.

Once you are able to get outside with a good GPS fix we can use a log to really sort out those compass issues via magfit.

Hi there Shawn,

Thanks for the continued support!

I applied the notch filter settings and it files much better.

But I still notice lots of yaw errors and sometimes the HUD (attitude) will show left and down even though the copter is flat.

Can you see this in the RCIN for the log attached. First 2 flights require lots of stick input, on the 3rd you can see it required very little stick inputs in alt hold mode.

Vibrations seem to be the same ( thought I completely re-wired the copter yesterday due to a failed capacitor in the Power Distribution board.)

Thanks!

Here are some pics of the FC and wiring.

If there any suggestions please let me know.

Thanks.





All wiring should be secured to the frame, then where it connects to the flight controller leave just enough flexibility so the wiring doesnt transfer vibrations. The wiring cannot be touching the flight controller, and the weight of the wiring cant be pulling on the flight controller.
Be aware that hot melt glue becomes hard and loses it’s stickiness over time.

When you want to make further improvements, get a 4in1 BLHELI32 ESC. That allows you to throw away those old-tech ESCs, the PDB and half the weight of your wiring. Not to mention the sweet sweet data you can get :slight_smile:

Carefully put in these compass-related values in and you should be good at least until you can get out with a good GPS 3D fix.
There was quite some compass variance between units, and both affected by battery current at least a bit.

COMPASS_USE2,0
COMPASS_DIA_X,0.800
COMPASS_DIA_Y,0.800
COMPASS_DIA_Z,0.800
COMPASS_MOTCT,2
COMPASS_MOT_X,-10.000
COMPASS_MOT_Y,-1.038
COMPASS_MOT_Z,10.000
COMPASS_ODI_X,-0.200
COMPASS_ODI_Y,0.200
COMPASS_ODI_Z,0.131
COMPASS_OFS_X,-73
COMPASS_OFS_Y,110
COMPASS_OFS_Z,24
COMPASS_SCALE,1.00

If in doubt of your typing, you can copy/paste to notepad, save as {something}.param
then go into MissionPlanner full parameter list and “Load from file”
Put your own filename in where I have {something} just so long as you get the extension correct → .param

Hi there Shawn

Thanks again for the recommendations.

I have adjusted the wiring so that no wires touch or have tension on the FC, unfortunately this didn’t seem to improve the vibrations.

I did a few flights and seem to still gets lots of compass errors.
At the end of 1 flight I tried to land and the copter went back dramatically with no input and seemed to keep try this even once landed. (this is in log 61)

Thanks again for all the help tuning. I really hope to take it outdoors next week ( but still a bit worried)

Tristan.

Hi there Shawn,

I have tired lots of testing but the Yaw is pretty much all over the place when trying to fly.

I have noticed that Adrupilot is compatible with OptiTrack. Can you advise any info about the setup?
How is the communication with Mission planner/Mavproxy/Motive working?

Thanks.

This copter just needs proper tuning before layering on more complexity.
Start with:

ATC_RAT_YAW_I,0.05
ATC_RAT_YAW_P,0.50

just as bit of an aid to Yaw control, but really pitch and roll is exhibiting similar behaviour, just not as obvious.
That’s OK because most related parameters are on defaults.
Just try running Autotune now, probably one axis at a time by changing AUTOTUNE_AXES
Do Pitch first and when it’s done put the same new values into equivalent Roll parameters, that will give it a head start for running Roll Autotune.
Dont worry about doing the Yaw D axis, just Yaw when you get to it after Pitch and Roll.

To run Autotune: set one of your switches and channels to the Autotune option, or set your flight mode switch to have an Autotune position.
Launch and if flight is OK, change to Autotune mode, wait till the copter finishes twitching and moving around (you can reposition it during Autotune). DO NOT switch out of Autotune mode, just reposition and land.
After the copter disarms, wait a few seconds then switch out of Autotune mode. New values will be saved.
Now you can arm and fly again in any mode you like to test the new settings, usually after recharging the battery.

1 Like

Ok will have to see when I can take it outdoors. I’m sure most of the errors are caused by emi/poor gps as it is indoors.

I would really like to know if full Optitrack control is possible. This would enable students to do testing indoors during the winter months. ( but I get we need to make the copter stable first)

Thanks.