LibrePilot Forum

Users => Applications - Autonomous Flight => Topic started by: Johnnyboy030 on December 04, 2017, 11:04:47 pm

Title: Revolution with GPS HELP!!!!
Post by: Johnnyboy030 on December 04, 2017, 11:04:47 pm
Hello everyone.

I recently built a quad and i need some help with the GPS and Mag. I bought a 500mm frame, i am using Revolution as FC, RadioLink SE100 GPS module, QBrain 4in1 ESC and Multistar 700Kv motors. I will post the links for everything below.
So when i had build with no GPS everything was fine. I balanced the pros just fine and even from the first flight it was perfect. No drifting, no vibrations no nothing. Just spot on. I believe it is also important to say that when i used the vehicle setup wizard i chose the current tuning as model and then i left everything in default and i was very surprised with how much stable the quad was. Later i also tested different modes (AttitudeHold, Vario etc.) with no problems and no tuning.

After that i wanted to go to the next level by adding a GPS. After reading in this Forum and on LibrePilot Wiki i bought from HobbyKing the RadioLink SE100 GPS module with Mag. I had to change the connectors a bit to fit to the smaller ports on the Revo and i placed the GPS on the frame with no mast. I didn't place it on the mast because the frame is big and i believe i have no interference. Then i began to calibrate the sensors. I was quite successful from the start with the aux Mag between 0,2%-1% error. Yesterday i went for a test flight to see what that GPS can do. It was a DISASTER. When i arrived to the "test" field i powered everything up and connected the opLink to the laptop to see the data. It quickly locks 17 sats but the Mag was to 2,5% error. After that i tried to fly. I tried to fly three times and three out of three the quad started to climb with nose up. At the fourth try i applied throttle more aggressively and more instantly at around 50% and i managed to get the quad of the ground. After that it started to drift relative fast backwards, meaning the motors to the nose was spinning more quickly. I got frustrated and i decided to change from GPS Outdoor to Basic Complementary just to play a little. It was a little better but still the nose wanted to go up first. I successfully take it off and when i put it in AttitudeHold everything started to falling apart. When i changed to AttitudeHold i was around 8 meters above ground. The quad gone up and dove very aggressively +- 3 meters i believe and then i landed it.

So. Before i installed the GPS everything was perfectly fine. After the GPS everything went sideways. If i had problems only with the GPS i would search it more but now the whole quad is completely uncontrollable. Also after the first mag calibration after a while the error goes up and up around 8% and stays there. I recalibrate and it happens again. The only calibration i haven't done is the thermal, because to be honest i am scarred a little. Unfortunately i haven't enable logging at the GPS test flight so you can see what's going on. I find it very difficult to calibrate that stupid aux Mag and it keeps need to calibrate every time.

Please help me because i am ready to throw everything away and buy different FC and GPS.   
Title: Re: Revolution with GPS HELP!!!!
Post by: Johnnyboy030 on December 04, 2017, 11:09:03 pm
I forgot to post the links:

https://hobbyking.com/en_us/q-brain-4-x-25a-brushless-quadcopter-esc-2-4s-3a-sbec.html?___store=en_us

https://hobbyking.com/en_us/turnigy-multistar-2814-700kv-14pole-multi-rotor-outrunner.html?___store=en_us

https://hobbyking.com/en_us/s500-glass-fiber-quadcopter-frame-480mm-integrated-pcb-version.html?___store=en_us

https://hobbyking.com/en_us/radiolink-m8n-gps-apm-pixhawk-cc3d-etc.html?___store=en_us
Title: Re: Revolution with GPS HELP!!!!
Post by: TheOtherCliff on December 05, 2017, 01:47:49 am
Is your GPS/mag mounted with arrow or whatever pointing forward?  It is critically important to mount it pointing in the correct direction.

Please post your settings file (uav file) from file -> export uav settings

When you go to Attitude->Magnetometer you should have:
mag usage: auxonly
mag type: flexi

your aux mag orientation should be 0,180,0 or 180,0,180

and look at the blue axis bars on the right side as you rotate the model around.  Numbers there should stay very low, like +-2 or so?

and when you look at Flight Data page, the PFD (upper left) might jitter a tiny amount, but not be flipping all over the place.

