Multiwii 2.2 - GPS hold

scrat
Posts: 925
Joined: Mon Oct 15, 2012 9:47 am
Location: Slovenia

Re: Multiwii 2.2 - GPS hold

Post by scrat »

Could you post a picture of your work please. I have old HDDs too. Thx!

mopedcrosser
Posts: 52
Joined: Sat Feb 23, 2013 12:35 pm

Re: Multiwii 2.2 - GPS hold

Post by mopedcrosser »

Which Nerd does not ;-)

zwiebacksaege
Posts: 27
Joined: Thu Mar 07, 2013 10:14 am

Re: Multiwii 2.2 - GPS hold

Post by zwiebacksaege »

i'm planing to try it this evening.. will post the result then immediately

scrat
Posts: 925
Joined: Mon Oct 15, 2012 9:47 am
Location: Slovenia

Re: Multiwii 2.2 - GPS hold

Post by scrat »

mopedcrosser wrote:Which Nerd does not ;-)


8-)

zwiebacksaege
Posts: 27
Joined: Thu Mar 07, 2013 10:14 am

Re: Multiwii 2.2 - GPS hold

Post by zwiebacksaege »

sorry guys not time for testing up to now... family sucks every minute :-D
but i'm on it.. if someone else is faster... I would appreciate it :-)

trello
Posts: 19
Joined: Wed Apr 10, 2013 1:04 pm

Re: Multiwii 2.2 - GPS hold

Post by trello »

I got RTH working perfectly with AIO Pro, u-blox NEO-6M and MW 2.2. I always had drifting issues in the past, with these settings it works everytime. Here is a short manual:

-Connect the GPS module to ublox u-center with a ftdi adapter
-Change baud rate to 115200 and update rate to 5hz
-Make sure the settings are saved to eeprom! Disconnect and reconnect u-center to make sure everything is saved properly
.Use this link to get the exact value for magnetic declination: http://www.ngdc.noaa.gov/geomag-web/, convert to decimal here: http://www.satsig.net/degrees-minutes-s ... ulator.htm

config.h:
#define GPS_SERIAL 1 // Your serial port, i'm using RX1 and TX1
#define GPS_BAUD 115200

//#define GPS_LEAD_FILTER // Comment this line! The lead filter is likely the cause for drifting
#define MAG_DECLINIATION 1.66f // See above


GPS.ino:
#define NAV_SPEED_MIN 250 // cm/sec
#define NAV_SPEED_MAX 400 // cm/sec
#define NAV_SLOW_NAV true
#define NAV_BANK_MAX 2000 //30deg max banking when navigating (just for security and testing)


-Calibrate ACC and Compass from MultiWiiConf.
-Enable GPSHOME, ANGLE and MAG mode for RTH.

zwiebacksaege
Posts: 27
Joined: Thu Mar 07, 2013 10:14 am

Re: Multiwii 2.2 - GPS hold

Post by zwiebacksaege »

As I promised I wanted to report my results of shielding the mag with some paramagnetic metal from old HDDs. The result was rather poor so that I really favorite some software-correction of the mag error due to throttle changes. I can really see some nearly linear behaviour of the heading error and the throttle position in my OSD. So it should not be so hard to implement some simple correction term for the mag.

User avatar
linuxslate
Posts: 91
Joined: Mon May 13, 2013 3:55 pm

Re: Multiwii 2.2 - GPS hold

Post by linuxslate »

I just wanted to confirm that I, too have RTH working will with the same settings as trello.

EDIT: I have BARO checked also for RTH. Is this not correct?!

While watching a video from my early successful RTH flights, I noticed that it seemed to be taking a rather leisurely flight back to me. If the weather cooperates this weekend, I intend to try to increase NAV_SPEED_MAX.

zwiebacksaege
Posts: 27
Joined: Thu Mar 07, 2013 10:14 am

Re: Multiwii 2.2 - GPS hold

Post by zwiebacksaege »

up to now I got medium good results in position hold... when I change the position manually it even works holding new corrected position.. at least on a calm day...
but changing just the heading results into problems amost everytime... it behaves as if he would not be aware of new heading... and drifting away in wrong direction so that I have to recover manually very fast. Any ideas? When I change heading AND position with pitch/roll I don't get this problem.

trello
Posts: 19
Joined: Wed Apr 10, 2013 1:04 pm

Re: Multiwii 2.2 - GPS hold

Post by trello »

Some observations after more testflight with the settings posted above. I'm mainly focused on rth instead of position hold.

Safety
RTH still works 100% of the time, even with a small number of satellite locks and activated in-flight while the copter isn't necessary stabilized. This is awesome as a safety feature, for fpv, etc.

Accuracy
Depends on the location and day of flying. Sometimes it returns to about 1-2m of arming position and gps hold works pretty smooth, sometimes its off by 4-5m and starts to drift when in position hold. Drift is not a problem with the stability, wind or gyro, if its accurate in RTH then gps hold is also more stable. Of course more satellites help but i've had poor performance with 7 satellites and good results with 5. Possibly interferences at the flight site? Will have to test if some locations have a better overall performance.

Setup
I have the gps antenna mounted about 4-5cm above the power distribution separated by two layers of wood and one layer of carbon. Its placed right next to the fc but that doesn't seem to be a problem.

mopedcrosser
Posts: 52
Joined: Sat Feb 23, 2013 12:35 pm

Re: Multiwii 2.2 - GPS hold

Post by mopedcrosser »

Hi,

I just wanted to let you know that correcting the mag by setting up the wiring properly and using mumetall screens did not improve my pos hold significantly. The copter still drifts away slowly in a 15 m radius, which is definetely not a gps issue, since I can see it drifting away on the map... The mag itselves is awesome right now.. Even at full throttle the copter keeps heading perfectly. So what might be the issue?

