I have read the arducopter manual and also reviewed some of the earlier forum posts and initially moved my sonar sensor (recommended Maxbotix) 3" away from the main electronics but still see too much noise for the sonar to work in Alt Hold properly, So I did some more research and think the following may be of interest to the group. I certainly hope it allows me to keep the sonar closer to the centre of my copter rather than out on an extended arm and nearer to the motors and props.
I found a simple solution from Maxbotix, that should eliminate the effects of excessive supply noise which can impact the Sonar sensor operation. Placing a 100 Ohm resistor in series with the V+ line along with a 100uF Electrolytic capacitor (6.3V +/- 20% tolerance) to ground, you create an effective filter for the sensor. This ensures that almost any noise introduced onto the line is captured and only clean stable power is supplied to the sensor. See the photo schematic below:
This combined with perhaps a shielded cable as described here may eliminate the need to place the sensor out on a long plastic arm as I have seen mentioned in another forum post and in the Arducopter manual.
The only concern I have is extending the ground plane to the sensor board and whether this may introduce other issues. For example, normally the signal receiving end ground plane would be tied to earth, But in the arducopter this is not possible being a flying platform.
Anyone care to discuss / comment the possible side effects of a floating ground between the APM and sensor acting as an antenna of some sorts if both ends are connected? In other words would connecting the signal wire shield to the GND on both the APM and Sonar (As described in the Maxbotics article) be ok? Note the postive, negative and Analogue signal would be inside the shield.
I plan to do some experimenting over the next few days and report back my findings.
One other quick question. How many people run with sensor filters enabled on the IMU shield (3 in total)? What are the cons if you use the filters? e.g some sensitivity loss in the detector / sensor?
Keep in mind that not everyone here uses the ArduCopter's electronics. There's still quite a few that use older hardware and some rigs don't even use an AVR chip.
I have added the 10ohm resister and 100uF cap, shielded cable and extended sonar mount - it is undeniable to me how much of a difference this made for the stability of my quad. Thank you for the great technical post -- this is the kind of stuff that I love!
The main reason I am posting this is to detail the sonar mount, as it may be of interest to others:
I had the identical problem with my airspeed sensor. Check here if this will help
I noticed most noise present a drop of the altitude.
I noticed in the code, the sonar reading are filter by the median value of the last 6 values (MOD_FILTER_SIZE in ModeFilter.cp):
fmode = _samples[(MOD_FILTER_SIZE / 2)];
So I made a test with 8 value and this code:
fmode = _samples[(MOD_FILTER_SIZE -3)];
It give the priority to highest value, It should ignore most drop values and some peak value. But this is only relevent if all noises engender drop values. Green Curve in the picture:
At the bigening of my test, it works perfectly, but I don't know why after fliying ~2min the sonar signal become noisy and cannot be used an more. I don't know why. I have a shieldd calbe, a filter 10µF/100Homs, maybe when the battery is getting low, or the capacitor is not charging fast enough:
I have got the sonar to work better with powering (5v) directly from the eksternal bec (not from sonar output at apm). I mesured 4,6 v from sonar output with 5,2v at apm input, I dont now how this sonar power line is constructed inside apm?
Could i ask how you connected the ubec? did you connect to the PDB or is possible to plug it inline from the existing esc bec lines. I suspect that the inline solution is flawed, i.e if there's not enough voltage coming from the esc in the first place the ubec wont be able to "add" voltage to make up the 5v, or is this separate ubec just filtering out esc noise do you think.
I intend to try both this weekend, but it would be nice to know what's tried and tested.
It's probably best if I continue my sonar noise research here.
I also have a BIG problem with sonar noise on my heli that I have been trying to fix. I have been doing methodical testing to find out what the cause is. I have the RC filter, heat, and shielded cable on my sonar, but the problem remains. So I started by shutting down all electrical noise sources and testing, and found that my problem is NOT a result of electrical noise or EM radiation at all. My problem is 100% related to vibration.
My final test proves it. I simply disconnected my sonar from the frame and mounted it on some foam. I ran the heli with the tail blades installed, but the upper head section removed. I tested response by moving my hand in and out of the sonar beam. Then I touched the sonar mount to the frame again, and you can see what happens in this single image. Not only does the sonar get noisy, but the distance it measures (on average) in inaccurate.
Hi Robert its been awhile since I posted in this forum I started, mainly due to good break from work and holidays. The issue you describe is an important variable to note when sorting out possible sonar noise interference sources. I have been looking at this as well. I should note that the sonar we currently use for the arducopter (MB1200 XL-MaxSonar-EZ0) is the most sensitive from the Maxbotics range and so you may encounter more than just electric interference. I mounted my sonar on soft rubber gromets to decouple the vibration effects with some positive results. Another thing to keep an eye on is the beam itself and make sure you have a clear path to the sensor. For example, I found I had my sensor too close to one of the landing legs. A good test to run, be it a little more work, is to use the serial (rs232) port on the sonar and hook it up to your PC this way you can see realtime sonar signaling rather than after the fact in the APM logs. There is a link off the sonar support section on the Maxbotics web site to download a simple Windows program to display the sonar data via serial connection. At the moment I am testing a few sonar alternatives which have been provided to me by the manufacturer for field testing. One in particular has the same range and beam characteristics but not the extreme sensitivity of the MB1200 XL-MaxSonar-EZ0. When I have definitive data and results I will post this.
As you have found the sonar is not the easiest of sensors to get right. I changed my shielding wire at one point
to reduce the bulk of the cable and took a step backwards. Its all fun but also frustrating at times.
When the sonar works fine at first, then stops working, that was found by a lot of people to indicate that sonar heat was required.
I already used some soft rubber (servo bushings), but it's not enough in my case.
So here's what I came up with today.
The square aluminum is exactly 1x1x1 inches, and I had to do this because of the odd shape of the sonar board, with the square thing sticking out the back, plus the RC filter resistors I glued on the backside, etc. The blue stuff is "Moon Gel" from a music store, it's the softest material you'll find anywhere. I've made a sandwich with the middle layer being the frame mounted bracket. There is a single mounting bolt, and the hole for the bolt in the frame bracket is quite large, so the screw doesn't touch at all. The top piece of aluminum is a clamping plate so I can sandwich that frame bracket. The other metal squares on the outsides are lead plates I added to try and get the natural frequency up a bit. Kind of a double edged sword. It helps get the NF down away from the rotor headspeed, but it makes low speed shaking worse.