I am having an issue with Guided mode takeoff altitude control on ArduCopter. When I command a Guided takeoff to a low altitude, such as 0.2 m, 0.5 m, or 1.0 m, the vehicle consistently climbs much higher than the specified altitude, often reaching roughly the same physical height regardless of the commanded value.
The rangefinder data appears accurate. In Mission Planner/MAVLink Inspector, the rangefinder reports the expected physical distance from the ground. For example, when the vehicle is physically around 1.7 m above the ground, the rangefinder reports approximately 1.7 m. However, the altitude value shown by Mission Planner does not appear to match the rangefinder height. In some cases, Mission Planner altitude may show a very small value, such as around 0.06 m, while the rangefinder correctly reports around 1.7 m.
I have been testing indoors without GPS. I am using optical flow and a rangefinder for position/height estimation. I have tried using the rangefinder as the EKF vertical position source by setting EK3_SRC1_POSZ = RangeFinder. I have also tested using barometer for EK3_SRC1_POSZ, but with baro selected, the estimated altitude begins drifting upward immediately after arming, even before prop wash could affect the sensor. This causes the vehicle to climb aggressively and makes Guided takeoff unsafe indoors.
The main issue I am trying to understand is why a Guided takeoff altitude command does not correspond to the actual rangefinder height, even when the rangefinder data itself is accurate. It seems like Guided takeoff is following an altitude estimate that does not line up with the rangefinder measurement.
As for the bump in altitude on takeoff, it can be tuned by increasing PSC_JERK_D. Try increasing it to 10 from the default 5 and see. You can increase it more if required.
here are 2 data logs without changing my current setup. One uses the rangefinder as ekf posz. This is a much more stable flight where i set it to fly to 0.5 m and land, but it went to around 2m. The other log is when I set the ek3 posz to barometer. It sort of just shot up way above the 0.5 m specified height. I think this is due to the random changes in altitude right when I arm the copter that shows in the MP HUD. Let me know if you want me to provide more info.
I am thinking I should use the Baro for posz but I cant get consistent data, its very frustrating. randomly the altitude changes either to positive or negative values. Also after setting the ekf origin and arming, the altitute just starts increasing even before takeoff and before the props turn on. I was thinking it could be due to temperature, but I put it in my freezer and got the same results. This is why I am getting a vertical pos variance in ekf. It just wont hold alt because of these issues.
I have tried both 4.6 and 4.7. Here is what I just observed: I connected a new bare same fc to the mission planner and before setting the ekf, I have been seeing a rise in alt, I think it is becuase the board is getting hotter. I turned off the power to the board and started seeing a decrease or drop in alt. when I put a fan on it for cooling, it would stay at around zero with power on, and when I turned power off , it started to decrease slowly negative (i am thinking this is due to it getting cooler). I tried and temp calibration and am still getting the same results
Thank you for this. I am using a custom firmware to be able to use optical flow, so I may have left out some values for logging because I don’t have much room on the flight controller. Would you have any suggestions regarding this or any methods of troubleshoot?
My flight controller has low storage, so the original base firmware to install is without optical flow configuration settings. I needed to add optical flow settings into it through a custom firmware.