Development discussion of TauLabs software such as flight controllers, sensors, radios and speed controllers.

Auto tune: Article?

User avatar
User

Korken

Posts

83

Joined

Tue Mar 18, 2014 8:11 pm

Re: Auto tune: Article?

by Korken » Sun Apr 13, 2014 9:06 pm

Here is the exponential based system. :)

New system equations:
eqn.png
eqn.png (21.97 KiB) Viewed 1468 times
Attachments

[The extension zip has been deactivated and can no longer be displayed.]

Last edited by Korken on Sun Apr 13, 2014 9:08 pm, edited 1 time in total.
User avatar
User

peabody124

Posts

1339

Joined

Tue Feb 18, 2014 12:33 pm

Re: Auto tune: Article?

by peabody124 » Sun Apr 13, 2014 9:08 pm

I've attached the modifications I did to add a bias term and keep the tau and beta in a log scale. It seems to work reasonably well. For yaw this is what I get:

Screen Shot 2014-04-13 at 4.01.24 PM.png
Screen Shot 2014-04-13 at 4.01.24 PM.png (151.09 KiB) Viewed 1468 times


Edit: I should emphasize, it is a bias on the actuator - not on the gyro. That is assumed to be unbiased (and we learn that bias so it is, in effect).
Attachments

[The extension zip has been deactivated and can no longer be displayed.]

User avatar
User

Korken

Posts

83

Joined

Tue Mar 18, 2014 8:11 pm

Re: Auto tune: Article?

by Korken » Sun Apr 13, 2014 9:18 pm

Hmm, I cannot get that to work in simulation.
The observability matrix is still the same, it's un-observable without another measurement.

Edit: Most likely it's just a fluke that it works, but it's no problem to add this to the attitude estimation and it is observable again. :)
Last edited by Korken on Sun Apr 13, 2014 9:21 pm, edited 1 time in total.
User avatar
User

peabody124

Posts

1339

Joined

Tue Feb 18, 2014 12:33 pm

Re: Auto tune: Article?

by peabody124 » Sun Apr 13, 2014 9:21 pm

The problem is, without that, it has to keep the beta low to lessen the influence of the bias. What manifold of solutions makes it unobservable?

I'm on IRC if you want to drop in and talk live: taulabs.org/webchat.html
User avatar
User

Korken

Posts

83

Joined

Tue Mar 18, 2014 8:11 pm

Re: Auto tune: Article?

by Korken » Sun Apr 13, 2014 9:26 pm

The problem comes from the fact that a constant rotation does not have to be bias, it can be the starting condition as well.
So without a fixed reference it will not converge correctly. Using your model it converges to close to zero (in simulation test) which is quite good as it does not diverge completely. :)
User avatar
User

peabody124

Posts

1339

Joined

Tue Feb 18, 2014 12:33 pm

Re: Auto tune: Article?

by peabody124 » Sun Apr 13, 2014 9:47 pm

I'm not following. Say you have constant rotation (so omega stays at 10 deg/s). Then you know the input should be zero. Provided beta isn't zero (which we can treat as a constraint) then the bias should be whatever is required to make that input zero.

Running it on real data, I'm seeing the bigger practical issue is what I described above:
1. not enough variability in the real command signal
2. most of the variability that is there comes from a low lag input from the gyros

Since this model is essentially running within that control loop, it ends up making it much harder to estimate. I think I'll grab a log running the current autotuning code and try analyzing that.
User avatar
User

peabody124

Posts

1339

Joined

Tue Feb 18, 2014 12:33 pm

Re: Auto tune: Article?

by peabody124 » Sun Apr 13, 2014 10:00 pm

And here it is fit to pitch for another flight:

Screen Shot 2014-04-13 at 4.59.11 PM.png
Screen Shot 2014-04-13 at 4.59.11 PM.png (183.4 KiB) Viewed 1466 times
User avatar
User

peabody124

Posts

1339

Joined

Tue Feb 18, 2014 12:33 pm

Re: Auto tune: Article?

by peabody124 » Mon Apr 14, 2014 3:33 am

So running this algorithm over flights with autotuning is working pretty well. It learns pretty quickly:
Screen Shot 2014-04-13 at 10.28.39 PM.png
Screen Shot 2014-04-13 at 10.28.39 PM.png (152.6 KiB) Viewed 1456 times


And here you can see the individual oscillations of AT:
Screen Shot 2014-04-13 at 10.27.18 PM.png
Screen Shot 2014-04-13 at 10.27.18 PM.png (158.73 KiB) Viewed 1456 times

Screen Shot 2014-04-13 at 10.27.25 PM.png
Screen Shot 2014-04-13 at 10.27.25 PM.png (120.61 KiB) Viewed 1456 times


Now I want to see what kind of perturbation we can add that is less aggressive than autotuning but sufficiently excites the system to get a good identification.

I'm wondering about something where every 200 ms it applies a small additional offset to a random channel...

Edit: p.s. bonus points if we can model the output noise with some kind of ARMAX model that accounts for the oscillation structure.
User avatar
User

peabody124

Posts

1339

Joined

Tue Feb 18, 2014 12:33 pm

Re: Auto tune: Article?

by peabody124 » Mon Apr 14, 2014 1:54 pm

I'll upload pics later, but I forgot to say I simulated the learned system model with our control system and the PID settings I use on this frame. It was pretty cool, they are right near critical damping so looks like things are working nicely.

Sent from my Nexus 5 using Tapatalk
User avatar
User

peabody124

Posts

1339

Joined

Tue Feb 18, 2014 12:33 pm

Re: Auto tune: Article?

by peabody124 » Tue Apr 15, 2014 3:25 am

I fit a modified version that estimates a single tau (the rational being all the motors are the same type), then the smoothed output of each output channel, and finally the beta for each axis. It seems to behave quite nicely. The next step is to apply it to pseudorandom outputs.

Screen Shot 2014-04-14 at 10.20.21 PM.png
Screen Shot 2014-04-14 at 10.20.21 PM.png (135.25 KiB) Viewed 1429 times


I'm also tempted to see if this can be further extended to learn a more refined mixer matrix. I haven't worked out if that would prove useful on the controller side, though.
PreviousNext

Who is online

Users browsing this forum: Google [Bot] and 1 guest

Powered by phpBB ® | phpBB3 Style by KomiDesign
cron