Hi I’m Josh! I have a 250mm quad. I’m using an APM(ardupilot microcontroller) 2.6 with AC(arducopter) 3.2.1 and MP(mission planner) 1.3.30 built 1.1.5648.36304
I have the Maxbotix MB1240 EZ4 sonar mounted on the bottom out of prop wash. I have a 220microfarad cap from the APM power line to ground to smooth voltage fluctuations. I have sonar plugged into Pin 0 of the APM right next to the cap on the power pins of pin 1. My copter flys somewhat smoothly but I need to reduce the roll PID below program minimums to iron out some roll oscillation but I just haven’t yet because I have to change some code to do it I think and the quad is very flyable.
If sonar works and gives me distances which make sense while plugged in via USB to MP then why won’t it work in ALTHOLD? I have tried gains between 2 and 0.2 and there is no change in my altitude. The quadcopter doesn’t hold it’s altitude it drifts up and down, differently then when out of althold mode and control is full manual. It seems to have a lot of deadstick in the middle. I think I have gain trouble but reviewing the log shows me a lot of noise and dead signal then a lot of noise again. Most of my tests have been between 0-20 feet off the ground over dirt, 3-4 inch grass, and concrete with no change in behavior.
What does 4 slow loop lines found, max 7.40% on line 21573 mean? is it related?
Under MP - Initial Setup - Optional Hardware - Sonar:
I have Analog selected and the distance measures correctly when referenced to a meter stick. Lower voltage equals lower distances.
Under MP - Config/Tuning - Full Parameter List - RNGFND_…
RNGFND_FUNCTION = 0 (linear)
RNGFND_GAIN = 0.2
RNGFND_MAX_CM = 700
RNGFND_MIN_CM = 20
RNGFND_OFFSET = 0
RNGFND_PIN = 0
RNGFND_RMETRIC = 1
RNGFND_SCALING = 2.04 (meters/Volt)
RNGFND_SETTLE_MS = 0 (milliseconds)
RNGFND_STOP_PIN = -1
RNGFND_TYPE = 1 (analog)