I have 3 guesses

1. The compass north is not north because there is whyever a deviation. I tried to check that but I did not have a compass I could trust. I tried to verify the heading by looking for a street that goes exactly from north to south on the map. It looked ok so far, but i will try to verify in flight again. Btw.. Its not easy to find such a road in germany :-) . But then again.. how bad can a 1- 10 degree deviation influence the pos hold behavior?! Could probably someone with perfectly working poshold try to set a far wrong mag declination?

2. The pids are not correct and have to be tuned.

3. The gps lead filter causes the issue. I cant believe this, since the guys with a good ph are using that option...

I'll let you know what my next findings are. Please read the yaw hold - not holding post. It seems like there are many guys having similar issues in 2.2... Another possible reason, should probably be discussed in sw development.

Happy testing

Sebastian

User avatar
ezio
Posts: 827
Joined: Sun Apr 01, 2012 11:03 pm
Location: Paris
Contact:

Re: Multiwii 2.2 - GPS hold

Post by ezio »

mopedcrosser wrote:Hi,

I just wanted to let you know that correcting the mag by setting up the wiring properly and using mumetall screens did not improve my pos hold significantly. The copter still drifts away slowly in a 15 m radius, which is definetely not a gps issue, since I can see it drifting away on the map... The mag itselves is awesome right now.. Even at full throttle the copter keeps heading perfectly. So what might be the issue?

I have 3 guesses

1. The compass north is not north because there is whyever a deviation. I tried to check that but I did not have a compass I could trust. I tried to verify the heading by looking for a street that goes exactly from north to south on the map. It looked ok so far, but i will try to verify in flight again. Btw.. Its not easy to find such a road in germany :-) . But then again.. how bad can a 1- 10 degree deviation influence the pos hold behavior?! Could probably someone with perfectly working poshold try to set a far wrong mag declination?

2. The pids are not correct and have to be tuned.

3. The gps lead filter causes the issue. I cant believe this, since the guys with a good ph are using that option...

I'll let you know what my next findings are. Please read the yaw hold - not holding post. It seems like there are many guys having similar issues in 2.2... Another possible reason, should probably be discussed in sw development.

Happy testing

Sebastian

My quad holds position quite nice but when I enable the lead filter it doesn't work well. The quad is all over the place.

mopedcrosser
Posts: 52
Joined: Sat Feb 23, 2013 12:35 pm

Re: Multiwii 2.2 - GPS hold

Post by mopedcrosser »

Mhmm ok ;-). I´ll try to disable it. It always bothers me to change the code since you have to recalibrate and resetup everything. It would be nice to see Mavlink in the next release. BTW. Thanks for your great app ! This is the only thing working without trouble ;-).

Sebastian

mopedcrosser
Posts: 52
Joined: Sat Feb 23, 2013 12:35 pm

Re: Multiwii 2.2 - GPS hold

Post by mopedcrosser »

Alright ! I tested the entire thing without the gps lead filter and there is no difference at all. Which is kind of good, since it might tell me that my mag is working correct now. It has been a very calm day almost without any wind. I observed the copter to go back and forth above the desired point, but not circeling. Therefore I assume that it is the PI beeing not properly adjusted. This is the next step I will try. Can someone confirm that it is the Pos PI to tune ? I still do not get the difference between PosR and NavR if both are required to navigate to a waypoint and Pos is the PI to hold position. I will report my findings..

Seb

masterX
Posts: 1
Joined: Tue Jul 16, 2013 11:13 pm

Re: Multiwii 2.2 - GPS hold

Post by masterX »

mopedcrosser wrote:Hi all,

I think the key to solve this issue is to get rid of all interference from power lines. I am trying for a while now and ended up
ordering Mu Metal foil to screen the FC from the magnetic field of the power lines. The only concern I have is that I screen
the earth mag field as well, but I´ll try to get it only in between of cables and FC. I already have about 5cm of space in between of
the power distribution and the mag is still affected pretty bad. In Idle the compass doesn´t move, but as soon as I speed up to take
of the deviation is about 10° and increases with throttle. So you all should check that using the GUI and BT. If there is a deviation
caused by the mag field, a correct (fine) positioning is almost impossible.

1. Everytime the copter drifts off (lets assume north) the copter will try to correct the pos to the opposite direction (in this case south).
But if the mag doesn´t tell the copter the exact direction it will corret in the same direction. This explains in my opinion the wandering
around the correct position. As soon as the deviation gets too large the pos can be corrected approximately using the gps. This explains
why we see circeling in a 10 - 20 m radius.

2. Setting the correct mag declination wont help in this case, since the interference from the power lines is much greater. It will always be off.

3. If there is a deviation in the compass it sounds plausible to me that uncommenting the lead filter improves the situation, since the copter wont
use predicted values (that cant be achieved due to the inaccurate mag) and uses the actual gps position which should be pretty much correct.

Tell me what you think... I´ll let you know if my theory was correct IF I can make it to ged rid of the mag deviation. My escs are all in the centerplate
and there are tons of wires..

Seb


Hey,

did you already fixed your problem? same here.

rizky_p
Posts: 14
Joined: Thu Sep 06, 2012 3:57 pm

Re: Multiwii 2.2 - GPS hold

Post by rizky_p »

I have had GPS Modules added to multiwii about 8 months ago, never managed to make GPS Hold works since then, it just wonders off in some funny directions, searched all over the place for any clue on how to tune the PID but still could not understand it. Basically i went blind and tune each PID by first zero every PID value and start from there. By magic Holy cow i got it to work hahaha i am so happy. today i drain a single 5000mah 3S battery hands off, man that feeling of achievement is awesome.

