Magnetometer disturbance and PID questions

The last Bastion to fine tune your FC matching your airframe & setup

Magnetometer disturbance and PID questions

Postby hogster » Fri Jul 11, 2014 12:32 pm

Hi all :)

Now that I've finally got my X8 flying with the AQ/DIMU onboard, I can start to look at how well it's flying.

As you can see from the attachments

– The ACC values are better than they were - on average ±2.5, but still with sharp peaks rising to ±10 ... not quite sure of their cause at the moment
– The Motor values aren't clipping
– The MOT_YAW value is pretty much averaging around 0 showing that my tweaked mixing table is working (bottom props are bigger and pitchier than top props)

My concern is the MAG values. I guess there will always be some interference from the ESCs, even if they are mounted as far from the AQ as possible ... but will the values shown in the attachment be detrimental to the performance of the AQ?

Currently the AQ is mounted with each corner approximately 4cm from a pair of ESCs (8 ESCs in total, 4 pairs off each corner of the AQ). Due to the design of the frame, unless I raise the AQ still further on stilts there's no easy way of getting the AQ further away. Is it worth trying?

Many thanks for your input :)

David
Attachments
10-7-14 flight MOT_YAW.png
MOT_YAW value
10-7-14 flight MOT.png
Motor values
10-7-14 flight ACC.png
Acc values
10-7-14 flight MAG.png
Mag values
Last edited by hogster on Fri Jul 11, 2014 8:38 pm, edited 1 time in total.
hogster
 
Posts: 239
Joined: Tue Feb 11, 2014 8:59 am

Re: How much magnetometer disturbance is too much?

Postby JussiH » Fri Jul 11, 2014 6:15 pm

With a DIMU, the only time the mag is used is when the copter is sitting on the ground to judge the initial heading.

Once you arm and take off, the mags are no longer contributing to the heading estimate, which is from then on solely maintained by the gyros and corrected by the GPS.

Bottom line: No matter how much mag interference you are seeing in flight, if the heading is correct before takeoff, you are good...also means you have to worry less about power distribution and distancing controller from power distro. Its one of the main advantages of using a DIMU!

The X-ACC plot points towards an oscillation or imbalance on the Pitch axis. Or maybe that is just you yanking it around?

Apart from the X-ACC, the above looks generally ok, and if its flying ok, it is probably OK....;-)
JussiH
 
Posts: 2103
Joined: Thu Jun 21, 2012 9:25 pm

Re: How much magnetometer disturbance is too much?

Postby hogster » Fri Jul 11, 2014 7:05 pm

Hi Jussi, many thanks for the detailed reply!

That's good news about the MAG data :) One thing I did notice is the yaw was drifting a bit during flight but I imagine that can be tuned out by increasing Yaw P? Or should it be Yaw I to integrate the heading more strongly if it drifts from the desired heading? I did notice the pitch oscillation in flight and I will also try to trim that out by tweaking the PID values.

On the topic of PID tuning, I have reduced the Tilt Rate D value as I was initially getting very harsh oscillations, to the point where the motors were making awful scratchy sounds! I went down from the default (30000 or so) to 15000 and then 12000 and it seems to have gone now. Is there a problem if this value is too low? I'm assuming most of the PID changes for normal flight should be applied to the Tilt Angle parameters? What's the difference between Tilt Rate D and Tilt Angle D?

Sorry for all the questions, but I didn't quite follow all the comments in the WiKi. I'm tempted to start from scratch by setting all I and D values to 0 and just starting with the P values - a big heavy X8 platform doesn't seem very common in the AQ world yet so I could imagine the default PID values aren't entirely suitable.

Many thanks for your help :)

David
hogster
 
Posts: 239
Joined: Tue Feb 11, 2014 8:59 am

Re: Magnetometer disturbance and PID questions

Postby hogster » Fri Jul 11, 2014 9:26 pm

Just to keep all my questions in one thread ...

I've had a productive session of PID tuning in my garden :) My values are now:

Tilt Rate D: 10000
Tilt Angle P: 65
Tilt Angle I: 0.0025
Tilt Angle D: 5500

All the rest are at their default values.

Here is a quick video of my last test flight where everything seemed pretty smooth:



However as you'll notice around the 27 second mark, you can hear the motors starting to make a *zingzingzingzingzing* sound, and this seems to correspond to the sudden increase in accelerometer vibration in the attached log file. It also corresponded with the X8 starting to feel soggy on the controls and starting to drift around more.