and it looks like this GPS does Ublox protocol.  I have had problems trying to get NMEA stable use Ublox protocol, not NMEA.
Title: Re: Revolution with GPS HELP!!!!
Post by: Johnnyboy030 on December 05, 2017, 11:21:50 am
The GPS is mounted correctly and the three bars are at zero with 0,180,0. In the PFD tab when i am outdoors everything is perfectly fine and stable but indoors i have some tilt problems but i believe that is to be expected. The GPS is indeed Ublox and is working great with the sats.
The uav file i will post is with I2C disabled (but i am not sure) because i was trying some things and the second one is after i reset the whole board but i haven't the time to calibrate the mags.
Also after i reseted the board i have some strange behaviour from the motors, like at very low throttle input they are turning fast. Not very fast but fast. At the calibration the starting point of the motors is around 1380 μ/s
Title: Re: Revolution with GPS HELP!!!!
Post by: Johnnyboy030 on December 05, 2017, 06:49:24 pm
Also today i performed a indoor test flight after the reset of the FC. Everything was perfectly fine. The quad even indoor with the ground effect was very stable and with no sudden moves and no drift. I believe given the results that when i go outdoor the flight will be excellent.
The one thing i can't understand is the mag calibration. Let's say i calibrate the mags outdoor in one random location and then i go to another location to fly it. Why when i change locations the mag error goes through the roof? I am talking about 5-10 km between the two locations. Should i calibrate the mags every time i go to fly the quad?
Title: Re: Revolution with GPS HELP!!!!
Post by: f5soh on December 05, 2017, 08:15:48 pm
Calibration should be ok when you move to another place.
Some thing to consider is calibrate Mag with all the accessories and battery same as when you do the flight.

A simple Lipo saver can disturb the mag and if mounted differently can change all the Mag reading.

It should be great if you can post some log files.

Edit: About config file you should set the mag usage to "AuxOnly"
Be sure the auxmag/GPS is away from strong currents and all the magnetic sources when you calibrate. (Gimbal, lipo saver, buzzer....)
Please post pictures for your setup.
Title: Re: Revolution with GPS HELP!!!!
Post by: Johnnyboy030 on December 05, 2017, 09:57:03 pm
Calibration should be ok when you move to another place.
Some thing to consider is calibrate Mag with all the accessories and battery same as when you do the flight.

A simple Lipo saver can disturb the mag and if mounted differently can change all the Mag reading.

It should be great if you can post some log files.

Edit: About config file you should set the mag usage to "AuxOnly"
Be sure the auxmag/GPS is away from strong currents and all the magnetic sources when you calibrate. (Gimbal, lipo saver, buzzer....)
Please post pictures for your setup.

Thanks for you advice. Always i am selecting the aux mag and also i now all about how to calibrate and how to install the gps module. But besides that even if i do everything right when it is time to fly everything are bad. I need ideas expect the usual.
Title: Re: Revolution with GPS HELP!!!!
Post by: Johnnyboy030 on December 05, 2017, 10:19:27 pm
I added the third layer you see in the photos to get extra space because of the gps. The only thing that is somewhat close to the gps is the Lipo checker that has two beepers on it, but i only use it to check the battery on the ground and not while i am flying.
Title: Re: Revolution with GPS HELP!!!!
Post by: f5soh on December 05, 2017, 10:25:24 pm
You need to put your GPS/AuxMag in a mast, away from Magnetic sources.
Better for Mag and also GPS receiving, this is too close from others components.

Quote
Lipo checker that has two beepers on it
There is magnetic material inside the two buzzers so put away while calibrating or flying.
Title: Re: Revolution with GPS HELP!!!!
Post by: Johnnyboy030 on December 05, 2017, 10:53:00 pm
You need to put your GPS/AuxMag in a mast, away from Magnetic sources.
Better for Mag and also GPS receiving, this is too close from others components.

Quote
Lipo checker that has two beepers on it
There is magnetic material inside the two buzzers so put away while calibrating or flying.

Are you sure?? The frame is really big. Also there is not enough electricity through the wires to create so much big magnetic fields. But i will try it. I will change the position of the checker to the back of the quad and add the mast
Title: Re: Revolution with GPS HELP!!!!
Post by: f5soh on December 05, 2017, 11:03:02 pm
Quote
Are you sure??
Yes.
The cause of magnetic fields is not 'electricity' but current and how many space there is between wires (so solution can be reduce space by twisting wires)
Battery can create magnetic fields and can vary from one battery brand to another.
Power PCB where you connect power wires can create trouble as well.