Here you can see my short video, sorry for night shot i cant wait for tomorrow and share it with you guys :)

http://youtu.be/VYqb7TyuazE

Cheers
Rizki

User avatar
alll
Posts: 220
Joined: Fri Dec 07, 2012 9:53 am

Re: Multiwii 2.2 - GPS hold

Post by alll »

Multiwii2.2 / CriusSe (no baro protection) / I2C UBLOX GPS and a crappy 350gram ooold quad (3D) ;) in quite windy and gutsy weather.
http://youtu.be/pzKF2Wfr1E0
manu
PS: i don't give you the PID values, because it will most probably not suit YOUR copter! :!:

In-Flight
Posts: 37
Joined: Wed Jan 30, 2013 5:11 am

Re: Multiwii 2.2 - GPS hold

Post by In-Flight »

Curios if anyone is changing their #define GPS_WP_RADIUS from the default of 200 to maintain a better pinpoint hold.
I've just started attempting to tune my POS hold.
Default settings work great, i just see a little more drift than I would like before it starts to recenter its location.
I figured this was related to the 200cm radius (which is huge in my opinion).
I've dropped it to 100 and I think I'm seeing better results, but was wondering how low everyone has taken this.

scrat
Posts: 925
Joined: Mon Oct 15, 2012 9:47 am
Location: Slovenia

Re: Multiwii 2.2 - GPS hold

Post by scrat »

Just for info guys. I hava Crius AIO Pro v1.1 with GPS CN-06 - MWii v2.2. Till yesterday I have had set baudrate for gps 115200 and gps was working quite ok. But then I have set gps baudrate to 57600 and now it works way better and gps locks to satelites in about 30sec. Before it was from 1 to 2 minutes.

And quad holds position almost in spot with lead filter enabled. :)

I'm very happy now.

User avatar
mOuchadino
Posts: 15
Joined: Sat Jul 07, 2012 3:51 am

Re: Multiwii 2.2 - GPS hold

Post by mOuchadino »

:roll: :roll: :roll:

I have to build multiwii 2.2 with mpu 6050 acc + I2C Gps nav beta version :mrgreen:
the video as bellow



Last edited by mOuchadino on Fri Aug 09, 2013 10:18 am, edited 1 time in total.

mopedcrosser
Posts: 52
Joined: Sat Feb 23, 2013 12:35 pm

Re: Multiwii 2.2 - GPS hold

Post by mopedcrosser »

Hi all,

I found the issue for my copter. First I am sure that the compass mag interference would have had influenced a proper pos hold, but since it was still bad after fixing the interference (as described before by mu metal screen and proper power lines) I started tuning PIDs.

So guess what after increasing the Pos Hold PI´s P step by step I got the copter to sit within a range of 1 sqare meter. So definetly my troubles were caused by inappropiate PID´s. You should definetly try this since it was very very easy and you will see results immediately ( if this is your problem )

But this is where the trouble starts for me. I want to keep the pos hold smooth AND strong - which I wasn´t able to get. I am still not sure and not able to figure out how the Pos hold PI and the Pos hold rate PID influence the behavior exactly.

Once I read EOSbandis brief description I believe it is like this:

The PI controller is setting the speed to get back to the setpoint while the rate PID is tilting the copter to archive this speed. Is that correct ?

But still with this assumption I was not getting satisfying results because I did not know which one to tune to fix a certain (mis)behavior.

So what I experienced is that it did not really matter if I increase the PI or PID´s P. Both times the copter gets more aggressive and gets back in place
faster. So far so good. At a certain point I just increased the PI´s P from 0.11 to 0.5 and then tried to fix the remainder with the pos rate PID. But everytime
I get a very stable behavior in calm conditions (high pos rate PID ~ 5 ) the copter starts to get crazy once pushed too far away from home. I get heavy oscillations and
it would crash if I would not disable poshold. If I use lower P´s the copter starts to circle around the target. So the masterpiece is to make the copter returnig to the set position fast and smooth without overshooting (no matter how far it had been pushed away, or just imagine you activate poshold during fast flight - you dont want it to oscilate and overshoot / crash ). So how to do that ?

For everybody not knownig this.. there is a simulator at jasonshort.com where you can try different settings.. unfortunately there is only constant wind .. But for me the bad part is to find a setting that works for all conditions..

It would be kind if one of the grandmasters could explain the effects of the both a little better and a step by step algorythm for tuning would be awesome...

Best regards

Sebastian

