LibrePilot Forum

General Category => General Discussion => Topic started by: finst on November 28, 2015, 01:31:22 pm

Title: OPTune
Post by: finst on November 28, 2015, 01:31:22 pm
Hey there!

Currently the OPNGtune calculator is down and since Cnut stated he'd share the numbers with the OP devs, maybe you guys have them? Bother sharing the factors with us?

Greetings!
Title: Re: OPTune
Post by: f5soh on November 28, 2015, 01:43:25 pm
Hi Finst,

Using LibrePilot you can run the Easytune feature and TxPid.
Result is the same as the Opngtune calc but done onboard, just two knobs for Pitch/Roll.
(https://librepilot.atlassian.net/wiki/download/attachments/2490381/EasyTune_logic.png)

Wiki page : https://librepilot.atlassian.net/wiki/display/LPDOC/TxPID

https://www.youtube.com/watch?v=6-CBHgDUF8A
Title: Re: OPTune
Post by: finst on November 28, 2015, 03:23:33 pm
Thanks for the answer but I still have some questions.

With Opngtune you aim for the two uovs, which are way too high kp values and therefore not suitable for flying. These values are then multiplied with several constants to get the specific values for each axis etc. And in the end none of your uovs shows in the calculated parameters. Right?

In my understanding easytune multiplies the p values you enter with changeable factors and inserts them into the pid settings - in flight and in realtime. Real easy tuning. Right?
But since I cant go all the way up to the uovs, where do I need to stop? The results of the opngtune calculator suggest that the p values you want to have are not even near the ouvs.
Title: Re: OPTune
Post by: f5soh on November 28, 2015, 03:43:32 pm
If remember right the first factor applied from UOV value to P value was based on Esc config.
PWM / PWMSyncr / Oneshot : 0,9 to 1.1 from my memory, maybe wrong.
Title: Re: OPTune
Post by: jhan1 on November 28, 2015, 04:21:22 pm
I've noticed you still get oscillation when the p value is too high for roll and pitch using easytune.  For my 230 size quad I set the the min/max values to this for a start:

roll    .003 to .008
pitch  .003 to .012

Then I just fly line of of site and adjust untill it seems smooth.  Then I tighten up the ranges and fly fpv and adjust.
Title: Re: OPTune
Post by: corbatjean on November 28, 2015, 06:26:35 pm
If remember right the first factor applied from UOV value to P value was based on Esc config.
PWM / PWMSyncr / Oneshot : 0,9 to 1.1 from my memory, maybe wrong.

Attached is an OpTune Excel sheet computing KP Kd & KI, providing similar results as OPNG's Optune   ;)
Title: Re: OPTune
Post by: f5soh on November 29, 2015, 12:24:55 am
Thanks, this file can help user while Optune server is down :)
Title: Re: OPTune
Post by: FlyGuy2 on November 30, 2015, 04:25:38 am
Many thanks for the .xls! Took some time to get it configured for my setup but it gives me the same values as my OPNG notes show.
Title: Re: OPTune
Post by: AngusCox on December 01, 2015, 12:27:38 pm

Thanks for the answer but I still have some questions.

With Opngtune you aim for the two uovs, which are way too high kp values and therefore not suitable for flying. These values are then multiplied with several constants to get the specific values for each axis etc. And in the end none of your uovs shows in the calculated parameters. Right?

In my understanding easytune multiplies the p values you enter with changeable factors and inserts them into the pid settings - in flight and in realtime. Real easy tuning. Right?
But since I cant go all the way up to the uovs, where do I need to stop? The results of the opngtune calculator suggest that the p values you want to have are not even near the ouvs.

As finst said the process with OPTune is clear what to find. Can someone explain with EasyTune how is the process of adjusting the values with both knobs?
It seems that we will have to start from a basic configuration, near the values expected, it could be using a model from the wizard and then in real flight adjust the knobs, is it correct? In contrary of the OPTune procedure I assume that we will have to use the Flight Mode we used to fly when making the tuning. In my case will be Rate Mode and not Attitude as I had to use with OPTune during the tuning.
Can someone explain the full process and if my assumptions are correct?
Thanks for any help.
Title: Re: OPTune
Post by: TheOtherCliff on December 01, 2015, 09:22:20 pm
I haven't used EasyTune yet, but I think I understand what is going on.

