After three unsuccessful attempts at finding a mechanical explanation to this problem I've decided to post here to see if anyone has encountered a similar problem and what they found to be the cause.
- This hexa is rather large and powerful, 900mm between opposite motor centers, 370kv motors, 1555 props, 6S 11000mAH battery. The frame is flying in the + configuration.
- The APM (2.5 running 2.9.1b) is almost on top of the CG but weight distribution isn't perfectly symmetrical as a second 3S 2600mAH battery is installed next to it so there is a slight Left/Right imbalance.
- The frame flew perfectly level and responded well to throttle but would spin continuously as soon as it would lift off the ground.
- Default PID settings were used for the first flights. THR_MIN was lowered to 50 as the default idle speed seemed a bit high.
- At first motor misalignment was thought to be the cause. Very slight corrections were necessary to straighten them out but I doubt this was the cause as sometimes the frame would spin CW and sometimes CCW without any physical readjustment.
- The initial flight was done with manual magnetic declination (evaluated at -16.4140° in my area) the following flights were performed with auto declination with the same result.
- Magnetometer calibration had been performed previously but was repeated between flights 2 and 3 with the same result at flight 3. Calibration was performed outsides and far from any metal or strong magnetic fields.
- Unfortunately CTUN and RAW logging were not taken during those flights so I don't have any much data available for analysis.
My current guess is that the default PID values are probably too high given the frame's highish power/weight ratio. I think I will start by setting RATE_YAW_I = 0 and lowering RATE_YAW_P to see how the frame behaves and go from there.
Tie or weight the aircraft down so that it can't lift off. Does the heading in the APM change as you throttle up? If yes, then you have an ESC power wire too close to the magnetometer. If no, then I am out of guesses.
Check to make sure your TX is in a mode that has only one APM output change with one TX stick movement (radio calibration). If you have more than one, you may be in a Helicopter mode on your TX.
Did this aircraft develop the issue after flying well multiple times or is this a 'first flights'/maiden problem? If a first flight issue, there is no shame. I didn't have several things right on my quad before a successful maiden flight. There are many things to get right.
If you are flying in Stabilized mode, none of magnetometer values matter.
If you know how, post the logs here also, it could help.
Copper does nothing to filter the compass from magnetic fields generated by high current. Since copper (and aluminum) are themselves not magnetic materials, they are as transparent to magnetic fields as glass is to light. A bit of Mu metal will help, but the best shield is distance. Going from 1cm to 2cm drops the magnetic influence by the square root (roughly).
No amount of tuning can compensate for a compass that is influenced by the high current of the ESC and motor circuits..
TX is using a custom model not the default trad heli one. Both the channel outputs monitor on the TX and radio calibration tab in Mission Planner confirm that the channels are moving individually and not in any mixed mode so I think all is ok on that front.
This was indeed a maiden flight and there was no shame attached. Just fun!
I currently lean towards Stephen's explanation of high current wires disrupting the magnetometer readings.
As mentioned previously, my logs are pretty terse at the moment so there isn't much in there to go around. As soon as I get new props however, I'll make sure to add CTUN and RAW to have some numbers to chew on.
Thanks for your input!
I agree with you. When I first powered the APM all was fine on my bench but when I powered the ESCs (I have separate power sources for motors and electronics) I noticed that the GPS was not longer getting a fix. I added the copper layer on top of the ESC and it apparently fixed the problem but I think it did so only because it also moved the GPS further away from the ESCs.
I found this foil which also appears to be Nickel-Iron: http://www.lessemf.com/mag-shld.html#276
I might order a foot or two of it if the BATTERY / FRAME/ ESC+PDB / APM+BATTERY+GPS+RX sandwich becomes too thick...
I was able to perform a few more tests today after moving the APM further away from the PDB. It now lies approximately 2 inches above the high current wires going between the PDB and ESCs. I have ordered some MuMetal foil which will eventually go under the APM but it hasn't arrived yet. However my latest tests seem to indicate that magnetic interference from the PDB and cabling causing erroneous compass readings isn't the cause of the problem. I've monitored the compass readings in MissionPlanner and they seem to remain steady even when I push the throttle up so I doubt this is the cause of the problem.
I've added some logging information to my latest flight attempts and was able to note that under all ATT packets the YAW and YAW NAV values, which I assume are the output values, were constantly stuck at around 22000 regardless of the YAW IN values. The only moment when the YAW values dropped was when I would completely kill the throttle and the vehicle would fall back to the ground but as soon as the vehicle ould touch the ground the YAW values go back up to 22000.
I brought the RATE_YAW_P parameter down from 0.20 do 0.15 to see if it would lower the YAW output but instead it went up to around 34000 !? I was expecting the default gains to be too high not too low given this vehicle's power. The logical course of action would be to push the RATE_YAW_P up further to compoensate but I would like to hear what others have to say before doing so.
What can cause the YAW output to go so high without any input?
Found the problem... Wrong spinning orientation on all motors. Even though the props were all pushing air down and the hexa was indeed flying the APM was expecting the motors to be spining in the other direction so everytime it tried to correct for any yaw error it was actually amplifying the error hence the ever accelerating spin. Contrary to what the first image on this page suggests, motor 1 of a hexa or octo should spin CW and have a pusher prop. If you scroll down a bit on this same page you will see the correct configuration.
Thanks to everyone for all the suggestions!
Wow, that is exactly what I am experiencing as well….
I was wondering if you had this configuration…
Here is my problem… similar...
I believe I had motor 1 in front as opposed as to the right as in your config but the effect would be the same if you committed the same error I did.
Make sure your motor rotation directions, prop selections (push or pull) and ESC polarities are all in line according to what the APM expects. Motor one MUST be spinning CW when you push the throttle up.
Even if all your props are turning in alternating directions and you feel that they are all pushing air down doesn't mean that they are spinning as the APM expects them to.
I believe the APM creates slight rotational speed differences between the motors to offset the global moment of inertia in one direction or the other. If the props are not spinning in the direction in which the APM expects them to when it tries to shift the moment of inertia in one direction it will result in motion in the opposite direction. So the yaw error actually increases and the APM keeps correcting in the wrong direction. As a result the vehicle spins continuously in one direction.
Hope this helps!
Hi Tobie, this is the case for me as well… I am going to endure the shame and fix the problem.
Thanks for your post.. made me see the light.. although I got some really good Log experience while trying to debug the issues.
It's great to share both problems and solutions!