PS: The safest thing is to leave the rate PID as it is and increase the PI`s P only for a bit. That improved poshold greatly but did not cause dangerous overshooting leading to crashes...

User avatar
mOuchadino
Posts: 15
Joined: Sat Jul 07, 2012 3:51 am

Re: Multiwii 2.2 - GPS hold

Post by mOuchadino »

:D :D
i,m use tx turnigt with ER9x firmware + 6 position mixing switch :D


mopedcrosser
Posts: 52
Joined: Sat Feb 23, 2013 12:35 pm

Re: Multiwii 2.2 - GPS hold

Post by mopedcrosser »

Alright a little feedback from several flights,

I made it strong and smooth by leaving the pos hold PI as it is and added just a 0.1 I to overcome wind. If you increase the PI´s P you increase the speed towards a target, which is bad, since the copter will overshoot pretty soon. So my receipe was to leave the P at 0.11 ( you can go higher up to 0.5 but in my case results were worse). Then I started to increase the PosRate PID´s P slowly until it started to overshoot and lowered it again for a bit then. The original value for P was 2. When I increased up to 4 I had good results, but it did not return to the setpoint as desired. So I continued increasing the P until 10. In my case 10 was too much and the copter started to overshoot again. Furthermore you need to be aware of the fact that greater distances result in a (proportional = P) higher P which might lead to aggressive behavior if the copter is whyever far away from the setpoint. Therefore I recommed you always to test your setting while flying at a high speed and and activating poshold then. Because the copter is at a high speed while you activate poshold there will be a great distance between copter and desired point and you can see if the copter reacts too heavy. I was finally setting my P to 6 since the copter reacts strong, but is not going mad for great deviations. Up to 8 had been fine for me as well but if I activate psohold in low altitudes I am not sure if the strong counterreaction for great deviations would not result in a crash ;-).

One word for I and D. You should not increase I without a reason. If you see your copter not reaching its position in strong wind, you might want to increase I for a bit but not to much. High I´s cause pretty bad overshooting and bad behavior if too high since the term wont 0 out at the setpoint. The best application to understand the beahvior is attached. Its very useful since you can see the actual P I and D values which you unfortunately cant for your copter ! Just increase I for the initial setting and you will see the effect that I is still to big while the target has already been reached. Its also good to understand the effect of I if you set p very small. Because of the loss of heat the value wont reach its setpoint. If you dial in a small I it will compensate a longer deviation. Happy testing, its very good to translate to the effect of wind on a copter !

Best regards & Good luck

Seb
Attachments
pid-simulator-v1.0.0.6.rar
(118.27 KiB) Downloaded 928 times

clab
Posts: 2
Joined: Tue Aug 13, 2013 9:39 am

Re: Multiwii 2.2 - GPS hold

Post by clab »

After reading a lot about the issue "GPS hold" I want to share my experiences. Maybe some of you can get rid of the GPS hold problem like me.

First my config:
Frame: F450 X-frame (from Goodluckbuy), not very stiff/rigid, but ok
ESC: Skywalker 4in1 20A
Motors: XXD 2212A
FC: CRIUS AIOP V1.1
Software: Multiwii 2.2
GPS: Ublox Neo6 V2.0
Weight: about 1.1kg with Lipo
Props: 9x47

How I bulid up the components (beginning from the lowest part):
- lower frame plate
- ESC
- 2cm space
- upper frame plate
- 3mm space
- blank circuit board
- 7mm space
- CRUIS board
- 1,5cm space
- blank circuit board
- GPS

Difference in total between ESC and Cruis: about 3,5cm

My main problem was the same a lot of other users are complaining about too: When I activate the GPS hold function, the copter starts flying circles, which are getting bigger and bigger, so at last, I have to deactivate GPS hold.

This was already done:
- Flight in stable mode (horizon and angle) is ok. Don't try to check or optimize it on a windy day.... doesnt't work well...
- Reduce the influence of the ESC to the mag on the CRIUS board, when throtteling up motors. Easy way to check this: Fly with MAG on keep it hovering and than throttle up to maximum for a short moment. If the copter turns for a short moment and comes back to the initial direction, everything is fine (regarding a stable GPS hold!).

What are the key informations to eleminate the problems:

1. PID!!!!!
At first you have to understand the meaning of Pos PI and PosR PID. Please have a look at the pdf-file some posts before. It is explained really well . Even Mopedcrosser explained a lot in the previous post.
Pos PI:
P: keep it low, my value is 0.10 (Range: 0.00 - 2.50)
I: This is the key to reduce (eleminate) circleing around. My value: 1.8 (Range: 0.00 - 2.50)

Please read the pdf (see above) for understanding these parameters. It is really important

PosR PID:
P: Also keep it low, if you increase too much, the copter will overshoot! My value: 2.5 (Range: 0.0 - 25.0)
I: My value is 0.01 (Range: 0.00 - 2.50)
D: My value is 0.100 (Range: 0.000 - 0.250)

Keep in mind, that PosR PID are RATE values, this is a little bit different of tuning the PID for i.e. ROLL and PITCH. This is the reason, why the ranges of these values are completely different.

I feel a little bit sad, when others send posts with: "Everything is perfect now, but I will not give you my values, because my copter has another configuration than yours!". So, I hope, my values can help others. It's just for orientation, how to tune your PID values.

2. GPS Noise!!!!
This is a very big problem. You can try by yourself: connect your smartphone via Bluetooth to the copter, keep motors off and start i.e. EZGUI. Click on Waypoints Map and wait for a while. On the map you will see the copter is moving, but it's still on the ground. This is GPS noise. The longer the GPS modul receives signals, the less is the noise, but it's never zero. Cloudy weather increases noise. To reduce this effect, I have done the following:

- In Multiwii Sketch increase the GPS_WP_RADIUS (config.h, my acutal value is 250, original is 200). The smaller this diameter, the quicker the copter starts to drift, because it follows its "original" position, but it's only GPS noise. Increasing this radius reduces the drift.
Imagine: You have to keep staying in a circle with a diameter of 50 cm. Now this circle is moving around (noise), but you have to stay in this circle, you must follow very quick. If the diameter is i.e. 300cm, the circle may move around, but your're still in the circle, so you don't have to change your position.

- Increase Baud-Rate and frequency of GPS modul to maximum! I changed the Baud-Rate to 115200 and 5Hz. Obviously this is the maximum, the CRIUS board is able to read, I tried 10Hz, but then I don't get a GPS signal on Multiwii Conf. This is the way, the GPS_FILTERING (config.h) is working optimal. It averges the last 5 GPS coordinates. If you send GPS with a rate of i.e. 1Hz, it takes too much time, to calculate the average, and in the meantime the copter starts to drift.

Actual the GPS_LEAD_FILTER is deactivated.

Activated options with GPS hold:
- ANGLE + MAG
- HORIZON + MAG
I think, the combination horizon + mag is a little bit better, but both combinations are working fine.


This is my experience so far.

Best regards,

Chris

User avatar
alll
Posts: 220
Joined: Fri Dec 07, 2012 9:53 am

Re: Multiwii 2.2 - GPS hold

Post by alll »

clab wrote:I feel a little bit sad, when others send posts with: "Everything is perfect now, but I will not give you my values, because my copter has another configuration than yours!". So, I hope, my values can help others. It's just for orientation, how to tune your PID values.
Chris


Thats me! ... :?

Ok here are my GPS PID values in bold

Pos PI:
P: keep it low, my value is 0.10 (Range: 0.00 - 2.50): 0.53
I: This is the key to reduce (eleminate) circleing around. My value: 1.8 (Range: 0.00 - 2.50) : 0.2
PosR PID:
P: Also keep it low, if you increase too much, the copter will overshoot! My value: 2.5 (Range: 0.0 - 25.0) : 5.0
I: My value is 0.01 (Range: 0.00 - 2.50) : 0.01
D: My value is 0.100 (Range: 0.000 - 0.250) : 0.060

NavR : 3.4;0.06;0.010

For this crappy test quad:
https://www.youtube.com/watch?v=pzKF2Wfr1E0

So, you see that my values are quite different (especially P ?).
manu

e_lm_70
Posts: 297
Joined: Fri Aug 09, 2013 8:35 pm

Re: Multiwii 2.2 - GPS hold

Post by e_lm_70 »

alll wrote:
clab wrote:I feel a little bit sad, when others send posts with: "Everything is perfect now, but I will not give you my values, because my copter has another configuration than yours!". So, I hope, my values can help others. It's just for orientation, how to tune your PID values.
Chris


Thats me! ... :?

Ok here are my GPS PID values in bold

Pos PI:
P: keep it low, my value is 0.10 (Range: 0.00 - 2.50): 0.53
I: This is the key to reduce (eleminate) circleing around. My value: 1.8 (Range: 0.00 - 2.50) : 0.2
PosR PID:
P: Also keep it low, if you increase too much, the copter will overshoot! My value: 2.5 (Range: 0.0 - 25.0) : 5.0
I: My value is 0.01 (Range: 0.00 - 2.50) : 0.01
D: My value is 0.100 (Range: 0.000 - 0.250) : 0.060

NavR : 3.4;0.06;0.010

For this crappy test quad:
https://www.youtube.com/watch?v=pzKF2Wfr1E0

So, you see that my values are quite different (especially P ?).
manu


Thanks, and very nice video too.

I'm on stock PID all around my tricopter, and it is rock solid ... (but my copter is possible way bigger then your, with 50cm wood arm, making it around 1000mm class and around 1.5k heavy

But ... the issue that I see, is that I would like to smooth down the copter "shaking" since onboard video without gimbal does suffer a bit.

So, I'm going to reduce most of the PID (after had a deep look of them)

In my case, I did hack also the navigation speed ... it was so slow ... that I did double to hardcoded value :mrgreen: ... but I still the hardcoded limit of max inclination (that could play a role on not allow to reach the desired speed)

Mainly the GPS hold PID are the one that need to be more smooth ... for have less accuracy, but a more soft on board video

:ugeek:

clab
Posts: 2
Joined: Tue Aug 13, 2013 9:39 am

Re: Multiwii 2.2 - GPS hold

Post by clab »

e_lm_70 wrote:So, you see that my values are quite different (especially P ?).
manu


Hi Manu,

for sure, quite different, but very interesting. When I increase Pos P (even 0.3 is too much) the copter always overshoots, so I tried high Pos I with big success. PosR P I will try different values. I and D are nearly the same.

Best regards.

Chris

spagoziak
Posts: 171
Joined: Thu Jan 20, 2011 1:18 am

Re: Multiwii 2.2 - GPS hold

Post by spagoziak »

I have the same experience--if the quad is blown too far away from its GPS hold point, it will suddenly and violently pitch toward the hold point, most certainly bound to crash if I don't intervene. Why doesn't the response scale smoothly from gentle to severe as the error increases? It was gradually increasing pitch angle until some point maybe 5m away from its target, where it nearly pitched from 15 to 90 degrees in less than a second.

Does this behavior match your experiences prior to retuning PIDs as described in previous posts?

spag

mopedcrosser wrote:Hi all,

I found the issue for my copter. First I am sure that the compass mag interference would have had influenced a proper pos hold, but since it was still bad after fixing the interference (as described before by mu metal screen and proper power lines) I started tuning PIDs.

So guess what after increasing the Pos Hold PI´s P step by step I got the copter to sit within a range of 1 sqare meter. So definetly my troubles were caused by inappropiate PID´s. You should definetly try this since it was very very easy and you will see results immediately ( if this is your problem )

But this is where the trouble starts for me. I want to keep the pos hold smooth AND strong - which I wasn´t able to get. I am still not sure and not able to figure out how the Pos hold PI and the Pos hold rate PID influence the behavior exactly.

Once I read EOSbandis brief description I believe it is like this:

The PI controller is setting the speed to get back to the setpoint while the rate PID is tilting the copter to archive this speed. Is that correct ?

But still with this assumption I was not getting satisfying results because I did not know which one to tune to fix a certain (mis)behavior.

So what I experienced is that it did not really matter if I increase the PI or PID´s P. Both times the copter gets more aggressive and gets back in place
faster. So far so good. At a certain point I just increased the PI´s P from 0.11 to 0.5 and then tried to fix the remainder with the pos rate PID. But everytime
I get a very stable behavior in calm conditions (high pos rate PID ~ 5 ) the copter starts to get crazy once pushed too far away from home. I get heavy oscillations and
it would crash if I would not disable poshold. If I use lower P´s the copter starts to circle around the target. So the masterpiece is to make the copter returnig to the set position fast and smooth without overshooting (no matter how far it had been pushed away, or just imagine you activate poshold during fast flight - you dont want it to oscilate and overshoot / crash ). So how to do that ?

For everybody not knownig this.. there is a simulator at jasonshort.com where you can try different settings.. unfortunately there is only constant wind .. But for me the bad part is to find a setting that works for all conditions..

It would be kind if one of the grandmasters could explain the effects of the both a little better and a step by step algorythm for tuning would be awesome...

Best regards

Sebastian

PS: The safest thing is to leave the rate PID as it is and increase the PI`s P only for a bit. That improved poshold greatly but did not cause dangerous overshooting leading to crashes...

