This was my first flight tests using IMU stabilization insteed of thermopile sensors. After some PID adjustment I have nice and stable stabilization of the airplane. But... Whenever I accelerate quickly the plane goes into a dive. Or if I decelerate it pulls up. The plane is trimmed and motor mounting angle is good, so it is not that. It does not seem to be a problem with vibrations. I have mounted the IMU using vibration pads, and if I slowly accelerate the IMU maintain the correct pitch at any throttle setting. Same with deceleration. But punch the throttle and the plane goes into a steep dive. Or sharply pulls up if I let go of the throttle quickly.
My setup is the ArduIMU+ V2 with unmodified v1.7 firmware and the ublox gps.
I am currently focusing on stabilization so the only autopilot logic in use, are PID loops for elevator and ailerons using roll and pitch from the IMU as input.
You need to be a member of diydrones to add comments!
Replies
So my conclusion is:
- Using lower gains the pitch problem becomes manageable combined with slower throttle changes.
- Let the autopilot control throttle to make sure ground speed never approach zero.
The simple navigation PID control loops we are using will not be able to handle the case where ground speed approaches zero. We do a gain weighting/de-weighting based on tailwind/headwind but it will work over a limited % range from nominal speed.
You need to either (1) Fly at a faster airspeed, (2) Fly in less wind, or (3) rewrite the navigation algorithm to handle this extreme case. We did not anticipate anyone trying to navigate waypoints with zero ground speed.
I played with the Kp/Ki_ROLLPITCH gains yesterday with some interesting (and some a bit scary) results.
To simplify gain changes I made the following code modifications.
#define ROLLPITCH_GAIN 0.5
#define Kp_ROLLPITCH 0.015*ROLLPITCH_GAIN
#define Ki_ROLLPITCH 0.000010*ROLLPITCH_GAIN
Some controlled indoor tests showed ROLLPITCH_GAIN 0.1 is the minimum gain that will compensate for gyro drift with the IMU lying flat on a table. With this in mind I decided to go with ROLLPITCH_GAIN 0.25 for my first flight.
In flight everything seemed fine and pitch hold was much better when accelerating/decelerating. Just some minor dips when trying to provoke the problem. So the pitch problem seemed to be solved.
But now for the scary part. I live by the coast, so you get used to flying in windy conditions. Yesterday I was flying in approx 6m/s. I was doing a long slow turn into the wind and as the plane banked into the wind (ground speed approaching zero or maybe even negative) the plane went nuts and started oscillating up and down and sideways in a self feeding loop that just got worse and worse. I tried applying throttle but the oscillating continued. So after watching the plane doing Red Bull air racing for a while, I switched to manual and leveled the plane. I then flipped back to auto and everything was fine. I repeated the slow turns into the wind and was able to provoke the problem in about 1 of 5 tries. The problem seem to occur when the plane because of the wind, turns around it's own axis at one spot with little or no ground speed (hanging on the wind).
Now before I go and place the blame on the IMU this might be related to the PID control loops. The strong sideway winds when turning can result in large aileron and elevator movements for long periods of time to keep the plane level. This might make the PID generate high D values to "rein" in the airplane. And when the sideway force suddenly disappear as the plane turns into the wind, the D's are so off that the PID is no longer in 'sync' with IMU. I have not had time to test this by flying with D set to zero yet, but doing so should confirm if the problem is PID or IMU related.. I will come back with more data when I get the chance.
Thanks for the info. I will try adjusting the gains and post my findings. But I am still worried about hand launch and catapult takeoffs. Can the accelerometer gains be lowered enough to allow for that kind of acceleration and still remove gyro drift? Also there would be situations when flying in windy conditions where gusts of wind will quickly decelerate the plane. If the IMU pulls up the nose at that moment it leads to even more deceleration and could cause a stall.
I appreciate your input, but it sounds like you solution is a fix for the symptoms and does not address the source of the problem. Limiting the elevator movement dampens the effect so that the IMU is not able to send the plane into a dive before it stabilize after an acceleration. But the problem is still there, and is most likely related to the DCM. I would like the autopilot to be able to use large elevator movements for flying in windy conditions, stall recovery , automated low speed landings, etc. And what about automated takeoffs? As it looks now, I suspect the IMU will steer the plane into the ground if I hand launch or catapult the airplane with stabilization active.
I have encountered the same thing, my personal fix was to turn down the roll comp (i know that sounds nuts and not sure that is the result)
and also the elevator commanded movement up to 8deg and down 8deg from 15..
now i see a little down attitude, but it rockets off and keeps alt...im wondering if some of it is perception..but mine did do exactly that to start with....
The pitching up as it slows was pronounced to start with, but now its pretty good..(also increase your lowest point throttle setting, it stops it trying to stall at wp`s)
of course this is just my results..mayeb others want to chirp in on this.
hope this helps.
Mike.