Team,

Presently I am doing work on multicopter modeling and control. One topic of interest to me is how can the tilt dynamic model of a multicopter be accurately determined from flight data, without disabling the controls or injecting any sort of intrusive signals. It turns out it can be done from normal flight data using a few basic concepts from signal processing. The method is described here. The above plot is the measured pitch dynamic impulse response of my draganflier. The x axis is time. The y axis is the pitch rate impulse response to an impulse command sent to the ESC. There are two curves in the plot. h(t) is the response, computed from flight data. H(t) is an exponentially decaying sinusoid fitted to the measurement. In this case, the Laplace transform of the impulse response is 5/(s*s+4*s+29), which is of exactly the form you would expect to arise from an analysis of fixed pitch control. Basically, in the case of my draganflier, there is about a 0.25 second delay between the time a new tilt rate is commanded to the motors and when quad begins tilting. I have measured a similar delay for the ArduCopter. The cause of this delay is mainly the inertia of the propellers, which delays the response of propeller thrust to change in motor torque, and the inertia of the quad, which delays the tilt rate response of the quad to propeller thrust.

As a check on the accuracy of the method, it is possible to convolve H(t) with control inputs to predict tilt rate. The following is a comparison of measured and predicted pitch rate during a flight of my draganflier.

Don't get too excited about the way the model seems to predict the high frequency features. If you are curious about that, read my report.

From the form of the tilt dynamic model it is possible to determine the form of an optimal feedback controller. It is not a PID controller. But that will be the subject of another report.

Best regards,

Bill

## Comments

Hi Brian,

The reason I zeroed out the first three time steps in the spreadsheet is that there is a processing latency of about three time steps in the MatrixPilotQuad software, which I estimate the total is as follows: the time the data is measured (1/2 time step), response is computed (one time step), pulse is generated for the ESC (one time step) and ESC response (1/2 time step). I was not sure what the algorithm really produced for negative time of the impulse response. Also, I was pretty sure that the actual, physical impulse response for small values of time should start from zero and rise positive.

Best regards,

Bill

Thanks for the explanation Bill. I guess I am a bit surprised that the measured transfer function is stable if feedback is not a factor. But, I am new to quads. I got into them with the intention of developing a model following-type controller instead of the typical PID one, so I've been reading your post and comments with great interest. BTW, I was looking through the spreadsheet, why are the first three timesteps zeroed out for t & h(t)?

Team,

By the way, I would expect that the details of the tilt impulse function of a quad will depend on flight conditions. In particular, I would expect that the following four situations would produce slightly different responses:

1. Hover in ground effect.

2. Hover at altitude.

3. Steady state forward flight.

4. Accelerated flight.

I would expect the impulse response functions for each of these situations would be approximately the same, with just some slight variations in the parameters of the model. But that is just my opinion at this point. Once the weather gets better here, I will go outside and gather more test data to make some quantitative conclusions.

All of the test data that I have used so far has been from flights in which I hovered the quad for 10 minutes, sometimes in ground effect, sometimes at altitude. I do not have any data yet for forward flight or for accelerated flight.

Best regards,

Bill

Hi Brian,

I am rather sure that the negative response is due to the motion of the air in response to the thrust of the propellers. In any case, I know that it is not due to the closed loop response.

Just to be clear what the method computes, and what the impulse response function that I computed is: it is the

of the tilt rotation rate of my draganflier to aopen loop responseprovided to the motors, computed from the inputs to the motors and tilt rotation rate during a normal flight, with the control loops engaged.single, short, impulseThe interesting thing about the technique that I am using is that it measures the response of the quad to inputs to the motors, regardless of the closed loop response of the system, and regardless of the particulars of the inputs to the motors,

.provided all inputs to the dynamic model are accounted forThe only unaccounted input to the dynamic model that matters is the vibration of the motors and propellers. And that certainly gave me some trouble at first. Vibration did cause the computations to produce a distorted result. Though what it did was to create a negative response at the beginning, not at the end.

The problem with vibration is that it creates an output (rotation rate) that is not caused by an input (motor control signals), so it cannot be fit by a causal model.

But once you somehow deal with vibration, the method is "clean".

If you read through the equations in my paper, you will see that the method will work no matter what the nature of the input is, even if it is the result of feedback, provided that the matrix computed from the autocorrelation of the input is invertible. That matrix is invertible for all of the flights that I made. Its actually very well behaved.