mopedcrosser
Posts: 52
Joined: Sat Feb 23, 2013 12:35 pm

Re: Multiwii 2.2 - GPS hold

Post by mopedcrosser »

I made it strong and smooth by leaving the pos hold PI as it is and added just a 0.1 I to overcome wind. If you increase the PI´s P you increase the speed towards a target, which is bad, since the copter will overshoot pretty soon. So my receipe was to leave the P at 0.11 ( you can go higher up to 0.5 but in my case results were worse). Then I started to increase the PosRate PID´s P slowly until it started to overshoot and lowered it again for a bit then. The original value for P was 2. When I increased up to 4 I had good results, but it did not return to the setpoint as desired. So I continued increasing the P until 10. In my case 10 was too much and the copter started to overshoot again. Furthermore you need to be aware of the fact that greater distances result in a (proportional = P) higher P which might lead to aggressive behavior if the copter is whyever far away from the setpoint. Therefore I recommed you always to test your setting while flying at a high speed and and activating poshold then. Because the copter is at a high speed while you activate poshold there will be a great distance between copter and desired point and you can see if the copter reacts too heavy. I was finally setting my P to 6 since the copter reacts strong, but is not going mad for great deviations. Up to 8 had been fine for me as well but if I activate psohold in low altitudes I am not sure if the strong counterreaction for great deviations would not result in a crash ;-).

