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

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

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

    Ha, I had Chris dangling his Quad from a broom stick to try and get some good data like this. Looks like your off the hook Chris!

     

This reply was deleted.

Activity

Jose Araujo liked Jose Araujo's profile
Aug 29
spencer harvey liked spencer harvey's profile
Jul 9
More…