One test you can do is monitor the Mag using the scope tab and Magnetometer scope (enable the Window > Enable the "Edit gadgets mode" to choose scopes to display) and move your checker around the Mag.
Title: Re: Revolution with GPS HELP!!!!
Post by: Johnnyboy030 on December 05, 2017, 11:08:37 pm
Quote
Are you sure??
Yes.
The cause of magnetic fields is not 'electricity' but current and how many space there is between wires (so solution can be reduce space by twisting wires)
Battery can create magnetic fields and can vary from one battery brand to another.
Power PCB where you connect power wires can create trouble as well.

One test you can do is monitor the Mag using the scope tab and Magnetometer scope (enable the Window > Enable the "Edit gadgets mode" to choose scopes to display) and move your checker around the Mag.

Because i know some things about magnetic fields except the beeper i don't believe the wires from the motors are the problem. Nothing else i close enough. But thanks again and i will try tomorrow to fly and get back with the results.
Title: Re: Revolution with GPS HELP!!!!
Post by: f5soh on December 05, 2017, 11:12:29 pm
If you are sure about magnetic fields and power wiring, don't try :)
Title: Re: Revolution with GPS HELP!!!!
Post by: Johnnyboy030 on December 05, 2017, 11:45:51 pm
If you are sure about magnetic fields and power wiring, don't try :)

I will try because i can't be 100% sure  ;)
Title: Re: Revolution with GPS HELP!!!!
Post by: TheOtherCliff on December 06, 2017, 12:52:22 am
At the calibration the starting point of the motors is around 1380 μ/s

That is very high and is probably exactly this problem.  After ESC calibration you should do ESC neutral setting.  Most people find that about 1070us is a good value.  I recommend using about 20 higher than "good smooth low value" to help when the ESC gets warm and the timing changes.
Title: Re: Revolution with GPS HELP!!!!
Post by: TheOtherCliff on December 06, 2017, 12:58:49 am
Because i know some things about magnetic fields except the beeper i don't believe the wires from the motors are the problem. Nothing else i close enough. But thanks again and i will try tomorrow to fly and get back with the results.

Standard LiPo alarms use small speakers that have real permanent magnets in them (not piezoelectric).  That is a real problem.  You can test it with a compass or by watching GCS scopes or PFD/HUD as you move one of these alarms close to and around the mag sensor being used.
Title: Re: Revolution with GPS HELP!!!!
Post by: Johnnyboy030 on December 06, 2017, 09:20:24 am
That is very high and is probably exactly this problem.  After ESC calibration you should do ESC neutral setting.  Most people find that about 1070us is a good value.  I recommend using about 20 higher than "good smooth low value" to help when the ESC gets warm and the timing changes.

