Gathiyo / arducopter

Automatically exported from code.google.com/p/arducopter
0 stars 0 forks source link

Bug in Loiter in AC2 2.3 - target does not register or cause copter to try to achieve it #342

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Arducopter ACM
What steps will reproduce the problem?
1. Not sure, observed behaviour while trying to tune Loiter, irregular

What is the expected output? What do you see instead?
Loiter invoked after reaching desired altitude and holding static for more than 
2 seconds, copter should try to Loiter but instead was blown downwind. Happened 
irregularly but quite often and had thought that it was a problem with changing 
parameters or wind conditions, but on one occasion saw in Mission Planner in 
the HUD, Loiter 0>0, and it stayed like that as the copter was blown downwind. 
Tried it on another flight, changed no parameters, happened 6 times in a row. 
Final 2 loiters did "take" and copter stayed around target area.

What version of the product are you using? On what operating system?
FW 2.3, Mission Planner 1.1.34 on Windows 7

Please provide any additional information below.
3DR frame, 850kV motors, 10x4.5 props, 2 x 3S1P 2150mAH battery packs plus 
camera and mount as payload. Winds were 4-8mph at ground level, temp -1 C. 
Files attached - MP .kml, Parameters file, MP .tlog, log downloaded from copter 
and associated .kmz. Disparities found between MP .kml and log .kmz.

Original issue reported on code.google.com by b...@themojos.net on 11 Feb 2012 at 6:22

Attachments:

GoogleCodeExporter commented 8 years ago
Marco Robustini suggested that this might be down to having old firmware on my 
GPS unit. Martin from Build Your Own Drones says that it is highly unlikely 
that I have a unit from old stock due to his turnover of kit.
RickP suggested that having some trim might override the entry conditions for 
loiter "If you look at the code, it updates the loiter waypoint whilst in 
'loiter_override' which has clear entry and exit conditions. Exit condition is 
that pitch/roll (ie. cyclic) is centered. If the radio input for those two 
isn't exactly centred, it looks like it may not exist that mode." I did have 
some trim on my Tx, but had sticks centred, and it was inconsistent in that it 
failed 6 times but took twice. I replied:
"Rick, if that is the case, then there is a problem. Jason made a change to the 
code, as per this comment, " If you fly, you must bring it to a stop to regain 
loiter. I will also put a 2 second timeout on it too in case you're in wind." 
i.e. in wind, he is expecting that we hold it static and thus will have sticks 
not centred. That is a change that I had been requesting for some time, as 
otherwise the copter pitches to horizontal and is blown back and loiter has to 
try to regain position - better to start static and have loiter keep position. 
It is possible that there is a confusion in the code here i.e. that this 
condition is only if you are already in loiter and fly around. I would expect 
and want it to be the start condition of loiter. As it happens, on the 
occasions in the flight posted to the issue, when it was being blown back, my 
sticks were centred. If even a bit of trim can mess it up (and inconsistently), 
then the problem is worse in that achieving loiter becomes fundamentally 
unreliable e.g. on Auto missions.

I have not had any formal feedback from the dev team on the issue, but what I 
would like to see in terms of functionality is clear:

That loiter when invoked, takes the start attitude of the copter as the start 
point, to prevent pitch back and blow back in wind (the assumption being that 
both manual control and Auto will achieve  a static position before invoking 
Loiter).

Happy that there are entry conditions to regaining loiter after a fly around 
and Jason's conditions sound sensible to me. It should be clear to all whether 
loiter will try to maintain that position or regain the original target - my 
preference would be for the latter as if you want a new loiter position, why 
not get it static, flick to Alt Hold and then back to Loiter to register the 
new position."

Original comment by b...@themojos.net on 12 Feb 2012 at 7:56

GoogleCodeExporter commented 8 years ago
After more flights today, I think that it is something to do with having trim 
set. The first time I tried, it failed to take. I landed, took the trim out, 
recalibrated my R/C and then auto levelled the copter. It was fine after that. 

I still think that this is a problem - having trim is sometimes necessary and 
should not prevent functionality from working. These entry conditions also seem 
to conflict with Jason's anti-pitch change conditions for regaining loiter 
after flying around in loiter, and I am very much in favour of having a static 
attitude (i.e. not necessarily having sticks centred) as the start point of a 
loiter.

Original comment by b...@themojos.net on 14 Feb 2012 at 2:26

GoogleCodeExporter commented 8 years ago
I looked at the logs. Your Roll and Yaw Radio trims were being used. You 
tricked the AP into thinking you were trying to correct the position manually. 
Please use the in-air auto-leveling feature to trim your copter.

Radio trims are bad because they mask problems that need to be fixed in the 
frame. Copters are fundamentally different from Airplanes in that you loose a 
lot of flight control resolution when you use trims. 

For instance, you quad is trying hard to Yaw. That means the motors are not 
calibrated or they are crooked on the frame. This should be fixed by adjusting 
the motors. Roll issues should be fixed by adjusting weight, etc.

Original comment by jasonshort on 14 Feb 2012 at 5:06