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?
There has been quite a bit of discussion about sonar noise and placement including the recommended filter. I've tried the filter back in the July with no help and I'm now mounting 3" away with good results with a shielded cable and no power filter. Many different outcomes have been observed by builders and it is a challenge to get clean results back from the sonar.
This gives me yet another data point to consider. Much appreciated. I have found a 4 core shielded cable which is reasonably thin so this will allow me the ability to have the Signal (AN, V+ and GND wires inside the Shield. I did also look at altering the signal sample rate to decrease the noise impact but I think this might have negative consequences given the design of the APM.
That's exactly what I did. My sonar is @ 3" away mounted on the the bottom of the front left leg/arm.
The filter looks to be a 100Hz LPF first-order passive. A bit curious why the electrolytic is used versus a standard ceramic?
You may be able to use the copter's metal support arms in place of an Earth ground, but I'm not sure how much that will help.
And as far as passive filters goes, they're not ideal, so if you use them you'll loose a bit of sensitivity in your pass band (in this case from 0 to 100Hz) as your target frequency gets closer to the cutoff frequency. So a 99Hz signal's power is reduced by a little less than half and a 101Hz signal power is reduced by a little over.
Active filters can give you a more ideal response and flat pass-band, but they increase circuit complexity and power consumption...
Filtering the power supply will not have an effect on the frequency response of the output.
If you have a MB1200 XL-MaxSonar-EZ0, a 10 Ohm resistor was recommended to me by Maxbotix. For me a shielded cable and a power filter didn't fully solve the problem, I still get intermittent interference. My sonar is 12 cm from two ESCs (situated between them, ESCs are on the arms). My next addition, for which I haven't yet found a suitable light-weight foil for, is to enclose the module itself and connect that without any gaps to the cable shield, which is only connected at the APM end. A fully enclosing conductive shield ought to help by reflecting and/or absorbing the effects of the magnetic and/or electric field (which one it predominantly is, depends... basically we want to create an impedance mismatch between the source of the interference and the sonar and its cabling. A light-weight highly conductive shield should work well if the interference is high frequency... we shall see. Low frequency interference would require a shield with high permeability.
Here's a useful resource: http://www.analog.com/static/imported-files/tutorials/MT-095.pdf
There is definitely some variability on what works and does not in certain cases. Thank you for the resource tips and information Maxbotix sent you. I think for me my starting point will be understanding the interference patterns more and testing a few different things. Using an optical solution would be ideal for dealing with the electrical interference but I suspect there are some vibrational issues too given the sonar sensitivity.
Yes I understand the need to get something right for the foil shield I used something too light for another issue which ended up getting blown into one of the props :-) But the video looked funny at the time. I have the same Sonar as you so its good to know about the resistor recommendation.
I completed some testing over the past few days looking at both vibrational and electrical interference impact on the sonar signal with some interesting results. I have also made a few modifications including putting heat shrink on the landing gear mount screws which previously could vibrate against the metal frame as a possible RF interference source. Here are some results with log plots of sonar versus throttle with and without cable shielding and combining shielding with power filters:
Here we see a noisy sonar signal (Red) versus Throttle before shielding the sonar analogue signal or using a first order passive filter on the sonar power supply. I should note at this point my sonar is mounted around 3" vertically below the Arducopter center frame hub where my ESC's are attached (Note this mounting is the same for all tests)
In this test I used a 3 core shielded cable between the sonar sensor and APM. The V+ GND and Analogue wires are inside the shield with the shield itself tied to the IMU / Oil PAN ground only. i.e the shield is not grounded at both ends. You can see here there is little difference from the previous unshielded sonar signal test. In this flight (using 2.0.45) I engaged ALT Hold towards the end (you can see a distinct change in the throttle pattern). at this point the motors where pulsating so I did not achieve a stable ALT Hold.
After seeing the shielded cable did not effectively reduce the sonar signal interference and I had a regular pulsing motor effect in Alt Hold, I added a passive power filter as described in the start of my forum post. I also wrote to Maxbotix and received a nice email confirmation on the recommended shield GND configuraiton and values for the passive filter which is 100 Ohm resistor in series with V+ and 100uF electrolytic capacitor across the +5 to GND power for the XL-Maxsonar-EZ0 I am using. Maxbotix recommended to ground the shield on the receiving end (APM side).
In this plot you can see I started with no motors running, but I had armed the quad to start the sonar logging on the ground. I basically wanted to see the sonar reading with and without the motors running. The intervals of each test in this plot is approx 1 minute. At the 1 minute mark I raised the quad (no motors running) to 2 metres and held it there until the 2 minute mark. At this point I placed the quad on the ground again and started the motors but not enough for lift off. Notice now the sonar signal is nice and clean. In the next phase on the test I lifted the copter to 2 metres again increasing the throttle and holding this for another minute. I repeated this again with more throttle and note in both cases appearance with what looks to be some interference.
However I note the following. I was holding the quad by hand and was not that stable so this can account for some of the peaks. But it is clear there was still sonar interference which I attribute to vibration harmonics not so much electrical sources. For example there is less noise at a higher throttle. Although I cannot explain the two sharp transient peaks unless some sort of momentary spike from the ESC's. Mainly because I see this in the throttle and sonar traces.
My final test below is to see the difference in the sonar output with the quad sitting on a hard surface (in this case tile floor) versus on flat carpet while the motors are running at speed. No props installed of course.
This log plot is showing sonar readings just above ground level with increasing throttle at 1 minute intervals. In the last run I moved the quad on to a flat / hard carpet square and used a high throttle setting. Note the Sonar trace is no longer noisy. So I believe the remaining noise I have, comes from a frame harmonic perhaps as the motors transition through a throttle up point. I notice for example the frame vibrate a little and smooths out again once the motors are past ~ 50%. So I could improve on the sonar by altering the motor mounts.
From this I found the following in my case:
1. Using a passive power filter as described has the most impact by cleaning up the sonar power which would otherwise negatively impact the analogue signal going to the IMU board. Note I retained the shielded cable as there is still some improvement over just using an unshielded alternative.
2. I did not have to have the sonar halfway out on the frame. But in honesty my sensor is an equivalent distance away from the ESC's i.e is mounted directly below rather than out in front. I guess I did not like the idea of the sonar being closer to the propeller wash.
3. Both electrical and mechanical (vibrational harmonic effects) would appear to effect the sonar sensor. But my testing is limited. So from a scientific standpoint, the results are inconclusive.
4. I had a lot of fun and learnt more about this vital sensor in the process.
In closing, do my current sonar signals look clean enough with just using the cabling and passive power filter combined with keeping the sensor away from the ESC's??
These are interesting results, but things changed for me when the multicopter was in a hover with props and motors loaded in flight. I saw noise in this case when things look clean with motors running without props. I would suggest putting the copter into a hover and plotting sonar alt vs baro alt from ground level all the way until the sonar reaches it's max altitude and above. If there are no spikes in the sonar altitude up until it starts to loose the returns at max altitude, you'll be assured that the sonar will work well. When my quad is over sonar max altitude, I do see some spikes on the max sonar level, but below max altitude I see no spikes.
Here is one of my plots that show pretty good agreement between sonar and baro up until max sonar altitude:
No problem - and you have some very good info here. I found the sonar very frustrating to get working and there are so many variables. The more data on this sensor - the better.