I am a little confused. The neutral setting is when the motors are starting with the minium throttle apllied correct? No matter what i do the motors don't spin at any lower value. Can you give me specific instructions what to do?
Title: Re: Revolution with GPS HELP!!!!
Post by: f5soh on December 06, 2017, 01:59:31 pm
Esc calibration (https://librepilot.atlassian.net/wiki/spaces/LPDOC/pages/12058743/ESC+Calibration) page

https://www.youtube.com/watch?v=--OSokHSzC8
Title: Re: Revolution with GPS HELP!!!!
Post by: Johnnyboy030 on December 06, 2017, 03:05:51 pm
Standard LiPo alarms use small speakers that have real permanent magnets in them (not piezoelectric).  That is a real problem.  You can test it with a compass or by watching GCS scopes or PFD/HUD as you move one of these alarms close to and around the mag sensor being used.

Do you believe that the alarm can also have negative effects on the other sensors of the cc3d? I mean the gyro, baro etc. I went again today to fly the quad (without GPS) but when i switched to auttitude hold i had very big differences again from the initial altitude when i activated the mode. Also it is important to say that it was a sunny day but with low temperature (~13C) and it was a little bit windy. The stupid thing is that i forgot to enable the logging so i could send the file to you. Next time i guess.
Title: Re: Revolution with GPS HELP!!!!
Post by: f5soh on December 06, 2017, 04:12:32 pm
Baro can be affected by sun light and propellers burst.
You may put some open-cell foam above the barometer sensor.

Some Revo or Sparky2 has issues with regulator (CC3D do not have baro sensor), introducing very big spikes to the pressure/barometric sensor.
Take a look here: Altitude Hold (https://librepilot.atlassian.net/wiki/spaces/LPDOC/pages/12058671/Altitude+Hold)

Please do not quote all the previous posts and keep the thread easy to read.
Title: Re: Revolution with GPS HELP!!!!
Post by: Johnnyboy030 on December 06, 2017, 06:53:47 pm
I bought the cc3d with a case and when i opened it i saw there was already foam applied to it. Also i put it under the first layer of the frame to protect it from the sun. Should i replace the foam with my own? I just can't understand whats going on with the attitude hold. It was working great and now it doesn't. The only thing i can think of is the thermal calibration. When i first started to fly the temperature was between 28~35 C and now is between 10~15. Can this cause the barometer change it's readings?
Title: Re: Revolution with GPS HELP!!!!
Post by: TheOtherCliff on December 06, 2017, 07:59:33 pm
To be clear, CC3D is old FC without baro and can't use GPS flight modes.  Chinese sellers have corrupted the name to mean everything so they can get people to look at ads.  "Revo" is a Revo, not a CC3D.  :)

If it already has dark foam over it then bright sun probably isn't the issue.  For baro and AltitudeHold/Vario, the next probable reason is prop blast as @f5soh said.

Generally, any amount of thermal calibration helps, not hurts, but there is an issue that you should redo gyro calibration after thermal calibration.  I doubt it causes your issue.

Does it fly well in Attitude mode with Attitude->Settings->AttiEstAlgo set to Basic (must remove GPS flight modes from switch setup to do this)?  If it flies well in Basic, but not INS13, then the problem is very probably a mag (not level) or baro (up and down) issue.  I would research this way to narrow it down.

Work your way up starting with Attitude mode in Basic, then Attitude with AltitudeVario (thrust mode at bottom of page) in Basic (take off in Attitude mode / Manual throttle), then Attitude / Manual throttle in INS13, then VelocityRoam in INS13 (take off in Attitude mode).

For anything mode that uses baro or mag (Altitude Hold/Vario thrust mode or GPS flight mode or basic mode with GPS Assist) it is required (highly highly highly recommended) to take off in Attitude mode with manual thrust.  It won't even arm in a GPS mode.
Title: Re: Revolution with GPS HELP!!!!
Post by: f5soh on December 06, 2017, 08:14:08 pm
There is no issue with gyro because there is no relation between vertical estimation / altitude hold and gyros.
Anyways Gyros are initialized / zeroed every time the board is armed if settings are keep as default.

Uncalibrated Accelerometers can add a little error to altitude estimation but not like you describe.
Thermal calibration helps for long time drift while the board warm.

Double check baro scope like displayed in wiki page linked above.
If stay within one meter, it should be fine.
If big jumps, you may need to fix the regulator like described in same wiki page (https://librepilot.atlassian.net/wiki/spaces/LPDOC/pages/12058671/Altitude+Hold).
This issue may be fixed/tested fist using Basic fusion algorithm, Attitude stabilization and AltitudeHold/AltitudeVario.
Title: Re: Revolution with GPS HELP!!!!
Post by: TheOtherCliff on December 06, 2017, 08:50:22 pm
I do thermal cal very carefully.  FC packed in a box with towels on top to press it to bottom of box to avoid motion.  Box sitting firmly on a stand and heated with a light bulb.  Temperature allowed to go to 65C+ because that is what it can get to inside quad dome in summer time.

This user seems to be trying to set up GPS flight modes.

Each time, after thermal cal, the gyro is a bit off.  I have to do gyro cal after thermal cal.  Picture (gyro quarter) shows slightly miscalibrated gyro after thermal cal.  The large square error is during the gyro cal.  After that you still see the error until you press Save.  So the beginning of the gyro 'scope' is after thermal cal (about 0.6 deg/sec error) and the end is after gyro cal and Save (more like zero error).
Title: Re: Revolution with GPS HELP!!!!
Post by: Johnnyboy030 on December 06, 2017, 09:19:00 pm
First things first. I have bought the Revolution with integrated oplink from hobbyking. After the reset of the board i went today for flying. I only fly in Basic for now but through the setup i have activated the gps to main port and the mag to i2c, but i don't use them on flight. Also i added AltitudeHold and AltitudeVario as flight modes 2 and 3. The first flight mode is on Attitude and Manual Thrust. So when i tried today to fly the quad was good but not perfect. Then after a while i decided to switch to AltitudeHold to see how it behaves and again as the last time i had major differences at the height so i grounded it. The problem is that i am alone and i can't see at the same time both the laptop and the quad as it flies.
The second thing i want to tell you is that from my initial build of the quad i changed it a bit. The first build was with the FC as it is now and the ESC at the top layer of the frame. I believe that i maybe had the problem with the baro before but because of the presence of the ESC on top of the ESC maybe the ESC was absorbing the air currents generated from the props. I will try on some point to fly with smaller props, maybe 10', because those are 12' props and are really big.
About the capacitor on the board. Will i cause problem if i remove the capacitor anyway? Because on the wiki page says better without it that's why i am asking.
Finally can you please tell me how to enable the logging of the sensors because i tap the start logging but then nothing is being recorded.
Thank you in advance for all the tips both of you gave me so far.
Title: Re: Revolution with GPS HELP!!!!
Post by: TheOtherCliff on December 07, 2017, 04:14:18 am
If your quad is very weak it needs more than 50% throttle stick to hover.  If it is very strong it needs less than 50% throttle stick to hover.  AltitudeVario always hovers at 50% stick.  Switching from manual to AltitudeVario does require changing the throttle stick for this reason.

You need to use correct props.  If 10 inch are correct then 12 inch are too big and that can cause strange problems.  If you just hover for a flight and afterward the motors are too hot to hold, your props are too big.

You must get prop blast off of the baro.  Some have used a piece of paper towel cardboard core to make a chimney for testing at least.

Test the baro altitude noise as discussed in the baro thread.  If you have about 1m or less of noise it is OK and I would leave the capacitor on it.

Tools -> StartLogging (and select a name and place for the log file) is all you need to do for logging.  Generally all the sensors you need will get logged this way.  Stop the logging when done.  Of course you need an OpLink RF connection or USB connection to get telemetry to log.

To play back, select "Logfile Replay" in the "Connections:" at lower right of GCS window.  Then press Connect and it will THEN ask for what file to play back.  At this point, everything in the GCS moves just like when the log file was recording.

During live or playback you can look at the Scopes page to see real time graphs of the data.  Enable Window->EditGadgetsMode and change the window panes to be what you want to see. Tools -> Options -> Scope is where you can add new things to view or change the parameters of the things you watch, things like the line represents 30 seconds or 30 minutes...
Title: Re: Revolution with GPS HELP!!!!
Post by: Johnnyboy030 on December 07, 2017, 08:00:27 am
My quad is powerful, i take off at about 25%-35% depending on the weather. Also i tried again to calibrate the motors using the video you provided but again my neutral speed was around 1190.
I undestand now how to replay the logs. I will attach two replay logs with my indoor tests. It is small flights and i haven't engaged any flight modes. But the curious thing as i was replaying the logs is that the baro keeps at zero. Even indoors shouldn't the baro had read at least some small difference between the ground and the flying altitude inside the house that was more or less 2 meters.
Title: Re: Revolution with GPS HELP!!!!
Post by: Johnnyboy030 on December 07, 2017, 11:38:16 am
theOtherCliff you were right. I removed the battery checker and then i calibrated the mags as shown in the video in librepilot wiki. After that i tried what you have said and i tested the checker by getting it closer and further from the mag and it is clear now that this was the problem. As i move it closer the error percentage was going up to 100% and when i move it to the location that was installed on the frame it was around 35%-45%.
I got so excited that i flew it indoor after activating the INS13 Indoor. It flew very well with little problems but i got injured during the flight. For some reason the drone reacted somewhat unexpected and was going straight to my neck but i put my hand and i have now a very nasty and deep cut to my middle finger. So deep that i lost a decent amount of blood and i did some stitches to stop the bleeding. So please tell everyone once again to stop do stupid things inside their homes.

To sum up i am happy enough about the resolution of the basic problem with the mag, but i need help to resolve the problems with the modes that are using the baro sensor and then i will proceed the gps modes outdoors of curse.
Title: Re: Revolution with GPS HELP!!!!
Post by: TheOtherCliff on December 07, 2017, 04:56:56 pm
Thank @f5soh about the lipo alarm speakers.  He was the one to show me about them when I was assuming they were piezoelectric buzzers.

I have never used INS13 Indoor although it should be fine.  I always use Basic or Outdoor.

Sorry about your finger.  I have been cut badly too and it isn't fun.

Look at baro scope.  You may have to make a baro scope in tools->options->scope.  Important to disable "everything baro" except for baro altitude.  Auto ranging that includes others will make range too large to see altitude changes.