With OPTune, once you have a UOV, you multiply it by some constants to get each of P, I, D.  If the UOV is twice as high then each of P, I, D is twice as high.  EasyTune just puts all that on a knob.  Think of the knob as changing the UOV and the PID's automatically being set correctly based on that UOV.  In your test flying, you aren't looking for onset of oscillation, you are looking for best flying characteristics.
Title: Re: OPTune
Post by: AngusCox on December 01, 2015, 10:34:29 pm

I haven't used EasyTune yet, but I think I understand what is going on.

With OPTune, once you have a UOV, you multiply it by some constants to get each of P, I, D.  If the UOV is twice as high then each of P, I, D is twice as high.  EasyTune just puts all that on a knob.  Think of the knob as changing the UOV and the PID's automatically being set correctly based on that UOV.  In your test flying, you aren't looking for onset of oscillation, you are looking for best flying characteristics.

In OPTune when for example you are looking for the Roll UOV, on the Pitch value you have a value that is near the real one and not the UOV Pitch value. So if you are trying to find the UOV value of the roll and also having the UOV value of the pitch I can't imagine how the quad would react. Another thing to have in mind is that with the OPTune process you also use the D and I values in cero, from both the pitch and roll, during the process on finding both UOV's.
This is why I assume that the process has to be different from what we were use to make with the OPTune.
Title: Re: OPTune
Post by: TheOtherCliff on December 03, 2015, 04:08:57 am
If you have a symmetric quad:

Then EasyTune is one knob that you adjust for best flight, which is just short of oscillation, and that has P, I, and D (roll and pitch) all set correctly from the one knob, as you fly.

In OpTune, you use one knob for TxPID to adjust the P value to where it is oscillating slightly, plug that in to the formula and get P, I, and D values to put in configuration.

If you don't have a symmetric quad, it is a little more complicated for either process.
Title: Re: OPTune
Post by: AngusCox on December 03, 2015, 12:35:22 pm

If you have a symmetric quad:

Then EasyTune is one knob that you adjust for best flight, which is just short of oscillation, and that has P, I, and D (roll and pitch) all set correctly from the one knob, as you fly.

In OpTune, you use one knob for TxPID to adjust the P value to where it is oscillating slightly, plug that in to the formula and get P, I, and D values to put in configuration.

If you don't have a symmetric quad, it is a little more complicated for either process.

Thanks! I will give it a try and I will post my findings.
Title: Re: OPTune
Post by: tasi on December 08, 2015, 12:00:54 am
Angus,
Any progress with the easy tune?

Title: Re: OPTune
Post by: tasi on December 08, 2015, 12:10:44 am
I've been looking to jump in the LP wagon for some time....trying to do some homework first :)

I've had good results with optune and with some tinkering I had my quad flying as a dream.
One thing comes to notice related to the easy tune process and the yaw coupling from the video above; in optune the calculator gives 4 ranges/descriptions to the yaw factor as smooth, firm and photo, sport, racer blabla etc while in easytune there are only 2. For us that haven't used LP yet wouldn't be wise to split the bar with the desired descriptions and ranges just for familiarity purposes? It is probably trivial but nonetheless a nice cosmetic touch up and reduced workload for us unfamiliar with LP to match up with OP values we had previously  :)

Just a suggestion for a nice to have :)
Title: Re: OPTune
Post by: angelo.p on January 05, 2016, 05:58:32 pm
Hello,
considering that I need OpTune Calculator, I spent some huors to do a little web page with my Optune Calculator.
http://cncmodel.altervista.org/blog/optune-calculator.html

Do you think it will useful or I have to make it private to avoid breaking some law? :-)

Bye
Title: Re: OPTune
Post by: TheOtherCliff on January 05, 2016, 09:09:04 pm
A guy who went by the name of Cnut (Craig Nuttall - IIRC) did the original work back in OP days.  I would try to find him if you are worried about it.

OPNG took the OpTune calc and renamed it OpngTune with no attribution for the original author, which was a bit low...

I would guess that he would be happy with a small line of text that he did it originally.
Title: Re: OPTune
Post by: Modulas on January 06, 2016, 04:12:12 am
Thanks for creating this angelo.p!
I've been using the Excel spreadsheet that's been floating around, but your version looks much prettier.

