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