I know this is discussed in many places with lots of different solutions
1) resistor / capacitor as per the instructions
2) APM, RC receiver, sonar, Xbee etc powered from a seperate 6A BEC
3) tightly twisted wires to reduce noise
4) mounted on the nose away from ESC's Xbees etc.
and i still have lots of big spikes and the climb rate is constantly noisy from this.
Have a look at the log file and you will see what i mean.
I've had good success with mine:
Like your quad - somewhat similar to mine.
The signal filtering is described in the MB FAQ: http://www.maxbotix.com/tutorials.htm point 8. I used a 10K resistor.
Your home-made shielded cable sounds OK, although a USB or Mouse cable might be a little better.
However, the sonar is very close to the Optical Flow sensor and may be picking up noise from it. If the filtering doesn't work, try disconnecting the Optical sensor to see if that's the source of the noise.
I have also been having problems and have tried all the suggested filters. It holds altitude better with the sonar off than with it on. I am about ready to just take it off and give up. Are there any other brands of sonar that would be better suited for outdoor use?
Maybe the problem is the analog interface. If we could use the digital interface maybe that would help but I don’t know how to do that.
How often is the sonar input actually measured by the APM? will adding a 50ms delay change anything? it only measures every 99ms anyway.
I will give it a go with the 0.1uF cap on the apm and a 10k to start with and then the 100k to see how much difference it makes. ill see how it looks and post the logs if it makes a difference.
Shame i wont be home for about a month :(
Ok so ive changed a couple of things in my quad to try and sort this sonar out.
Ive installed a 0.1uF cap at the analogue input pin right next to the IC on the APM and installed a 100k resistor at the analogue out of the sonar. looking at the logs now i see the spikes are much wider than before. each spike is measured over 3 or 4 samples instead of just 1.
Here is a pic with the pad i made next to the IC
On to plan #59614836
I tried the outside Sonar again today with some filters and it was better. The problem was that it would get in a mode where it would gradually go higher for about a 30 seconds then fairly quickly descend back to the starting altitude. I was flying Loiter and it did hold position well – it was a nice calm morning flying over grass.
I turned off the sonar and did the same flying and it actually held altitude better with the sonar turned off. It just does not seam to be that practical for outdoor flying. I have APM2 that does have a much better pressure sensor.
Is the sonar raw data recorded on the APM or do you have to use telemetry to recoed it?
Both Baro and Sonar altitude is stored in the onboard .log files. Look in the CTUN rows, first few columns.
I had the rising problem when a wire broke off the sonar. The sonar altitude was a flat line. The log file should give you a good idea of what's happening.
100% better results now! soldered the wires directly from the apm to the sonar, because when i was trying something else I noticed there was no power going to the capacitor bank I was trying to use. so made me a bit sus if there was a bad connection and cutting power while moving.
check out the results in the log file! almost perfect, the first half is with the motors running full speed and tilting up and down at the walls to get changes in height. then where the spikes are is where i was banging the metal booms with a screwdriver to see how physical noise effected it. then the last half is with the motors off to compare.
If it wasnt so windy outside i would go and try it out.