One word for I and D. You should not increase I without a reason. If you see your copter not reaching its position in strong wind, you might want to increase I for a bit but not to much. High I´s cause pretty bad overshooting and bad behavior if too high since the term wont 0 out at the setpoint. The best application to understand the beahvior is attached. Its very useful since you can see the actual P I and D values which you unfortunately cant for your copter ! Just increase I for the initial setting and you will see the effect that I is still to big while the target has already been reached. Its also good to understand the effect of I if you set p very small. Because of the loss of heat the value wont reach its setpoint. If you dial in a small I it will compensate a longer deviation. Happy testing, its very good to translate to the effect of wind on a copter !


Hi all,

my settings and experiences are very similar to Manu´s and Chris´s. A high PosHold P leads to overshooting which is plausible in my opinion since it leads to a high speed but not a high tilt. So for high P´s the copter will approach with a high speed an overshoot. If you keep the PI´s P low and increase the PID´s P instead you will see the copter approaching the target and then tilting the other way to stop. This leads to a very smooth and stable behavior since the copter always goes back to target without overshooting and sits there very stable. The PI´s I is to overcome wind. Dont increase it to much since it causes overshooting as well because the I term wont 0 out at target position. (Use my simulator I attached earlier). My settings are:

POS Hold PI

P: 0.1
I: 0.1 (I will try to increase it since mine could be a little more stable against strong winds)

Pos R PID

P: 7 ( From 4 to 8 is ok - all above 8 is a little too aggressive) 7 is for me best since it is still very stable in strong unsteady winds - all below is smoother but copter gets blown away by 2-3 meters temporarily in stronger unsteady winds

I: Stock - dont touch it :-) - As I told you above this term wont 0 out at the target location if too high and cause bad overshooting. If you touch it be careful, try the sim above

D: 0.045 (Stock - I will probably try to increase this by a little more since I can see the copter sitting stable in place but having little oscillations in pitch and roll - like a bad tuned PID for stable mode - not good for camera use.)

If someone was able to get rid of these little oscillations please let me know. I dont have these oscillations without Pos Hold so I guess I have to improve the D term to eliminate these fast oscillations while beeing in place. I cant confirm the gps noise. I also have the V2 GPS and my copter stays in place on the map and it also stays within one square meter during pos hold. The only thing I have to get rid of is the oscillation since it´s messing up my camera images.

Please note: Depending on your weight and motors the settings will vary quite a bit. Thats why some are fine with the stock values and some not. I have a 600 Hexa weighing about 1.9kg including all (copter, 5000mah battery, gopro, fpv transmitter). I am using 6 sunnysky 910kw motors and 11X5 props. Hope that helps.

Best regards

Seb

oterpoter
Posts: 61
Joined: Sat Nov 05, 2011 2:11 am

Re: Multiwii 2.2 - GPS hold

Post by oterpoter »

Hi all!
My heavy Octocopter using MultiWii 2.23 code, MIS OSD and MTK GPS finally uses the GPS.
I have some issues still..
When i throttle up, the mag changes with 10 degrees (counter clockwise always). This I am trying to shield, since my motors are getting their power from 2x8400mah 3S batteries in parallell.
I am trying to shield the induced magfield by using metal plates (shields) from an old laptop charger. yesterday I placed the shield above my power distribution, underneeth the bottom frame plate.
from bottom and up my model is like this
power distribution
metal shield
carbon frame plate
alu square tubes (arms) : 20mm
carbon frame plate top
standoffs 30mm
G10 plate for FC
FC mounted on AntiVib screws
Standoffs 20mm
G10plate for OSD
OSD mounted on G10
Standoffs 20mm
G10plate for protection

