Sonar Noise Reduction update

 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:

 

3690892456?profile=original

 

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?

electrical_noise_filter.jpg

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

  • Took the arducopter out for a fly today over a nice hard concrete surface below (good for sonar returns)

    Here is the plot of I2C Sonar (red) and baro (green) altitudes, also plotted is the throttle (white) and Next Waypoint Altitude (blue)

    This blue line shows when the aircraft is in altitude hold or loiter mode. Note the throttle response is a lot sharper in alt hode mode.

    I did fly over a couple of small bushes while in alt Hold - this obviously splits the sonar and baro as the sonar see this as a sudden drop in altitude but the baro doesn't - see around line number 10.5 and 11

     

    3692291586?profile=original

  • Here's my latest flight with a MB1200 XL-MaxSonar-EZ0 with a filtered power supply and shielded cable, also with a haphazard but ungrounded attempt at shielding the module itself with a small box covered in aluminum tape:

     

    3692288480?profile=original

    3692288122?profile=original

    3692288489?profile=original

    The most wiggly parts of the throttle out graph indicate either alt hold or loiter being used. For some reason the interference causes spikes in both directions (I used to see spikes only from current value to minimum before) and it is intermittent, sometimes disappearing altogether as can be seen between lines 8k - 11k, and for almost the entirety of the last flight from line 11k to 15k. The sonar is 12 cm from two ESCs which are situated on aluminum arms, with the sonar sticking out from the hub on a short puny arm (a piece of not-very-rigid plastic) between them. I don't know if this is due to the ESCs switching at a fortuitous frequency that causes less EMI or what.

     

  • Can't we just move to something like this for sonar http://diydrones.com/profiles/blogs/creating-an-i2c-sonar-for?id=70... and be done with all the black art and fidgeging with the analog signal?

    The cost for an Arduino Mini is peanuts in comparison to the total cost of an ardupilot system.

  • Today I finally had perfect windless conditions to do some final testing on the sonar noise reduction modifications I have described in this post.  I have also replaced the shielded cable with a better one from an unlikely source.  I was not happy with the thickness of the 4 core cable is was using.  I used of all things a relatively new Belkin ipod/iphone USB cable which has 3 cores and a nice shield with grounding wire.

     

    I have to admit at this point I am still seeing some interference in the sonar signal (intermittent spikes) and I am less than impressed with the baro performance even with the recommended gauze / cotton pad cover.  To make sure the interference was not from a bad IMU shield board I replaced this with a new spare and repeated the same tests.  However, I experienced the same Sonar spikes I am about to show you as well as baro error / fluctuations.  

     

    For the record I am still using 2.0.45 for testing consistency.  However since I am looking at the electrical signal properties I doubt there would be significant difference in my findings unless the sample loop was reduced to counter noise effects or something similar.

     

    The following plot is sonar versus throttle at around 3.5m which is well within the 7m range of the XL-Maxsonar-EZ0.

    3692288579?profile=originalI engaged ALT Hold just as you see the first matching sonar and throttle spike (Green). There is not many for this altitude test but notice the altitude is starting to drop slightly before I disengage the ALT hold and allow the arducopter to descend. As I mentioned I have no idea where these spikes are coming from or if this is just normal sonar behavior.  I have swapped the shielded cable but I had the same interference before and after even with the power low pass filter.  There is also good dampening in my arducopter and very well balanced props to keep mechanical vibration to a minimum.   I have also spent many hours perfecting the wiring and soldering everything to a high standard.  I just wonder under the circumstances if what I am seeing is limitation in the electronic sensor signals which will ultimately mean this effect cannot be countered by the software ?

     

    Another datapoint I should mention is I have tried the manual recommended Sonar mounting position off one of the frame arms, with the same signal results.

     

    The next plot is Sonar versus Throttle at ~ 7m (the limit of the sonar)  There is more noise and looking at other DIY member feedback this would appear to be expected.  Of course what happens at this point is the baro kicks in but this device lacks any real precision so the arducopter height fluctuates considerably making the current project not very suitable for stable photography or filming. Well that is unless I am really unlucky to get two bad IMU shield boards.  Both mine are (Hotel) version -H and purchased from the DIY store.

     

    3692288519?profile=originalHere you can see the sonar spikes are more frequent and in observing my standard build arducopter quad at 7 meters in the air, the throttle is pulsing more regularly than the occasional spike within the sonar "sweet" spot.  The wiring of my quad is strictly by the manual (power of one ESC) and I have previously given reference to the finished product. I use the 30A ESC's from jDrones, and the 880Kv motors with 12 x 4.5.  Radio gear is high end JR PCM 10 with Spectrum 2.4Ghz module and AR9000 receiver.

     

    I will say the height was maintained at 7 metres from the above plot but shortly after this once the baro started to dominate the quad started to climb and then fall again. I was not game to go beyond 12m in this test flight today.

     

    The final poly below is to show the same data points (7 m test) with Sonar versus baro.

     

    3692288137?profile=originalI note here that the baro on both my IMU shield boards (sensor pads enabled and using baro pad cover) always reads less than the sonar until the upper limit of the sonar.  There is quite a lot of fluctuation in the baro and the error looks to be anywhere from 1-2metres, which is significant.

     

    I wish there was something more I could do but I think I just have to accept the arducopter sonar and baro has limits which means there is still more development to go, but I am sure as a group we will get there.  If I sound somewhat flat on this matter I really have run out of ideas at the moment on how to improve on the issues I have described.  I will do some more research on the sensors and see if there are alternatives which can be attached to the APM with the inbuilt sensors like baro disabled.   Has anyone had much success using a laser range finder sensor or some other optical sensors less prone to interference?

  • I´ve tried all kind of shielding, board filtering, and sonar distancing from ESC. All of this staff improves the pulsing problem but not eliminated completely.

     

    Using the Maxbotix recomended resistor-condenser solution solved definetively the problem. I have now a perfect sonar behaviour without any aparent drawback (I´m using this solution quite long time ago).

  • 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:

    3692284578?profile=originalHere 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)

     

    3692284244?profile=original

    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.

    3692284591?profile=originalAfter 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.

     

    3692284677?profile=originalThis 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??

  • 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

  • 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...

  • 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.

     

    http://diydrones.com/forum/topics/sonar-cable-shielding-question?id...

     

This reply was deleted.

Activity