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

Altitude hold refinement

User avatar
User

metRo_

Posts

112

Joined

Tue Mar 04, 2014 5:26 pm

Re: Altitude hold refinement

by metRo_ » Thu Mar 13, 2014 12:15 am

can't you add the user altitude input?
User avatar
User

peabody124

Posts

554

Joined

Tue Feb 18, 2014 12:33 pm

Re: Altitude hold refinement

by peabody124 » Thu Mar 13, 2014 1:00 am

Oh right - forgot. Still working on the full analysis though. Currently adding logging of the internal variables. I'm trying to figure out a reasonable Ki/Kp ratio.
User avatar
User

metRo_

Posts

112

Joined

Tue Mar 04, 2014 5:26 pm

Re: Altitude hold refinement

by metRo_ » Thu Mar 13, 2014 9:09 am

peabody124 wrote:Oh right - forgot. Still working on the full analysis though. Currently adding logging of the internal variables. I'm trying to figure out a reasonable Ki/Kp ratio.

But doesn't you need the internal variables to tune the pid control?
User avatar
User

peabody124

Posts

554

Joined

Tue Feb 18, 2014 12:33 pm

Re: Altitude hold refinement

by peabody124 » Thu Mar 13, 2014 3:23 pm

Well you can get by pretty far from observing the behavior, but it is useful. I attached a screenshot of the overo log video now.

- The top plot shows the throttle output in white and the throttle integral component in blue
- The middle plot shows velocity desired in white and the velocity estimate in blue
- The bottom plot shows the raw baro in blue, the filtered baro in white, and the altitude estimate in yellow and the set point in red (i remembered :)

A few interesting points. With a lower baro variance the state estimate is now tracking the filtered value better and seems to match the video better. Still needs more quantitive analysis. More importantly it does seem to increase the noise in the velocity estimate as a side effect. You see as a result quite a lot of noise in the throttle output. I need to see if there is any error in how the accels are handled to get a lower noise fusion, but if that is not the case I think some low pass filtering to reduce that noise will be beneficial.

Does anyone know any sources that discuss if it would be better to LPF the output versus the velocity before the PID. They are essentially the same right now because it's just a linear-time-invariant system and order doesn't matter, but perhaps if we want to add some damping there are important implications.

Speaking of damping, look carefully at the two velocity control curves. You can clearly see the phase delay between the desired and actual (not shocking) but that oscillation pattern makes me think some damping is required to get a tight enough control of position.
Attachments
altitude_variables.png
altitude_variables.png (136.95 KiB) Viewed 881 times
User avatar
User

metRo_

Posts

112

Joined

Tue Mar 04, 2014 5:26 pm

Re: Altitude hold refinement

by metRo_ » Thu Mar 13, 2014 3:47 pm

I thought you was changing the desired altitude that is why I asked you to plot it also.

What information is been using on the INS? It looks like you are getting a goog altitude tracking of the vehicle so now I think it is a control tune problem, isn't it?
User avatar
User

peabody124

Posts

554

Joined

Tue Feb 18, 2014 12:33 pm

Re: Altitude hold refinement

by peabody124 » Fri Mar 14, 2014 4:33 am

Running some logs outdoors too. Had pretty nice loiter performance and it is neat to see the star (position desired) move and the quad follow it tightly.

I agree it looks like now it's mostly a control issue since the INS is working well. However, I'm not sure the current control scheme will get all the way there to the point we want (see my previous post). Trying to analyze this now.
Attachments
Screen Shot 2014-03-13 at 11.13.44 PM.png
Screen Shot 2014-03-13 at 11.13.44 PM.png (1.09 MiB) Viewed 862 times
User avatar
User

metRo_

Posts

112

Joined

Tue Mar 04, 2014 5:26 pm

Re: Altitude hold refinement

by metRo_ » Fri Mar 14, 2014 10:20 am

Can you post some draft diagram of the control loop?
User avatar
User

peabody124

Posts

554

Joined

Tue Feb 18, 2014 12:33 pm

Re: Altitude hold refinement

by peabody124 » Fri Mar 14, 2014 11:52 am

It's the same as how I described it in this video ages ago for angle:

User avatar
User

peabody124

Posts

554

Joined

Tue Feb 18, 2014 12:33 pm

Re: Altitude hold refinement

by peabody124 » Fri Mar 14, 2014 4:36 pm

So I went ahead and drew up the block diagram for this system (ignoring the tilt compensation) and attached it below. I needed to do this anyway to really analyze the controller enough to see if we need to get the performance better.

Here is a video of it working:


Description of what you see:
in the middle section of altitude hold you see the most stuff. On the left is the information from the overo log. The top row is the throttle output, with the blue curve indicating the integral component. The middle row is the velocity, with white indicating the setpoint and blue indicating the velocity setpoint. The bottom row shows the altitude, with blue being the raw baro, yellow being the state estimate, and red being the setpoint. On the right you see the result of the optical segmentation of the quad. The bottom white plot is the altitude in the video and the top plot is the velocity from the video. You'll see the quad segmented by a yellow outline. Ocassionally it catches the shadow.

In the outdoor segment the plot on the right shows the position. The red dot is the INS estimate of position. The blue dot is the raw GPS position. The star is the loiter setpoint. I haven't thoroughly compared the INS lateral position versus the GPS yet.

I haven't started tuning it enough yet, you can see from the video that the state estimator is now working pretty well. In the end you can also see the raw GPS and the INS position estimate - I haven't started rigorously looking into refining that since you definitely see them differ somewhat.
Attachments
Altitude Controller.png
Control architecture
Altitude Controller.png (34.62 KiB) Viewed 842 times
User avatar
User

peabody124

Posts

554

Joined

Tue Feb 18, 2014 12:33 pm

Re: Altitude hold refinement

by peabody124 » Fri Mar 14, 2014 5:01 pm

Two things I need to do now I have this toolchain set up:

1. systematically make clips changing the baro_var term. You definitely see the velocity estimate noise increase and we need to get the best altitude estimate without excessive noise
2. thoroughly explore (or ideally analyze) the space of tuning parameters and get that as good as possible
3. update the control scheme if necessary
PreviousNext

Who is online

Users browsing this forum: No registered users and 2 guests

Powered by phpBB ® | phpBB3 Style by KomiDesign
cron