Hi guys, Im using my drone in guided mode and it takes off and lands perfect and very accurately, however, when i try to move in a direction the drone loses altitude and we have to intervene manually to save it from crashing. It all goes very slowly but maybe i overlooked a parameter in my drone config. Can someone please help me? I dont really have logs because i forgot my sd card, what i can say it that i dont hear the motors spinning faster (which they should do to maintain altitude) when moving forward. Here is my params file
new.param (19.0 KB)
Was this vehicle configured and tuned using the ArduPilot Methodic configurator software?
Section 1.1 point 4 iii. of the documentation tells you how to mitigate that. And Section 10 how to tune it.
Anyone else has any recommendations?
If you’re having issues in Guided mode, Loiter mode should have similar problems since they use similar control algorithms.
If Loiter mode works well, the issue is likely with your code, not with Guided mode as you suggested.
Additionally, you haven’t provided details about your environment or code, and most programming forums discourage vague questions like this. It seems you may not have much experience with posting questions or programming, and the issue likely lies in your code.
If you suspect the barometer is the problem, don’t just speculate—test it. A simple way is to push forward in Loiter mode, which will help determine if the barometer is functioning correctly. This is the logical approach to finding the root cause of any issue.
No one can fully understand your situation or provide a perfect solution without enough details. People can only help if you provide sufficient facts.
By the way, your copter looks great. I hope your project finishes successfully!
I’m not sure we can just recommend the methodical configurator as the solution to all support requests.
Hi @Jasper1,
It’s all guesswork without a log (a parameter file doesn’t really provide much information) but my guess is barometer interference. You could prove this by setting the EK3_SRC1_POSZ = 3 (GPS) to see if the problem goes away.
Another guess is that the Location target sent to the vehicle when flying forward has a low altitude.
No worries, I do not recommend the methodical configurator as the solution to all support requests. And considering that 95% of the users do have an incomplete or incorrect configuration I believe it’s valid and relevant suggestion.
If it’s correctly configured already, then there is no drawback in following it.
I’ll do the whole process of the configurator again tonight to make sure that the drone is configured perfectly. I do have a general question, I test that in poshold the drone would move without going downwards, does poshold use the same algorithms as loiter or should i do a seperate loiter test?
Also could it be that my hover percentage is set too low? Or my altitude correction parameters are too lenient? What values would you recommend for it (PSC_ACCZ…)
Make some tests with loiter, moderate and high speed, and the same with STAB and the “dreaded” guided modes (but this latter is just a fancy Loiter mode) and post the logs. It will show if the baro is really influenced by the speed or not, or if the barometer is more heavily over-balanced in the IMU.
From the Methodic Config:
"
10.2 Baro Compensation flight(s)
Follow ArduCopter’s baro compensation Wiki and/or use the Lua script provided by Yuri in the forum.
Use ArduPilot Methodic Configurator to edit and upload the 41_barometer_compensation.param
file to the FC.
Now do the flight to collect the data and analyze the logs to see if the barometer is correctly compensated and insensitive to wind."
Here is a log of the flight, super weird because loiter seems to work perfectly, really no issues are all and it was super stable even with some wind.
Here is the flight log: 00000059.BIN - Google Drive
I already sent you the params. However, maybe you can double-check if my guided mode code is correct: (DELTA is set to 2meters)
def move_to(self, north, east, down):
""" Move the drone to a specified location in GUIDED mode """
try:
print(f"Sending move command: north={north}, east={east}, down={down}")
msg = self.connection.mav.set_position_target_local_ned_encode(
0, # time_boot_ms (not used)
self.connection.target_system, # target system
self.connection.target_component, # target component
mavutil.mavlink.MAV_FRAME_LOCAL_NED, # frame
0b110111111000, # type_mask (only positions enabled)
north, east, down, # x, y, z positions (or North, East, Down in the MAV_FRAME_LOCAL_NED)
0, 0, 0, # x, y, z velocity in m/s (not used)
0, 0, 0, # x, y, z acceleration (not used)
0, 0 # yaw, yaw_rate (not used)
)
self.connection.mav.send(msg)
print("Move command sent")
except Exception as e:
print(f"Error sending move command: {e}")
def move(self, direction, delta=DEFAULT_DELTA):
""" Move the drone in the specified direction """
print(f"Moving {direction} with delta {delta}")
try:
if direction == 'up':
self.move_to(0, 0, -delta)
elif direction == 'down':
self.move_to(0, 0, delta)
elif direction == 'left':
self.move_to(0, -delta, 0)
elif direction == 'right':
self.move_to(0, delta, 0)
elif direction == 'forward':
self.move_to(delta, 0, 0)
elif direction == 'back':
self.move_to(-delta, 0, 0)
except Exception as e:
print(f"Error moving {direction}: {e}")
It’s super weird and frustration that this does not work. Please someone help !
Loiter mode looks good. I would actually wonder if the values are set too high. Looking at the hover in loiter I would usually say the MOT_THST_HOVER should be closer to 0.1 (or less) and the PSC_ACCZ values adjusted accordingly. But I’ve never tuned something so over-powered so maybe there’s other advice here.
I tried that before but same result, it’s as of the drone doesn’t increase it’s thrust when starting to go down. The noise of the engines just stays the same
Nobody has a clue on how to fix this problem?
Post the files that you created eith the configurator