I agree that adding a line to thank Cnut would be a nice gesture.
Title: Re: OPTune
Post by: angelo.p on January 07, 2016, 11:01:00 am
Ok, I will leave the name OpTune calculator and I will add a thank to Cnut. If you have more info or other info to add to page your suggestions are welcome!
Title: Re: OPTune
Post by: Camshaft on January 20, 2016, 02:57:59 am
Hello everyone I'm a noob here and to the cc3d I have a robocat 270 I've flashed with libre pilot and op and I have it set to current settings! It flys but when I throttle up and it levels out in attitude mode and rate mode it shakes not so bad that it crashes but bad enough to drive me nuts! I want to try Easytune but my tx is a flysky fs-t6 but I've modded it with the 3 position switch so I've lost use of one of my knobs! Can I tune the roll and pitch together or do I have to do them separately ? And help would be great thanks
Title: Re: OPTune
Post by: TheOtherCliff on January 20, 2016, 03:46:07 am
Stuff to check because it can cause oscillations with stock settings:  First of all, determine the fastest update rate that your ESC's support.  Second, make sure they are set to use it (output page).  Third, if you change something from the first two things, you should probably recalibrate your ESC's.

About tuning roll and pitch at the same time with EasyTune or OPTune:  If your quad is symmetrical or only slightly asymmetrical, you can get away with it and it will fly much better than your current oscillation problem.  If you really want to split hairs after tuning them together, you can tune just one at a time.
Title: Re: OPTune
Post by: Camshaft on January 20, 2016, 04:42:56 am
Ok great thanks so much for the quick reply I will give that a shot first ! This is probably a stupid question but how would I determine the update rate on the esc I know they are rapid esc  I will go check and see if I can get more info! Thanks again it's really appreciated
Title: Re: OPTune
Post by: Camshaft on January 20, 2016, 05:08:17 am
(http://uploads.tapatalk-cdn.com/20160120/4a0f95802b1c4c96200fcfcb95e5980a.jpg)
Title: Re: OPTune
Post by: Camshaft on January 20, 2016, 05:08:59 am
Does this tell you anything sorry like I said I'm a noob! Sorry!
Title: Re: OPTune
Post by: TheOtherCliff on January 20, 2016, 07:43:14 am
That picture was exactly what was needed to make sure it was set up correctly.  You are running 490Hz PWM on 1-3 and 4.  That is a fast enough update rate that we know your problem is not because of slow ESCs.  Also, "rapid ESC" generally means 490 Hz is OK.  Also, they are working so they can handle the 490 Hz.
Title: Re: OPTune
Post by: TheOtherCliff on January 20, 2016, 07:45:41 am
Use EasyTune or OpTune to reduce your PIDs a little.  (50% ?)
Title: Re: OPTune
Post by: Camshaft on January 20, 2016, 08:10:04 am
Thanks so much I will let you know the outcome tomorrow! Thanks again for everything you do to help us out! We could get no where without fellas like you
Title: Re: OPTune
Post by: zamu91 on January 23, 2016, 08:19:39 pm
Hi to everyone

I and Angelo.p made a simple app for lpTune

This is the web version
http://www.novaprogrammi.it/lptune/

The package with the code
http://www.novaprogrammi.it/lptune/lpTuneDef.zip

And here the apk for android
http://www.novaprogrammi.it/lptune/lpTune-def.apk


This is a simple cordova project, It could be compiled for other platform (Ios, Windows Phone, Ubuntu Touch ecc...)
We would happy if you want pubblish it with the Librepilot domain



 
Title: Re: OPTune
Post by: Camshaft on January 23, 2016, 08:27:22 pm
Very nice work gentlemen
Title: Re: OPTune
Post by: Modulas on January 24, 2016, 06:44:29 am
Awesome app guys!
Title: Re: OPTune
Post by: zamu91 on January 25, 2016, 07:46:41 pm
Thanks :D
Title: Re: OPTune
Post by: matrixFLYER on January 26, 2016, 01:16:52 am
Very nice work
Title: Re: OPTune
Post by: telnoi on February 29, 2016, 01:28:43 pm
Going to try this for the first time.
In what mode should the tuning be done? Attitude, or rate?
Title: Re: OPTune
Post by: zamu91 on February 29, 2016, 01:30:36 pm
Going to try this for the first time.
In what mode should the tuning be done? Attitude, or rate?
Attitude