Tuesday, October 13, 2015

Quad build - Phase 6 (tuning)

A few days ago I burned through (not literary) 2 batteries to get about 26 minutes of flight. Almost all of that was tuning PIDs.

The RTL feature is still something not to be trusted so I did a bit of research. The first thing that yeilded a likely result is that the compass is being impacted by the EM fields being developed within the wires/distribution board. 

So why does this spiral? Well it seems rather simple:
Think about what happens when you put a magnet to a needle compass, what happens? The needle gets stuck in a specific orientation and thus is a compass failure. Something similar is going on with the electronic compass in that it locks up. But... the reason why it can sort of know heading is because of a faster routine that uses the accelerator to calculate heading. With the vibrations and algorithms used to smooth and sample the forces in all axis there tends to be drift of some type. This drift will cause the copter to do the circle that it doesn't think is happening. 

My APM2.8 board has the option to easily mode the compass to off-board. It requries 2 MUX solders seen from the 6 pads on the top-left of the board along with a jumper removal to disable the internal compass
Note the 2 solder pads that select MUX_SDA and MUX_SDL


And note the jumper and I2C port


After the "update" and a bit of re-tuning the quad now reliable RTL/RTH quite well without me needing to override auto-land.

A bit more tuning involved the auto-tune and some PID adjustments. In the end I did some light weight in-flight changes to PID values to create a stable flight. 

No comments:

Post a Comment