My question is ... which came first, the chicken or the .... ;) ... the sudden high vibration which upset the attitude estimation and caused the motors to start oscillating, OR something causing the motors to start oscillating which was then picked up by the accelerometers?

I noticed this several times during my test flights – at first it would be very smooth, but then after a short period of hovering it would start this zinging routine. It was dead calm this evening, apart from the turbulence in the garden I guess. But even hovering in ground effect couldn't stimulate this zinging, at least not in the first parts of any flight.

The zinging is evidently the motors spinning up too much, the power being cut too much, then spinning up too much etc. Would that be caused by P being too high? Or does the frequency of the oscillation (several Hz) point to D being too high?

I still don't know what is a 'good' value for Tilt Rate D ... might that be adversely affecting things?

I've also noticed that my MOT_YAW still has an offset, despite the 80 top /100 bottom mixing table I'm using which seemed to eliminate the offset on the bench. Maybe this is contributing my problems, so I will try and fix that next before fiddling with anything else.

Many thanks for your help guys, I feel like I'm really making progress now. If I can just sort out this zinging, my hopes and expectations of a rock steady aerial photography platform using the AQ will start to come to fruition :D

Cheers, David
Attachments
11-7-14 final flight MOT_YAW.png
MOT_YAW values
11-7-14 final flight MOT.png
MOT values
11-7-14 final flight ACC.png
ACC values
hogster
 
Posts: 239
Joined: Tue Feb 11, 2014 8:59 am

Re: Magnetometer disturbance and PID questions

Postby JussiH » Fri Jul 11, 2014 10:58 pm

Pls post the log from the flight in the video.

The twithing can happen if the GPS lock comes in after takeoff and corrects the heading. Usually it goes away if you go back into manual and fly a bit or land and let the heading estimate resettle. Its usually good practice to fly around for a little bit in manual to allow heading estimate to be corrected by the GPS before attempting Pos hold.

Use the GCS to see if the heading is beeing estimated correctly from startup. If not, redo the onboard calibration.

Otherwise, you seem to be on the right track.
JussiH
 
Posts: 2103
Joined: Thu Jun 21, 2012 9:25 pm

Re: Magnetometer disturbance and PID questions

Postby hogster » Fri Jul 11, 2014 11:07 pm

Hi Jussi,

Log file attached for the final flight and the one just before it (where the zinging didn't occur).

None of these flights have been done in position hold mode, they've all been in manual ... presumably the GPS won't affect the flight performance in manual mode?

Many thanks for your help :)

David
Attachments
010-AQL.LOG.zip
Last two flights
(3.94 MiB) Downloaded 738 times
hogster
 
Posts: 239
Joined: Tue Feb 11, 2014 8:59 am

Re: Magnetometer disturbance and PID questions

Postby hogster » Sun Jul 13, 2014 8:20 pm

Moderator: Please could you move this thread to the PID Tuning section? Thanks!

Hi all :)

I've been making very little headway with this tuning, despite spending a lot of the last few days fiddling with it :(

In the Wiki it suggests turning all the PID gains to 0 and then starting with P ... does this mean all the gains, including Tilt Rate as well as Tilt Angle? I reduced the Tilt Angle I and D to 0, but left Tilt Rate D and Tilt Angle P where they were and my X8 promptly nosed over on take off!

Wouldn't reducing all the gains to 0 result in no feedback and hence a very unstable platform?

It seems I was in the right ball park with the values in my post above, but the platform seems to be constantly on the edge of a 'ringing' oscillation. In the garden when there was no wind the oscillation only reared its head towards the end of the flight (shown above). However yesterday and today I've been flying in windier conditions, and the platform hasn't flown smoothly at all – the ACC values are constantly bad, just like the period of oscillation shown above, and no amount of tuning seemed to make a difference.

As it seemed to fly fine in the garden when there was no wind (with vibrations around the ±2 mark), I'm assuming for now that the props are well balanced, and that my gains are just poorly set, resulting in the slightest disturbance sending the system into oscillation.

Any input would be very much appreciated as always :)

Many thanks, David

PS. In particular, if anyone has a similar size (800-size) and weight (5.5kg) of platform (preferably a coaxial like a Y6 or X8) I would love to know what settings you're using to achieve stable flight.
hogster
 
Posts: 239
Joined: Tue Feb 11, 2014 8:59 am


Return to PID Tuning

Who is online

Users browsing this forum: No registered users and 9 guests

cron