Troubled Altitude Control

Hello,

I am using the Cube Orange Plus flight controller. In my setup, I have a TF02-Pro LiDAR sensor facing downwards beneath the drone and a TFmini Plus LiDAR sensor facing forward. The motors I am using are Hobbywing X6 motors, and my drone is a hexacopter. I am also using Mauch current sensors to measure the instantaneous current drawn by my drone, which helps adjust the mot_batt parameters accordingly. Additionally, I have tuned the PID controllers using autotune, and the adjusted PID values have proven to be effective. However, I am experiencing a significant issue with the altitude hold of my drone. Especially when in Auto mode, the drone is unable to maintain its altitude and exhibits oscillatory movements. I have extensively investigated this issue but have been unable to find a solution. Moreover, sometimes when the drone is in the disarmed state on the ground, its altitude fluctuates. It can change by 1-2 meters, sometimes even up to 5-6 meters.
Additionally, I am using a flow meter. My drone is an agricultural spraying drone, and I pass the spray through a flow meter. The flow meter acts similar to a current sensor and generates bat2_monitor values. I uploaded the parameters as well. I am attaching the flight logs of the flight where I encountered this problem, hoping that you may notice something that I might have overlooked.

Flight log: 2023-06-12 11-57-44.bin - Google Drive
Paremeters: parameters.param - Google Drive

1 Like

Your downwards-facing rangefinder is definitely a problem

RNGFND2_GNDCLEAR,15  //  is the lidar 15cm from the ground when landed?
RNGFND2_MAX_CM,30000  //  this is 300 meters! probably should be 3000
RNGFND2_MIN_CM,10 //  I think this may be correct
RNGFND2_TYPE  //  you may have this correct, but the documentation was a bit unclear

Can you do the rangefinder testing where the “sonarrange” value is viewed in the MissionPlanner status tab. Does that work OK?

1 Like

Yes, you are right. I reduced the value from 30000 to 3000. However, the problem has not been resolved. I conducted a Sonarrange test, and it consistently shows the correct distance from the ground.

1 Like

Which protocol are you using with this lidar? I already had some troubles using long leads to read I2C signals from this kind of device.