Problem with RTL and Circle mode

Hi, Im relatively new to using the ArduPlane software. This is also my first post here on the forum.

I have some problems which I can't really understand.

Im running the 2.66 version of the software on a APM2.5. Airframe is a slightly stiffened up Bixler with pretty much the default PID settings for this airframe (glanced at the one available for download which was old).
not much changes done.
APM board is mounted in front underneath the camera pod (cheap woody 4dollar HK thing).

I've flown this setup in 6 flights total, trying to grasp all configuration and learn how different aspects of the autopilot works.
Im mostly interested in the RTL functionality which I will engage if I loose RC/Video signal (Im trying todo FPV).

I've had mixed results from the RTL functionality, from catastrophic (crash) to perfect, and I'll in brief explain the flights I've done
and try to recap changes in configuraton etc which could possible be the cause of my problem.

Pre-Maiden: Setup params, modes are Manual, Stabilize, RTL. Setup failsafe on Rx and APM with default failsafe actions (Ie Circle, then RTL) when throttle goes below 970uS.

Maiden: Trying stabilize mode (works, but seems slugish and really quite unusable), after a while engaging RTL which worked like charm, plane is flying to 100m above myself and starts to circle above me (loiter).

Flight2: Connect the APM at field to my laptop and reduce P gain for Roll by 0.05 or something, just to try. I luanch and
fly a short while in stabilize. Since RTL worked really fine in the maiden flight, I engage RTL. Seems to work, plane is doing it first turn back towards me.
Some strange tought pops up in my head and I quickly decide its time to try out proper Failsafe, so I turn off my transmitter...
Plane engages Circle mode (according to post mortem on-board data logs), but starts heading for the ground.
I try to regain control by turning on the transmitter, but one wing of the bixler snaps (weak original spar) and plane goes in
nose first upside down, smashing my camera, and a few more parts. APM board which I've had mounted underneath the camera pod survived with no
damage at all.
I never fully understand why the plane started to heading for ground (with increasing throttle).
Initially it was making the turn back to me ok.

Rebuild Flight: I repaired the plane, and went back to the field (some month later). I had now disabled failsafe, and set so that
my mode selecting channel where to engage RTL if I would loose RC control. I flew around for a while, trying out manual and stabilize mode again to verify that the APM2.5 wasnt
damaged in some way, and as a final test, I engaged RTL which worked like a charm, loitering around above me at 100m.


Flight 4,5: Flew some FPV and tried Loiter mode for the first time, everything works like a charm.


Rearange: I decide to change the location of the APM board to right beneath the wings inside the fuse.
This decision was made mainly for moving the expensive stuff farther from the nose, if I were to crash again.
and also to avoid the PAN servo from "possibly" screwing with the Magnetometer never had proof of it doing so, since it worked ok in flight 4,5 but...

HIL sim test:
I try to flash the board with the HIL software, and tryout the XPlane simulation, set some waypoints (I believe 5).
This was really cool and I'll try it more once I get a faster computer.

Flight 6:
After reflashing ArduPlane 2.66 (normal software), I went to the field to try some FPV flying with the new setup.
Stabilize mode worked fine, but something went wrong everytime I tried engaging RTL (same behavior approx four time).
First the plane started climbing to configured altitude (100m), while starting to bank as if it were heading back to my position.
But when reaching set altitude, the plane started heading for the ground with slight right bank.
It never fully made a complete circle. The behavior (after climb) was almost identical to Flight2 when I had turned off the transmitter...
I managed to save the plane all four times, but I can't figure out what is causing this behavior.
I also tried FBW-A mode, the plane was quite hard to "move" in this mode, also I was unable to bank to the left at all, but right was ok (stopped at approx 45 degrees).