The autocorrelation matrix contains the information about how the feedback loop "colors" the input to the motors. If it were not for the feedback, the autocorrelation of the input to the motors computed over a long flight would be an impulse function. However, because the feedback depends on the rotation of the quad, there is some interesting behavior that shows up in the autocorrelation matrix. Then, the inverse of the autocorrelation matrix compensates for the fact that the model that we are trying to estimate is inside of a closed loop. If you look through the spreadsheet for the computations on the data from my test flight, you will see that inverse of the autocorrelation matrix is not the identity matrix.

By the way, I have used this particular method before in several projects for my day job. It is well documented in the literature and in books on signal estimation theory and is known to work even if the system being estimated is inside of a control loop.

Best regards,

Bill

Hi Bill,

Thanks, aerodynamic effects sounds plausible.

Real time dynamic model in flight sounds exciting. I am currently retro-fitting one of my quads (I have three, all home-built with no direct relation to Arducopter) with a BeagleBone as a control board. The higher compuational horsepower should allow for exploring more interesting control strategies... I will look out for your future write-ups.

Marko

Wouldn't that negative response just be a result of the closed loop response since you've got stabilization engaged?

Hi Marko,

There are a couple of directions I am exploring after this. One of them is to design a controller that takes advantage of the form of the tilt dynamic model. The result is that the controller can compensate for the time lag of the dynamic model. I have already done that, I just have to write it up. The other direction is to work out a way to compute the dynamic model in real time during the flight.

Regarding the negative impulse response after about 0.65 seconds, I think that is due to air motion. There is an action-reaction effect. The change in thrust of the propellers accelerates the rotation of the aircraft in one direction, and the reaction force on the air accelerates the air in the opposite direction. So, after the response of the propellers decays, there is some residual air circulation in a direction opposite to the initial rotation of the aircraft, that takes a little while to dissipate.

Best regards,

Bill Premerlani

Hi Bill,

Great analysis! I am looking forward to seeing where you might go with this...

Do you have any intuitive insight as to why the impulse response becomes negative after about 0.65s? Perhaps I misunderstood, but I thought your independent variable x is the pitch command (or at least something proportional to it) send to the motors, i.e. something that comes out of your control loop and gets send directly to the ESCs. If this is the case, I would have expected the model to respond to an impulse with a (delayed) positive rate that eventually attenuates to zero due to aerodynamic friction, without a sign change. Your plot seems to indicate that the model initially responds like that, but eventually starts to rotate backwards a small amount.

Assuming this is indeed the behaviour and not a numerical artifact, is this maybe a 'pendulum effect' of the quad having a center of mass below the center of lift? Or could this be the breakdown of the linear approximation? Or perhaps a purely aerodynamic effect?

Maybe you already thought about this and have some insight...

Marko

Hi Tom and Tridge,

Regarding the sources of noise on the gyro power bus, I found the biggest culprits are servos. It is best if you can power servos separately from the electronics, especially if they draw a lot of power. I found that with quads, since there are no servos, and there are no large power draws from the BEC, the noise on the gyro power bus is not too bad. Still, the best approach, in my opinion, is to provide regulated power to the gyros.

Best regards,

Bill

Tridge,

Some food for thoughts;

Having browsed through the specs for MPU-6000 I would like to highlight this:

GYROSCOPE ZERO-RATE OUTPUT (ZRO)

.....

Power-Supply Sensitivity (1-10Hz) Sine wave, 100mVpp; VDD=2.5V 0.2 º/s

Power-Supply Sensitivity (10 - 250Hz) Sine wave, 100mVpp; VDD=2.5V 0.2 º/s

Power-Supply Sensitivity (250Hz - 100kHz) Sine wave, 100mVpp; VDD=2.5V 4 º/s

Note that the sensitivity of supply ripple at a great extent occurrs in a frequency range where we have no means of recording in flight. It neads hookup on oscilloscope and/or spectrum analyzer. Nota bene that the most sensitive range is above 250 Hz. It is very possible that our installations have ripple in this range due to the origin of our supply voltage (various BEC:s, co-located with ESC power electronics). And as far as I understand, the APM2 has nada voltage regulation on board...

About sampling frequency (and integration); I was reliefed to read that the MPU-6000 allows gyro sampling to be programmed up to 8kHz. The accelerometers are limited at 1kHz, I don´t know how significat that limitation is (Bill?).

I noted that the MPU-6000 features a programmable digital low pass filters, independently programmable on the gyro output and accelerometer outputs. Do you know wether those filters engaged as per today?

Finally, the angular speed max range is also programmable. Do you know what range we operate the MPU at as per today? Is there currently any risk of vibration induced sensor saturation in poorly balanced installations?

Cheers / Tomas

Next