herein2021 is spot on about taking off near any metal, especially buried metal such as rebar in sidewalks. Remember that the compass is very, VERY sensitive. Remember also how these drones operate....the IMU tells the "brain" what is level and the compass tells the "brain" which direction is which, along with GPS coordinates, but GPS coordinates are worthless if the drone doesn't know which direction is which. Let me explain.
Lets say you take off with a compass error, but all else is working correctly...IMU, GPS, downward sensor is also working, provided there is enough light for the drone to "see" the ground and hold steady in a hover. The drone, because the compass is messed up, doesn't have the correct "directions" on what is N,S, E and W in order to fly correctly. You tell it to go north, but the compass tells the "brain" it is going south...well...guess what happens? The drone will try to go what it "thinks" is north, (by the info being sent from the compass) and because of the compass error, it actually goes south. It reads the GPS coordinates, "knows" that it must go north, so it accelerates in the direction it thinks is north, but it is actually south. Then seeing the GPS coordinates changing, it doubles down and goes faster to correct itself in the direction it "thinks" it is going to get to the correct cooridinates and viola! you get a fly away. Lets add one more factor...GPS reception. GPS tells the drone where it is in 3D space, based on the corridinates received by MULTIPLE satellites. All good right? Not if the compass is messed up. If the directions that the compass is telling the drone it is traveling in is wrong, the drone will double and triple down in trying to correct itself to go in the direction, N,S,E,W it believes it is going in, in order to match the GPS info. ALL has to work together in order for the drone to be smart enough to be able to be "smart" and move about correctly.
Lets add one more factor, again, getting back to GPS and home point. Lets say you just had a great flight, nothing wrong at all...came back home, maybe switched out batteries right away, or waited a bit and immediately took off and started flying. Lets also say that you didn't wait for the correct amount of satellites to be "seen", being that your drone always "just works" and you wanted to get in another flight. You take off and everything seems ok, but let go of the sticks and the drone just starts flying all by itself, going faster and faster in the WRONG direction? You may or may not be able to "steer" it, but the controls seem all wonky....you are probably flying without GPS...so the drone doesn't "know" where it is in 3D space and can't hold a hover. Lets also say you panic (understandable) and hit RTH...well...without correct GPS the drone will just fly off in the direction it "thinks" is correct. Another flyaway.
Lets add one more scenario. Same as above, but the last time you flew was at your favorite spot and this time you take off from anywhere else not near that spot and don't wait for home point to be updated and because you have never, ever had any such thing as a flyaway...(that only happens to people who don't know what they are doing, dontcha know!) you start your flight, but the drone doesn't respond like normal and you hit RTH. Well...if home point was not updated....the drone will fly to the last confirmed home point it has....that being the last place you flew and home point was updated. Another fly away.
Lets talk about one more thing...the IMU. Lets say the IMU is not calibrated correctly for whatever reason. When you take off and to your eyes the drone is perfectly level, lets say the not correct IMU tells the brain that the drone is "tilted" in whatever direction, and off level by 20%. Guess what happens? The IMU tells the "brain" that it needs to correct itself by tilting 20% in the opposite direction to be level. Uh oh...another flyaway.
So, Quad, mister smarty pants, why then can we fly indoors without any GPS signals, huh? Well...you have the downward sensor that reads the ground and can override everything to hold steady in a hover, provided there is enough light and contrast on the ground for the sensor to "see" the difference, allowing the drone to hold steady in a hover, despite the IMU maybe being off, or compass etc.
Hopefully you can now appreciate how critical it is to having a correct compass calibration. GPS positioning is worthless to a drone if the compass is messed up. Pay close attention to the # of satellites and pay even more close attention to any "magnetic interference" messages. No matter how "smart" these drones are, we, as pilots, need to do our due diligence to ensure everything is working and we have a safe flight. Never be in such a rush to get in a flight that you don't go through your mental check list and give the drone the time it needs after it is turned on to acquire enough satellites and stay away from launching around metal, including sidewalks. I have also had compass errors when taking off from sidewalks, so using herein2021's method of using the case to get distance away from metal is a good one.
One more that I just thought of. Lets say you take off without updating home point....meaning the drone didn't get enough satellite info to get home point coordinates. You fly out and then the drone gets enough satellite info and bam! updates home point at that spot. Guess where the drone is going to fly to when you hit RTH? Yep, wherever it last updated home point. Yet another thing to be aware of.
Wait...one more. Last one, I promise.
Why when we fly in our favorite spot where we have flown may times before, does it sometimes take 5-10 even 20 minutes for enough satellites to be acquired in order to update home point? Satellite position info (where they are in the sky) is sent to the drone via a file from the sats themselves, called a catalogue. This catalogue gets updated and can expire on the drone...(I don't know how long it keeps) If the catalogue is not current, it will need updating if you haven't flown in a while. So that means the drone will need to sit, before taking off, with good satellite reception (clear view of the sky overhead, no trees etc) in order for the latest catalogue info to be received by the drone, from the satellites. This can take some time, depending on how many satellites the drone can obtain reception from. Always, ALWAYS wait until you have enough satellites before taking off. 2 huge reasons for fly aways...bad compass and not enough satellite reception.
Hope this info helps anyone. My startup order? I start the drone first. Set it on a level, or as close to level ground, table etc as possible and don't touch it as it starts up. Then I back away, and turn on the RC. Let it connect to the drone. Not in a hurry. Then once connected, I connect the RC to my phone/tablet etc. Never in a rush. This gives the drone the needed time to acquire satellites. Once all connected, I check the app and look for any error messages, check the camera settings etc and make sure all is to my liking. No errors? Enough satellites? Then I take off and go up about 10 feet/3 meters and let it hover. All good? Home point updated? I then take off vertical and let it hover again. Check controls. All good? Then I do my flight. If the controls are not responsive in anyway at all, drone is drifting etc, I bring it down safely and turn everything off, and restart the whole procedure over again. Knock on wood. I have never, ever had a fly away with a GPS drone. OH yes, I have crashed drones before (home builds...mostly early on in my flying experience), but taking the time, knowing how complex these are in order to do automated things we take for granted, means I am never in a rush to get back in the air too quickly. Even after doing all of this, you can still have a hardware or software error and get a flyway or crash.
*as a disclaimer, any and all info above can be corrected if I am wrong, and I won't be offended in any way. Feel free.*