Sonar ALT_Hold Issue


Hello there,

Yesterday, i added a new senor onto my quad, MaxSonar MB1260 XL for better altitude hold. Before attaching and re-uploading the ArduCopter 2.7.3 onto the APM 2. I erased and reset the board. And then attached sonar as described in the wiki manual. And uploaded the code and followed all initial steps (Of course i enabled the sonar). Everything went smooth. 

Next step, time for test fly. It flew great in Stable mode. However, as soon as i toggled the ALT_Hold switch ON. Quad started acting strange. It kept climbing higher n higher and suddenly dropped out of nowhere. Luckily i managed to control by toggling the switch back to stable mode.

I have checked everything couple of times now. All connection looks good. Mission Planner looks ok. I don't know what the problem. Your help would be so much helpful. I have attached couple of videos below. Please take a look at them. If you need any other information let me know. Thank you.

Quad Setup:

  • DJI F450 Frame
  • HackerStyle 20-22L Motors
  • Turnigy TY-P1 25Amps ESC (Flashed with SimonK firmware)
  • ArduCopter 2.7.3
  • MB1260 XL - Sonar 
  • 4000mah 20C 3Cell Battery
  • DX7 with AR7000 
  • Using one of four ESCs to provide power to the APM 2. 








E-mail me when people leave their comments –

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

Join diydrones


  • Actually, instead of a board, can't a proper "cable" be made, shielded with the two components built into the cable? Since users still need to locate and build their own cable even if they buy the board, why not kill two birds with one stone?

  • I would put my hand up for a few of these boards.

    It's becoming obvious that electrical interference is a big problem with the Sonar, having had many issues and have finally identified the Sonar as the culprit.

    Has anyone given any thought to using more than one Sonar? 

    Just asking as I notice a lot of Sonar dependant machines (ARDrone for one) use two.

  • Randy,

    This would be a wonderful idea. It will be a lot more easier and helpful for/to the hobbyist. :) It makes sense to sell these Sonar Filters from DIYDrones store rather than buying from somewhere else. 

    Thanks. :)

  • Developer


         I think I'm going to try and get someone to manufacture these and then maybe Jordi & co will be happy to sell them in the 3dr store.  As you say, for just one board, once you add in the costs of shipping the pcb and parts and it becomes an expensive item.

  • I just have made few changes to my quad. Moved receiver to other side, added rubber washers between the sonar and carbon fiber (since GND and +5 were touching the carbon plate, Thanks to airmamaf for pointing that out), i also changed all four motors and props as well. Now i am getting pretty good results. I will post video later on to show you guys how steady it holds its alt now.

    But still i would like to make few changes, such as add Sonar filter, change cable to shielded cable and may be heater elements (since winter is coming). ;)

    @ Randy, I am very impressed with the Sonar Filter you suggested. By looking at the screenshots you posted. You can tell that It did make deference. I already added into my cart but the only thing is holding me is the shipping cost. :) The filter costs $2.50 and the shipping is almost five times the price of the filter. $10. :(

    @ Ervine, Where did you buy your resistors and capacitors from? 

  • Thanks Randy,

    I finally managed to get my hands on a resistor and a capacitor similar to the one that you have. I'll report back on the results. I already use a shielded cable and ferrite cores on the 433mhz 3DR radio and 5.8ghz video TX.

  • Developer

    Boston UAV,

         The 4th (the green wire) is for the heating element.  So for people who tend to take their copters from a warm room into the cold out doors you plug that green line into a 5v source on your apm2 and it'll keep the sonar free from condensation.  Now on in that pic I don't have the heating element attached..on my quad copter i just use the regular 4 resistors attached in series and then wrapped around the base of the sonar but if I were to turn this little cable into a commerical product, I'd replace that with those wire heater elements.

  • Randy, I noticed in your image you have 4 wires attached (wiki states 3). What is the forth for?

  • Developer


        The top graph was actually with the cable but it didn't have the massive cap sticking out fo the top. :-).  So in the top graph it had the shielding, it had the resistor, it even had a capacitor but it was just the small brown one that you can still see on the green pcb in the pic.  This SMD type cap is apparently not good enough..once I stuck the massive black one on there all was good.  In the version of the board on batch pcb I replaced it with one of those larger cylindrical panasonic ones which will work as well.
  • Randy that "before" graph looks exactly like my sonar graph now! The bottom graph was a result of the power filtering or cable (or both)?

This reply was deleted.