Ok, here is another problem Ive spotted in the mind field of hardware issues and for people who continually bang their heads trying to fix them through PID tuning. .
If you have a housing that is covering over all of your electronics such as a plastic container,.. then when you descend or ascend quickly the pressure inside the container changes and gives your barometer an false reading.
For example if you descend quickly the pressure increases inside the container making the barometer think that you are descending faster than you actually are. So the APM will try to compensate this out and try to increase the throttle and this probably cause a bouncing behavior some people are finding happens .
Some may argue that the barometer cant be this sensitive, but I beg to differ because the pressure variation it can sense for the pressure variances in altitude that it works off is very fine. The pressure change inside the container even for horizontal flight will be enough to for it to sense the changes of pressure in the container.
This also includes pressure zones around the incoming and out going air stream around the props if they are to close to the container or even if you have an open center frame the pressure zone around the props can possibly still affect the barometer
I'm considering some fixes for this such as a tube that has a H tube branch at its end and that sits above or below the center board.
I would be interested to know what others view and ideas are on this. .
Of course i'm sure you know on the APM1 that a little piece of foam is recommended to cut down on direct wind affecting the baro although I realise this is not exactly what you're talking about. I'm not sure if we have the same recommendation for the APM2 or not..it uses a different baro and it's under the daughterboard so harder to get to.
I like your theory, I suppose it's possible to test what happens by putting your quad high up, then drop it quickly and see how the baro reacts. Repeat that test three times and you'll probably have enough evidence to show whether it's true or not.
If it's just brainstorming you're interested in I can offer some thoughts. I just received my apm yesterday so please forgive my short comings with the knowledge of the apm, I'm still going through library's and such.
My first thought would be to clean up the container but from here your right the aerodynamics of sinking, raising and even horizontal movement would still effect the sensor.
From here I would probably approach the problem with trusty math. For every enclosure the pressure differential would be different however I would suspect that the barometric error would be predictable.
I would suggest doing a number of raise and sink tests recording the barometric reading compared to that of the gyro.
With no apm influence get the craft to say 100ft, start recording, then at a consistent rate: sink, wait, raise, wait, and repeat. After 3 or 4 repetitions I would wager that your numbers would produce a consistent pattern in the aerodynamic affects of your craft on the barometric sensor. using the pauses as a reset between the gathered data
Once you know what to expect from the sensor you can develop error correcting based on the gyro data and such. I've used error correcting data with great success but again nothing within the APM Environment. I'd love to go test this out lol, The best i can do is refresh my order status page :(
Hope this helps!?!
Hmm I'd try the H tube before all of what i suggested. I'm sure you have other aerodynamic issues with a pipe on the high pressure side of the craft to routing to the low side of the craft... I wonder if you sealed the container then run a tube to the side of the craft, say an inch off the side, and away from major prop wash would clean up any issues
What draws me to such conclusions is when I see in depth discussions going on about PID tuning tor try to remove certain behavioral anomalies, but those anomalies aren't happening to many other flying the same software, then I feel there is definitely an issue on hardware that needs to be addressed rather than trying to tweak the software.
@Randy, yes I am aware the foam is for wind affect ,and this wont help with pressure anomalies.
@Robert, yes I agree that a hardware fix would be the best approach to start with.
I'm also going to fit my paragliding vaiometer to the copter to do some testing as well and with and without the cover. This variometer has an addible alert as pressure changes as well and I can record the data and down load it to a graph. I can also use this to find where there are pressure zones ad dead zones around the top bottom and sides of the copter while suspending ti on my test flight rig. Then Ill know where is the best place to have the H tube positioned.
Randy, in the tuning "Graph This" box which one do I tick to see the live feed for the barometer?
"alt" gives you the final altitude..this is actually a mixed baro and sonar but if you're above 4m it'll be 100% barometer. Of course you could disable your sonar using the missino planner's hardware set-up screen just to be sure.
What also might be of interest is the "press_abs" and "temperature" which are the input into the altitude calculation.
I dont have the sonar connected to this rig yet so alt would then be only reading from baro I suppose? Will it read below 4m? . Does GPS have to be locked in for alt to read? What does press_abs read from?
Yes, the alt will be completely baro then. It can show below 4m..in fact, it can show a negative altitude!
Which is not as crazy as it sounds because you could fly below your home altitude say you started your flight at the top of a hill. Also the baro has a "random walk" type behaviour..so it can wander around by a meter (or quite a bit more) over time.
No need for the GPS, it's altitude is completely ignored at the moment.
Even though I see no reason why this would affect it, it seems like temp is being sampled too often according to the comments in the code, if anyone can give me an explanation on this I would greatly appreciate it
Unless your box is sealed it can't be interfering with the barometer. The volume of air being exchanged is so small that even a leak a little bigger than a pinhole would be plenty for the small pressure changes experienced.
So unless you have a sealed case with all wires in and out also sealed with silicone or hot glue this can't be your problem. You'll have to look elsewhere for what's going on. I'd guess temperature or inertial effects.
I see what you're saying. The pics didn't load for me earlier for some reason.
I never figured people would be designing enclosures this way.