I have installed a MB1200 XL-MaxSonar-EZ0 to my Quad and it appears to be working in mission planner, but I cannot get it to work in flight.
I have installed the sonar on a plastic tab about 3 inches away from the body and followed the instructions as per the manual http://code.google.com/p/arducopter/wiki/AC2_Sonar
I have ensured that I have enables the correct sonar model in the Hardware Options in Mission Planner
I ran the test in Mission Planner - terminal CLI - test - sonar and which reads 70cms which is about the height the quad is during the test as I had it on a bench. When I place my hand under the sonar or if I raise the quad during the test it clearly displays a change in the test data.
On my TX I have set channels 5 as Alt Hold and Channel 6 as Pos Hold to test it the sonar and I am flying the quad about 4 meters of the ground but when I engage either pos 5 or 6 it has no effect at all.
I have scrolled the forums looking for more information about setting up sonar but I seem to have covered all the points raised in the forums.
Any ideas, have I missed something? I have not changed any PIDs after installing the sonar as I have not yet mastered PID tuning.
Have you verified that you are indeed in Alt Hold mode? (Check MP if you have telemetry or logs). Even if the sonar wasn't enabled, the baro should hold altitude pretty well.
I think you are right, looks like I have not got my TX correctly configured
Just an FYI for future reference as well: You can test the sonar specifically by itself via the terminal window in MP.. Once you're connected to your quad and have the prompt up (that states your firmware version within it) type:
This will give you a readout loop of the sonar sensor until you press enter again.. It will always say ~20cm when you are 20cm away or closer to the sensor, but should give you other readings if you raise/lower your quad by hand while looking at the screen.
Also, (I may be wrong as it's almost 2am over here) but I believe POS Hold does not use the baro or sonar - it's basically an elevator mode - it holds position in x and y, but you control throttle to let the copter change altitude as if you were in stable.. Alt hold has the opposite effect: it holds altitude, but allows you to change x and y movement :) So you want to focus on alt hold within a few meters of the ground if you want to use the sonar.. Once you get sonar working, it's great :p
Chris was correct I did not have my TX flight modes configured correctly. I just tested it in the backyard and it is working.
Thanks once again guys for your help