Some of the behaviour I experience is this

Baro Hold:
When I turn this on, it tries to hold altitude, but goes up and down gently. Is this due to less aggressive PIDs? I can easily hoover steady on 50% and be rock steady if I do this manually.

GPS Hold:
It goes in small circle constantly. it will never be fixed at one spot. and since the BaroHold is turned on at the same time, the problem from baroHold with the copter going up and down as well, it stays within a imaginary box of some 8x8x8m approx.

Return To Home.
I if turn this on, the copter starts to fly pretty FAST in one direction slightly OFF from the HomeBase, and ALWAYS to the left of it (it is as if it believes the Home to be rotated somehow.). When it reaches the home, it just overshoots, and with still alot of speed. I am planning to reduce the Max_Speed to 2m or less..
I have never dared leaving it to see what it does, because it banks pretty much, and speeds off past the target, thus leaving me to turn it to manual mode..

I am using Pulso motors (860KV), with 12x45 carbon props, and HiModel 40A Pro ESCs.
Flight Controller is a proflyer.eu (discontinued) board, with MIS OSD, and a MTK 5Hz GPS.

I have read about someone putting some foam over the baro? why? and what kind of foam?

PS. the GPS is placed out on one of the arms, 20cm from the FC.
All cables are twisted.
all ESC cables has ferrite rings close to FC connection



Any suggestions would be much apprechiated!

pm1
Posts: 136
Joined: Sun Jan 22, 2012 7:26 pm

Re: Multiwii 2.2 - GPS hold

Post by pm1 »

oterpoter wrote:Baro Hold:
When I turn this on, it tries to hold altitude, but goes up and down gently. Is this due to less aggressive PIDs? I can easily hoover steady on 50% and be rock steady if I do this manually.

with BMP085 baro chips you see jumps of up to 2 m in the gui, while the copter is sitting on the ground. With MS5611 this is < 20 cm. Within some minutes there may be slow drifts of 2-3 meters. The rest is wind influence. Therefore and because of the very high influence of temperature changes (sunlight) the baro chip should be covered by open foam (if you can breath through it, it's the right one).

oterpoter wrote:GPS Hold:
It goes in small circle constantly. it will never be fixed at one spot. and since the BaroHold is turned on at the same time, the problem from baroHold with the copter going up and down as well, it stays within a imaginary box of some 8x8x8m approx.

The circles may have 2 reasons:
1. Deviation of MAG. Here there are sone possible problems:
- Calibration of mag
- Influence of external mag sources (power cables, power distribution).
- setting magnetic declination

2. Setting of GPS PIDs
Here it get a little bit tricky, because the actual code of EOSBandi and his documentation are completely different:

Poshold P: This parameter discribes the intended velocity in relation to the distance to WP. (typical values at my copters: 0.1-1)
Poshold I: Here documented as "This is the key to reduce (eleminate) circleing around" -> Hey, it's not used in the code at all. (maybe you can give it a try, sometimes when I look into the code, I think, most of Multiwii is somehow flying with magic ;) )

PosRate P: This parameter is, what it pretends: Do a correction proportional to the difference of intended and actual rate=velocity (typical values here 1-4)
PosRate I: This parameter integrates the error of the velocity *and* the distance to WP. (keep is quite low, typical values < 0.1)
PosRate D: This is the D parameter of PosHold and not PosRate since it is proportional of the change of the distance. In fact, it is more or less the same parameter as PosRate P, sin the the change of the distance divided by time is the velocity...
I set that to zero.

Another hint is to enable binary protocol (I didn't check, if this is supported by your GPS and the code here)

Some people here are proposing to change the waypoint radius. But this is again a piece of magic, since this parameter is *only* used to switch automatically from NAV mode (RTH) to Pos Hold mode when reaching the WP. In Pos Hold this parameter is not used at all..

oterpoter wrote:Return To Home.
I if turn this on, the copter starts to fly pretty FAST in one direction slightly OFF from the HomeBase, and ALWAYS to the left of it (it is as if it believes the Home to be rotated somehow.).

I see this behavior too, that it never flies a straight line even without wind. It is not so important at the moment, as is reaches HOME in my configuration without further accidents ;) . In your case I think is important to fix Pos Hold before trying RTH.

oterpoter
Posts: 61
Joined: Sat Nov 05, 2011 2:11 am

Multiwii 2.2 - GPS hold

Post by oterpoter »

Thx for your great reply!
I will test more!

SkyrimDragon
Posts: 36
Joined: Wed Aug 14, 2013 8:27 pm

Re: Multiwii 2.2 - GPS hold

Post by SkyrimDragon »

...................................................

hamsterrorist
Posts: 1
Joined: Sun Nov 10, 2013 12:53 am

Re: Multiwii 2.2 - GPS hold

Post by hamsterrorist »

I hope that this isn't seen as a noob post :D

3rd flight on my knock-off F450 this afternoon, in gusty conditions by the beach. 2nd flight blew up an el-cheapo XXD 2212 motor, with the replacement I was having no trouble controlling it in the wind (well, maybe the angle/acro mode was a little too aggressive for me, but Horizon mode was very stable).

GPS-wise though, I saw absolutely no change in flight characteristics when I hit GPS Hold, or RTH...nothing at all - with them on, I could still control the quad like nothing had changed.

After a 3S battery's worth of hovering and mild circuits, I plugged it back into MWCGui to check settings, etc.

I've taken a lot of great advice from this forum and applied it (though i'm still a little lost as to how Mag Decliniation affects GPS hold), and it was then that I noticed something odd.

