3

Lecture 6 More on Estimation of J in The ¼ Quadcopter Animation

[ http://www.gperco.com/2014/05/quadcopter-stability-and-neural-networks.html ]

Recall that the closed loop system transfer function model for the ¼ quadcopter is:

. (1)

In Lecture 5 we set the controller values so that (1) becomes: . (2)

Since (2) corresponds to a harmonic oscillator with undamped natural frequency , we then proceeded to give the animation a ‘poke’, and then measure the time, associated with a chosen number of periods of oscillation, N. From these numbers, we obtained the estimate . Using this resulted in the estimate

. (3)

In class we obtainedfor . This gave . . When I ran the simulation at home, I got , which gives . In fact, time and time again, the oscillation period would become faster and then slower. This suggests that the time axis on the simulation is not real time, but rather, is processing time. We will now present a method for estimating J that does not use any time values.

The Log-Decrement Method to Estimate J

By using this method, we avoid using any time information that might be influenced by how fast/slow the simulation runs on a given computer. Recall that the decay envelope for a second order underdamped system has the form . Let where the time aligns with any chosen oscillation peak. Let where aligns with a peak that is m peaks after the peak at . Then we have the measurable amplitude ratio:

. (3)

The damped natural frequency is , so that the damped natural period is . Hence:

. (4)

Substituting (4) into (3) gives the amplitude ratio:

. (5)

Solving (5) gives: . (6)

To relate (6) to J we consider the transfer function

. (7)

. (8)

Solving (8) gives:

. (9)

Choosing gave the plot at right, from which . In this case, (6) becomes: .

Consequently: .

So we have: .

The theoretical impulse response is shown at right.

We are now in a position to design a full PID controller. To this end, it can be shown that

. We will choose:

, , and

And so: .

Hence:

For : .

Figure 1 Theoretical (left) and simulation (right) impulse responses.

Conclusion Clearly, there is something wrong with the simulation. In relation to the influence of the value for J, notice that . So, no matter what value for J is used, the PD gains relative to must be and . So long as such ratios hold, the shape of the theoretical impulse response will remain the same. For any gains with this ratio the simulation is unstable.

[Note: Using the gains gives the simulated response below at right. The corresponding theoretical response for is shown at middle, and that for is shown at left.

Figure 2 Theoretical responses for and (left), (middle), and simulation (right).

The overall shape of the simulation response is more like that of the theoretical response in Figure 1, than in either of the above responses.

QUESTION: The response at left takes a long time to reach zero. How would you determine the length of time it takes to (essentially) reach zero?

ANSWER: ______

Uncertainty in the Log Decrement

%PROGRAM NAME: logdec.m

MU_Y0=5; STD_Y0=0.2;

MU_Y2=2.5; STD_Y2=0.15;

nsim=10^5;

y0=normrnd(MU_Y0,STD_Y0,nsim,1);

y2=normrnd(MU_Y2,STD_Y2,nsim,1);

r2=y0./y2;

d=log(r2);

z=d./sqrt((2*pi*2)^2 + d.^2);

mean(z)

std(z)

Figure 3 Histogram for the estimator of with .

The mean and standard deviation of are: .

Remark With very little effort, we were able to arrive at a quantitative assessment of the uncertainty associated with using the log decrement method to estimate the damping ratio . In the case considered, the uncertainty is ~30% of the mean.

Systems engineering is infiltrating all engineering disciplines in a big way. Model uncertainty is a central concept in systems engineering. Hence, on occasion throughout this course, I will inject statistical elements such as the one above. If you want a more comprehensive treatment, I would suggest that you take my section of STAT305.