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

peabody124

Posts

1339

Joined

Tue Feb 18, 2014 12:33 pm

LQG (linear quadratic gaussian) controller

by peabody124 » Mon Mar 28, 2016 2:19 am

So I've spent the last few days working on a new class of control system for the flight controller -- linear quadratic gaussian. It's basically the next generation passed PID. First flight tests this weekend were quite successful IMO:



The second frame had zero tuning (even though it was quite a different size, prop diameter, etc) other than running autotune. There is still room to calculate better tuning parameters (based on the autotune measurements, so still automatically) but this was just using the default parameters.

Here you can see the tracking response is pretty precise, even over very fine time scales:
Image

Of course to generate these types of algorithms, it is always useful to have tgood old trusty freedom around:


To get logs that I can reanalyze offline and optimize things.

I think this should be a pretty exciting leap for MR controls. I need to adapt it now to also work for attitude mode which I bet will work extremely well too.

If you are interested in testing this, drop me an email at @gmail.com with LQG in the heading.
User avatar
User

metRo_

Posts

178

Joined

Tue Mar 04, 2014 5:26 pm

Re: LQG (linear quadratic gaussian) controller

by metRo_ » Thu Apr 21, 2016 9:42 pm

Nice progress, do you havy any recommended bibliography?
no avatar
User

hank.su1968

Posts

57

Joined

Sun Jan 10, 2016 4:57 pm

Re: LQG (linear quadratic gaussian) controller

by hank.su1968 » Sat Apr 23, 2016 5:45 am

From your LQG post, I like the Tau labs much more than the DJI. :o
The DJI probably will sell it with high charge because I saw a consumer's complaint footage on the Youtube about paying half of selling price for repair their phantom products to the DJI.

If this is the next generation passed PID, I don't realize why not just apply the LQG as patents for business. I have to say "Sorry about my curiosity ".
The footage is very good but a little bit short to really understand the advantages of the LQG. Could we have any chance to know more detail about the LQG, for educating us or all human kinds. ;)

Thanks in advance.
Last edited by hank.su1968 on Sat May 14, 2016 11:25 pm, edited 1 time in total.
User avatar
User

peabody124

Posts

1339

Joined

Tue Feb 18, 2014 12:33 pm

Re: LQG (linear quadratic gaussian) controller

by peabody124 » Sun Apr 24, 2016 1:58 pm

metRo_ wrote:Nice progress, do you havy any recommended bibliography?


No one particular source. Wikipedia and the Matlab documentation have a lot of good information. Kenn helped me out on the actual online LQR solution. The model is based on what korken and I worked on for system identification which is the core of the problem.

I'm trying to do a bit more reading now about setpoint shaping as it applies to LQR. Also we can do things like modify the feedback gains versus stick position (e.g. pid attenuation like in MWRate/AcroPlus) but I need to think more on this.
User avatar
User

peabody124

Posts

1339

Joined

Tue Feb 18, 2014 12:33 pm

Re: LQG (linear quadratic gaussian) controller

by peabody124 » Sun Apr 24, 2016 2:01 pm

hank.su1968 wrote:From your LQG post, I like the Tau labs much more than the DJI. :o
The DJI probably will sell it with high charge because I saw a consumer's complaint footage in the Youtube about paying half of selling price for repair their phantom products to the DJI.


I have no idea what algorithms DJI is using. I only use my own hardware and TauLabs software :)

The footage is very good but a little bit short to really understand the advantages of the LQG. Could we have any chance to know more detail about the LQG, for educating us or all human kinds. ;)


I'll have a more complete writeup once it is ready to fly. The short version is right now that it estimates the instantaneous torque from the motors and accounts for their delays to control the system which eliminates PID tuning and gets better performance.
no avatar
User

hank.su1968

Posts

57

Joined

Sun Jan 10, 2016 4:57 pm

Re: LQG (linear quadratic gaussian) controller

by hank.su1968 » Mon Apr 25, 2016 1:25 am

Thanks very much, Dr. peabody124.

I got some ideas about LQG. :o

Could I ask one more question? Why the LQG algorithm hasn't been used in previous the sparky and sparky2?
I read one of your short theses about autotune for PID, including a lot of maths. It seems like using iterative calculation to find the optimal values for autotune. I don't understand why the PID tuning process can be so fast if using LQG. If the LQG is such magical, it should be implemented very widely. Could we have a little chance to know more about the pros and cons of using LQG. :?:


Thanks very very much......

:D
User avatar
User

peabody124

Posts

1339

Joined

Tue Feb 18, 2014 12:33 pm

Re: LQG (linear quadratic gaussian) controller

by peabody124 » Tue Apr 26, 2016 1:31 pm

It wasn't used in Sparky/Sparky2 because I hadn't written it yet :) It probably will be in the future - at the least on Sparky2. Part of the optimization might take up too much flash to run on regular Sparky.

I expect once this is released it will be adopted more widely, but we shall see. So far I'm managing to use equivalent PID parameters 100x more than with the traditional approach. It is quite ridiculous how rapidly the quad tracks. I need to set up a test platform to measure this.
no avatar
User

hank.su1968

Posts

57

Joined

Sun Jan 10, 2016 4:57 pm

Re: LQG (linear quadratic gaussian) controller

by hank.su1968 » Tue Apr 26, 2016 2:50 pm

Thanks so much again, dr. peabody124

We will very appreciate your new autotune for PID.






Thanks. :)
no avatar
User

tmcg

Posts

37

Joined

Thu Jan 08, 2015 3:30 pm

Re: LQG (linear quadratic gaussian) controller

by tmcg » Wed Apr 27, 2016 3:09 am

I've always been curious why flight controllers aren't ALWAYS tuning themselves, paying attention to how much motor power changes result in how much angular force and at what delay, etc, instead of manual PID tuning. Saving the final results as the seed values for the next takeoff, flight, etc. Is LQG possibly a step in that direction of realtime always-tuning?
User avatar
User

peabody124

Posts

1339

Joined

Tue Feb 18, 2014 12:33 pm

Re: LQG (linear quadratic gaussian) controller

by peabody124 » Wed Apr 27, 2016 3:43 am

tmcg wrote:I've always been curious why flight controllers aren't ALWAYS tuning themselves, paying attention to how much motor power changes result in how much angular force and at what delay, etc, instead of manual PID tuning. Saving the final results as the seed values for the next takeoff, flight, etc. Is LQG possibly a step in that direction of realtime always-tuning?


It's a good question. There are a number of challenges, the most being observability of the system properties. If you are mostly doing calm flying then you might find the system parameters drift around. That's why the system identification (autotuning) code has to rigorously shake it to make sure it gets a good estimate. Also, when you have the closed loop performance wrapped around it that also can alter what you measure (so why it's best to run autotune with default settings)

However, this is a step in that direction. For example all the important LQG/LQR calculations are performed onboard.

Here is some more testing from today. I strapped the quad down so I could get logs while it is spinning like crazy


Attitude response:
Image

Rate response:
Image
Next

Who is online

Users browsing this forum: No registered users and 1 guest

Powered by phpBB ® | phpBB3 Style by KomiDesign
cron