Background: F450, 2212/1000kVA motors, Quattro 25A ESC, 3S 2200mAH LiPo, Crius AIOP v1.1, uBlox NEO-6M, MWC 2.2.

In MWCGui, under RC Control Settings, everything appears as it should when I select each option (via Turnigy 9x with appropriate settings to allow AUX1/2/3 selections). But, under the Realtime Data tab, the GPS RTH and GPS Hold statuses NEVER highlight when I select these options.

Prior to this flight, I was sure that I had everything set (reasonably) correctly...default PIDs, GPS picking up 5-7 satellites, GPS position working and pretty darn accurate.

So at this stage I don't know if it was simply minor settings that prevented Hold and RTH from functioning, or whether they were actually never selected when I flicked the switch on the Tx.

Ideas? Thanks in advance!

F4LLCON
Posts: 7
Joined: Tue Jan 21, 2014 3:45 pm

Re: Multiwii 2.2 - GPS hold

Post by F4LLCON »

Hello, I am really confused about all the different ways to calculate it..

Could someone help me?

AMSTERDAM NOORD-HOLLAND
Latitude: 52° 22' 26.5" N
Longitude: 4° 53' 22.9" E
Magnetic declination: 0° 30' EAST
Declination is POSITIVE
Inclination: 67° 21'
Magnetic field strength: 49090.5 nT

Date Declination
2014-01-21 0° 29' 47" E changing by 7.9' E per year

I don't know what to do now..
I need to change this #define MAG_DECLINATION 4.02f //(**)

Does this mean I have to 67+21*(1/6) = 14.67f?

Thank you..

scrat
Posts: 925
Joined: Mon Oct 15, 2012 9:47 am
Location: Slovenia

Re: Multiwii 2.2 - GPS hold

Post by scrat »

You must enter: 0.5f

Here you can calculate: http://www.satsig.net/degrees-minutes-s ... ulator.htm

F4LLCON
Posts: 7
Joined: Tue Jan 21, 2014 3:45 pm

Re: Multiwii 2.2 - GPS hold

Post by F4LLCON »

How did you calculate it? formula

scrat
Posts: 925
Joined: Mon Oct 15, 2012 9:47 am
Location: Slovenia

Re: Multiwii 2.2 - GPS hold

Post by scrat »

Just insert your values in this calc: http://www.satsig.net/degrees-minutes-s ... ulator.htm in the first table.

For Amsterdam mag declination is: Magnetic declination: 0° 30' EAST and if you put it in this calc...you get value for Mwii.

F4LLCON
Posts: 7
Joined: Tue Jan 21, 2014 3:45 pm

Re: Multiwii 2.2 - GPS hold

Post by F4LLCON »

Oh I see, yes I did not know which one of those numbers I should use in the calculator. So degree, minutes east. 0.5f, thanks

scrat
Posts: 925
Joined: Mon Oct 15, 2012 9:47 am
Location: Slovenia

Re: Multiwii 2.2 - GPS hold

Post by scrat »

No problem.

Jimbo385
Posts: 55
Joined: Sun Apr 21, 2013 8:00 am

Re: Multiwii 2.2 - GPS hold

Post by Jimbo385 »

I have been following this thread with great interest.

First, well done and many thanks to all the Gurus out there that have spent a lot of time teaching us novices how it all works.

I have a CRIUS AIOP v2 and am running Multiwii 2.3.

Been having lotsa problems getting GPS_Hold to work. It appears that I have not understood what needs to be done and have been treating the PIDs as if they were Roll,Pitch & Yaw and obviously getting it wrong!

Huge learning curve! It's a shame that it's all very difficult and has put me off tuning the CRIUS several times now. However, I shall persist once the weather gets good. I have set my Altitude, Posh, Posr & Navr to lower limits as a start point.

Cheers guys....

Jimbo385
Posts: 55
Joined: Sun Apr 21, 2013 8:00 am

Re: Multiwii 2.2 - GPS hold

Post by Jimbo385 »

To start with, I've made sure that Acro, Horizon then Baro are tuned in. Otherwise you're fighting a loosing battle!

So far, Acro & Horizon are dialled in and I'm happy with that.
It's only today have I understood that Baro was all over the place and PIDs were way off. I am currently on the way to sorting them out. Once done, I can then go on to tuning GPS Hold.

Cheers.

Thai
Posts: 2
Joined: Fri Mar 15, 2013 8:01 pm

Re: Multiwii 2.2 - GPS hold

Post by Thai »

I have a problem that's been unresolved for the longest time. Nobody on RC Groups had been able to help so hopefully someone can shed some light over here.

I have a MultiWiiCopter Vampier (hex) on 2.2. It flies great and pretty stable. However, the GPS hold is super wonky. It drifts all over the place and doesn't really seem like any sort of a GPS position hold. It also does not retain any sort of altitude hold whatsoever. It'll descend, sometimes shooting back up and down or just descend and hit the ground.

But the weird thing is, when I do a Return to Home, it'll return to home great and then when it reaches home, it'll hold that position DEAD STEADY. But as soon as I flip it to GPS hold, it's super crazy wonky again.

Any ideas? Something I should adjust? Replace?

speedactyl
Posts: 3
Joined: Mon Mar 09, 2015 9:48 am

Re: Multiwii 2.2 - GPS hold

Post by speedactyl »

Question..
What does the PID in GPS function mean?
POS
POSR
NAVR
just still dont understand it . The last time I gps hold it went WHEEE sideways westward.
BTW i reorient my mag cause the hk multiwii pro by defult is 90degree off . Wonder if it affects the gps

Post Reply