Noisy sonar data and Alt_Hold problems

Hi All,

I'm operating a stock standard Arducopter 2 from jdrones with GPS, Magnetometer, MB1200 Sonar and a Turnigy 9x radio

Over the past couple of months I have seen the occasional odd behaviour with the Sonar when bench testing with the CLI Sonar test. Basically the Sonar sometimes fails to report the correct distance - sometimes it locks in a fixed and incorrect distance, sometimes it sticks at the minimum 34cm. At other times it appears rock steady and quite accurate.

Yesterday while out on a perfect flying day (a rare event in the middle of winter here in the land downunder) I struggled to get altitude hold to work when testing 2.0.35. I saw the pulsing or gunning behaviour others have seen in the latest Alt_Hold followed by either a steady climb or a gentle descent that brought the aircraft down to lawn mower level.

Looking at the logs in Mission Planner I notice that the sonar data is very spikey.

In the images below note the red trace is Sonar Alt, Blue is Baro Alt, Green is Throttle

The correlation between the sonar peaks and baro altitude is good at low altitudes which reassures me the Sonar is functioning correctly - some of the time

3690878484?profile=original

and the same again zoomed in near the start of the data.

3690878749?profile=original

Can anyone help explain what I am seeing with this 'noisy' sonar data.

Do I have a hardware problem?

Where might it be?

 

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

Join diydrones

Email me when people reply –

Replies

  • Developer

    Looking at those values in the log. It seems impossible with the moving average filter that's in the Rangefinder class. Something must not be working right. I'm looking at it today.

    Jason

  • 100KM
    Hi, My donar data looks exactly the same in my logs and my alt_hold in 2.0.35 was also not working (constantly climbing or descending).
    I have the EZ0 sonar mounted about under the forward arm, halfway between centerplate and motor, with a piece of foam between the arm and sonar.
    Please let me know if modifying your mount solved your problem.

    JMD45, you mean we should put a small cilinder around the sonar ?
  • Some reading and thinking has lead me to wonder if there is RF or electrical noise interference or if the battery connector may have been moving in and out of the filed of view of the sonar sensor.

    I have extended the sonar mount legs by 15mm with additional plastic stand offs and ensured the battery connector is secured out of the way.

    I've then run a test of the sonar with the Arducopter captive in my outstretched hand, with and without the motors running.

    3692238417?profile=originalThe first peak in the image above is with the motors off, the second peak is motors running

    The step in early part of each peak is me carefully climbing up on a chair while holding a live Arducopter

    The results are much better than before with only the odd 'spike' which could be explained by a stray leg or similar entering the sonar sensor field of view. There is more 'noise' in the second peak - with motors running - but nothing like before.

    Time to test fly the new mounts. And see how Sonar and Alt_Hold performs. It's Sunday night here downunder so this will have to wait for another clear calm winters day.

    One question I now have is about the scaling on the sonar data the values shown are 150% of what they should be. from the Maxbotics specs sheet the scaling factor changes by 150% depending on what voltage you supply the sonar module. Time to read the circuit diagram and code to check things out.

     

  • Looking in to the data further reveals that the 'pulsing' or 'gunning' behaviour in Alt_Hold can be clearly seen in the throttle trace in the image below at the point I enter Alt_Hold mode (about line 10500) and the peaks and troughs in the throttle correlate with troughs and peaks in the noisy sonar data. ie when the sonar drops out the motors throttle up. Note the pink line in this graph shows when flight mode is Alt_Hold3692238179?profile=original

    It appears a number of others users have seen this behaviour either sonar drop outs or Alt_Hold pulsing and lack of holding.

    http://diydrones.com/forum/topics/altitude-hold

    http://diydrones.com/forum/topics/arducopter-2034-preview?commentId...

    Do we have a systematic problem with sonar hardware or software, or could it be an obscure combination of the two?

     

  • Attached is the log files from the full flight tests

    AC2 Log 160711.zip

This reply was deleted.

Activity

DIY Robocars via Twitter
RT @TinkerGen_: "The Tinkergen MARK ($199) is my new favorite starter robocar. It’s got everything — computer vision, deep learning, sensor…
Monday
DIY Robocars via Twitter
Monday
DIY Robocars via Twitter
RT @roboton_io: Join our FREE Sumo Competition 🤖🏆 👉 https://roboton.io/ranking/vsc2020 #sumo #robot #edtech #competition #games4ed https://t.co/WOx…
Nov 16
DIY Drones via Twitter
First impressions of Tinkergen MARK robocar https://ift.tt/36IeZHc
Nov 16
DIY Robocars via Twitter
Our review of the @TinkerGen_ MARK robocar, which is the best on the market right now https://diyrobocars.com/2020/11/15/first-impressions-of-tinkergen-mark-robocar/ https://t.co/ENIlU5SfZ2
Nov 15
DIY Robocars via Twitter
RT @Ingmar_Stapel: I have now explained the OpenBot project in great detail on my blog with 12 articles step by step. I hope you enjoy read…
Nov 15
DIY Robocars via Twitter
RT @DAVGtech: This is a must attend. Click the link, follow link to read the story, sign up. #chaos2020 #digitalconnection #digitalworld ht…
Nov 15
DIY Robocars via Twitter
RT @a1k0n: Got a new chassis for outdoor races (hobbyking Quantum Vandal) but I totally didn't expect that it might cause problems for my g…
Nov 11
DIY Drones via Twitter
First impressions of the Intel OpenBot https://ift.tt/36qkVV4
Nov 10
DIY Robocars via Twitter
Nov 9
DIY Robocars via Twitter
Excellent use of cardboard instead of 3D printing! https://twitter.com/Ingmar_Stapel/status/1324960595318333441
Nov 7
DIY Robocars via Twitter
RT @chr1sa: We've got a record 50 teams competing in this month's @DIYRobocars @donkey_car virtual AI car race. Starting today at 10:00am…
Nov 7
DIY Robocars via Twitter
Nov 6
DIY Robocars via Twitter
RT @a1k0n: Car's view, using a fisheye camera. The ceiling light tracking algorithm gave me some ideas to improve ConeSLAM, and having grou…
Nov 5
DIY Robocars via Twitter
RT @a1k0n: To get ground truth I measured the rug, found the pixel coordinates of its corners, calibrated my phone camera with my standard…
Nov 5
DIY Robocars via Twitter
RT @a1k0n: @DIYRobocars is back in December, but outside. Time to reinvestigate ConeSLAM! I rigged up a quick and dirty ground-truth captur…
Nov 5
More…