100KM

Fixed my sonar ALT_HOLD problems (ACM 2.0.36) !

https://www.youtube.com/watch?v=piBedxcT-WI

 

As many here I had severe alt_hold problems. Kept me from further testing loiter, RTL and missions. Today I'm happy to report that I have found the cause of my problems and the solution for it.

As some others here I had very noisy sonar data as you can see in the graph below. This explains why the hexa kept going up with aggressive throttle pulses : it responded to the erroneous low values of the sonar.

noisy_sonar_data-sonar_on_arm.jpg

 

So why the noisy sonar data ???

I noticed that sonardata was ok when testing in CLI. Also I noticed that sonardata was fine until I started the motors. Then I got spikes of wrong low values. You can see in the graphs that the first altitude change give fine sonardata. This was when I picked the hexa up manually. When I started flying, bad sonardata.

Green is throttle, red is sonardata.

noisy_sonar_data-sonar_on_arm1.jpg

The sonar was mounted on the forward arm, very close to the esc and the motorwires.

sonar_on_arm_lowres.jpg

sonar_on_arm_lowres2.jpg

sonar_on_arm_lowres4.jpg

I then tried to move the sonar to my cameramount :

sonar_on_cammount-lowres.jpg

sonar_on_cammount-lowres2.jpg

And sonardata cleaned up and now the hexa hangs in the air as hanging by a thread. (see video). It quickly adjusts height when passing over plants. This is how my sonardata looks now:

no_noisy_sonar_data-sonar_on_cameramount.jpg

So I strongly suspect that either the esc's or motorwires cause interference on the sonar sensor. If you experience the same problems, try placing the sonar away from esc's and wires.

19-07-11 04-48 2.log

19-07-11 07-38 1.log

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

Join diydrones

Email me when people reply –

Replies

  • Not sure if anyone is still subscribed to this thread, but I could use a little sonar help.

    I'm having some trouble with to MB1200 sonar on my quad. No matter where it's mounted on the quad or how high/where it's pointed, the only value I get in the CLI test is 675 cm, which I believe is the max range for this model.

    My quad is the stock 3DR built and configured by Udrones (850 motors) running ArduCopter v2.3.

    I made sure the box is checked in the Hardware tab to enable and XL-EZ0 is selected as the correct Sonar. Ran the test in CLI with the sonar mounted to the quad as well as holding it in my hand pointing it at different distances. Made no change to the value displayed.

    Does the quad need to be Alt Hold to activate the sonar? Anyone have advice on how to test this further or make it work? I'd greatly appreciate it.

    Thanks,

    Jason

  • 100KM
    I made a blog about how to get blinking leds as low battery warning. I use 12V leds from hobbyking, operated by the onboard relay.

    http://diydrones.com/profiles/blogs/led-low-battery-warning-on
  • This is great news. I was getting so frustrated with my sonar i just removed the thing and ordered a new mb1200 for when things get worked out. Now i am exited to try this.

     

    There is one thing that i would like to suggest. The one thing that was happening with me and a noisy sonar in any altitude managed mode (alt-hold, loiter, etc) is the quad would climb on its own until i took over manual control.

     

    I have seen or read about many users testing auto, testing rtl, etc... What happens if during this auto or rtl flight the sonar gets noisy while in flight? Most likely the quad will see this noise and assume the quad has descended and start to increase altitude (and probably not stop until manual control is taken). The problem with this is during auto or an rtl situation the quad is likely going to be a good clip away. I can see this causing a lost quad rather easily.

     

    What i suggest and would like to see is one of two things happen...

     

    1) Have the ability to disable using sonar on a switch. In cli the sonar would be enabled but the switch turns on or off the quads ability to use the sonar

     

    AND/OR

     

    2) When running an auto mission the ability of the quad to use sonar be disabled, only use baro except for a landing command. Outside of testing our auto flights will most likely be well above the sonar range anyway.

     

     

     

  • btw can sonar work on water?

  • Moderator

    Your hexa is very stable, what are your PID values, what props/motors are u using?

  • 100KM

    I'm happy this solves alt_hold problems for others too !  Glad to be able to give something back in exchange for the enormous effort of coding and testing that has already been done and made available for free !

     

    The led lights are controlled with the relais on the imu.  I fly on 3S and use the cheap 12V led strips from hobbyking.  Hence the relais approach.  Also keeps the other ports free for hexa or octo configurations.

    Motors armed = on and motors disarmed = off.  Furthermore they start flashing slowly (2hz) at low battery level (10.6V - 1 minute flighttime left) and start flashing rapidly (5hz) when battery is empty (9.6V - about 10s of reliable flighttime left).

     

    I also modified low battery behaviour so the copter only goes into RTL on low battery when in auto or loiter.  In stabilize, simple or alt_hold it just flashes its leds and stays in manual control.

     

    It's some custom code, based on work of a guy named Bill on rcgroups.  If there is interest for I'll make a blog on how to do it exactly and post the code.  Would be nice though if it could be integrated in the main code.  Then I don't have to make these modifications again each time a new version comes out :-)

  • how did you wire your led lighting?, and how or what makes them flash at low battery? 

    Any idea on light control or always on?

     

    Steve

  • so nice..:)

    can you share your PID data?

    btw have you test your hexa fast moving? any problem YAW?

    test fast moving (full pitch / roll stick)

  • This gives me hope also. Thanks for posting this. Now the hard part of rerouting the sonar wires again.
  • I hope I get my sonar soon (waiting on stock...) so I could experiment with shielding the sonar's wiring. Grounding a shield wrapping the wires (maybe just a simple wrap of aluminum foil?) might do the same as moving the sonar and its wires away from the ESC wiring altogether.
This reply was deleted.

Activity