Avoid obstacles by four LV-EZ0 sonars

My professor give me a project. I need to make a quadcopter can independent avoid obstacles.

I choose four LV-EZ0 sonars mount to front,back,left and right(like the photo).

Four sonars value has filtering by APM originally filtering code. Through those value calculated gain belongs to four directions. Put those gain to PID function calculate avoid obstacles value(pitch & roll). Finally, put the avoid obstacles value of pitch and roll to " case ROLL_PITCH_STABLE" belongs to function "update_roll_pitch_mode" at main code.(Remark : firmware is "ArduCopter V2.9.1b")

Now,I encountered a problem. The quadcopter's roll attitude can avoid obstacles fast and correct but pitch attitude can not. I were sure four sonars is good for work. The pitch's code is same as roll's code. I have no idea why is it so. Someone can give me a hand?

(If you want the complete code,sent the email for me,please.My email is w19900112@gmail.com)

2014-08-21 16.27.32.jpg

2014-08-21 16.28.00.jpg

UserCode.ino

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

Join diydrones

Email me when people reply –

Replies

  • I'm going to take a wild stab  in the dark here. See if this box indicated with the arrow is marked in mission planner .. If it is Unmark it. 

    3701811693?profile=original

This reply was deleted.