I suspect either the following:

  • I've got wierd values of RC_XTRIM parameters if I power the APM before powering the Rc transmitter. Values become 1200 or something. These values should not however been in effect when I flew, since I always reset the APM and redo calibration right before taking off if I remember correclty, which should again give me correct RC_TRIM values right? If I would fly with the bad values, possibly this is causing the plane to be "Nudged" in RTL/Circle mode? Could also cause the unable to bank left issue in FBW-A? Im thinking of disabling the Nudge (by editing code) for my next flight to be sure this is not happening (in Attitude.pde, stabilize()).
  • Perhaps the lingering waypoints from HIL simulation was causing the wierd RTL behavior in Flight 6? Is waypoints targeted after RTL has taken the plane "home" or something? I've done in CLI: setup->reset which should clear the waypoints for my next flight.
  • Possibly the rearrangement of the board is changing the PID settings needed or something?

Other than these above theories (which are quite vague in my opinion) Im all out of ideas
Anyone out there who have an idea of what is going on with the wierd Cirlce and RTL behavior?

I have param files, log files and onboard video for most of the flights if anyone is interested...
attached are logs for Circle mode fail, and Flight 6 RTL fail.

params.param

Flight2.zip

Flight6.zip

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

  • Hi,

    Yeah it's time to dog through the source code and find out what ArduPlane really wants to happen with the alititude in RTL mode.

    I had my issues with it too, although differently: Once I had a sporadic change into RTL. It was not an R/C signal loss that caused it, becuase the receiver was not set to output the RTL mode channel value at reciever failsafe, and not the ultra-low throttle for APM failsafe either. Not a big deal really - but unfortunately that made it skip the waypoint that should get it to climb over the hill that was between its position and the launch site...

    My idea is something like: When RTH is engaged at a lower altitude than home altitude + 100m, it should immediately climb to home altitude and then cruise home. When RTH is engaged higher than home+100m, maintain altitude and cruise home, then descend.

    The altitude is a 50/50 mix of GPS altitude and airpressure altitude. Since meteorlogical air pressure varies and GPS altitude takes some time to get right, there are uncertainties. I don't know the exact logic of when ArduPlane sets the home altitude and whether that is overwritten when writing a mission plan... I plan missions to absolute altitudes, so of the home altitude is, say, 40 m too high at startup the plane will fly 40m too low, which might get me a CFIT. If you plan with relative to home altitudes, it will of course cancel any offset BUT I don't know if it could happen that the home altitude is recorded while the GPS altitude is still has an error of x meters, and then during the flight GPS altitude accuracy will improve, causing an error of x/2 meters for the rest of the flight...

    Altitude to the right of the horizon in Flight Data is absolute m above MSL.

    Yaw also has two sources, gyro and compass. When you keep the plane on the ground, does yaw vary when moving servos around and/or applying throttle? You have to test this 2 times, with the nose turned 90 degs in betweeen, because if the suspected noise field happens to be parallel with the Earth magnetic field you won't see any effect.

    If your horizon in Flight Data shows plausible data, gyros are OK. Strange only that you have sluggish Stabilize leveling. Here, the plane slams the nose right into horizontal when flicking from manual to stabilize, looking quite terrible in videos..

    Regards

    Soren

  • Hi,

    Was/is the plane in good trim in manual flight? It should fly about straight with sticks centered. Ideally it should also recover from too low airspeed by dropping the nose a little, andpitch up in a dive until about level.

    You did remember to level the plane every time, right? Meaning, connect to the plane from Mission Planner or similar, and press the Level button under ArduPlane level in configuration.

    Also, it is important that the plane sits still while the APM starts up and flashes with the LEDs, calibrating gyros. If not, it will simply fly manual mode no matter which mode you select. I always check before flight by switching to Stabilize, rolle and pitch the plane in my hand and see if the control surfaces react. If not, probably the gyro calibration had faield because of movement.

    I have experienced that the APM accepts the GPS coordinates even when the altitude is still very inaccurate. It then offsets the altitudes in the flight plan with the inaccurate altitude, and flies too high or too low through the mission. Now, I always connect a spare battery that I use for "ground service", let the APM start up, have a coffee while checking the mission etc once again, and check the altitude in Flight Data. It will often be way off, but after a push on the reset button on the APM (remembering again not to let the plane move) it will get better.

    As far as I know, Circle does nothing to maintain altitude (but Loiter does). It doen't maintain position either, but just drifts about. Does the plane fly level in Stabilize with the sticks centered?

    Regards

    Soren

This reply was deleted.

Activity