Code Of Arms

You are not logged in.

Please Log In for full access to the web site.
Note that this link will take you to an external site (https://shimmer.mit.edu) to authenticate, and then you will be redirected back to this page.

Quick Reference

Serial Plotter Send Window Indices

Links

  • Build instructions are here.
  • Sketch for this lab is here.
  • Matlab script for the second half of this lab here.

Task Summary

Week A

  1. Build, Calibrate, and Test the Arm Control System (Checkoff 1).
  2. Investigate the behavior of your arm when using only proportional feedback, K_p, and examine the behavior of difference estimates of the derivative as you change the derivative estimation interval m (Checkoff 2).
  3. Assume arm acceleration is linearly proportional to motor command (instant thrust model) and construct a state-space description for the associated proportional-feedback control system. Compute the system's natural frequencies using Eigen-analysis, and determine if they are consistent with measurements (First part of Checkoff 3).
  4. Experimentally investigate the impact of changing proportional feedback gains, derivative feedback gains, and derivative estimation intervals, on arm performance (rest of Checkoff 3).

Week B

  1. Calibrate the proportionality constant in last week's instant thrust model by comparing model natural frequencies to measured arm behavior (under proportional control). Then use our Matlab (or your own) script to compare measured to predicted step responses for combinations of proportional and derivative feedback gains (Checkoff 4).
  2. Calibrate \gamma_a and \beta_a coefficients for the non-instant thrust model by comparing computed and measured step responses (under PD control). Test the model's range of applicability (Checkoff 5).
  3. Add integral feedback to your model, and use the model to design a good PID controller. Compare with experiments, and then investigate how the integral term effects steady-state errors when you introduce disturbances. Take screen shots with and without the integral term for the POSTLAB! (Checkoff 6).
Introduction

In the last lab you modeled and determined control parameters for a motor speed control system, a relatively stationary example, and in this lab you will fly! Well, maybe "fly" is a bit of an exaggeration, though there will be motion. You will build a propeller-thrust-driven rotating arm, and you will control the arm's position by using angle measurements to adjust propeller motor drive. Perhaps a few videos...

The videos below show the results using versions of the propeller arm from previous terms. You can thank the many suggestions from former students for the elegant simplicity of the version you are building this term.

Arm Wrestling

In the videos above (again from earlier term arm designs), we show three propeller arm control systems. In the top video, we show what would happen if we used the same proportional feedback controller we used for speed control. In the bottom left, we show a video of using a PID controller, like the one you will be able to design by the end of this lab. And in the bottom right picture, we show you the kind of controller you will be able to design by the end of the term (after we cover state-space and observers).

The Key Challenge

As the above abstract block diagram (on the left) suggests, controlling the rotation angle requires three interconnected functions, an actuator, a sensor and a controller. Our angle sensor generates an analog voltage proportional to rotation angle, much more direct than the optical encoder sensor used for speed control. But as indicated by the above figure (on the right), our actuator is far more indirect. The controller sends commands to the motor, motor to thrust, thrust to arm acceleration, arm acceleration to arm velocity, and finally, arm velocity to arm angle. The layers of indirection make the control problem challenging, but not uncommonly so, most systems using force-based actuators are similar.

Control Design Approach

Like before, you will model your system and then use the model to help determine a good controller, though for the arm angle control, the modeling and controlling is more complicated. So, you will start with a simple proportional feedback controller, measure the arm behavior, and use those measurements to calibrate a second-order difference equation model of the arm. Then you will use your arm model to determine how the controlled-system's natural frequencies change as a function of proportional(P) and delta(D) (or derivative) feedback gains, and use that insight to design a good PD controller. Success! -ish.

It is possible to find an "okay" PD controller using the second-order arm model, a model accurate enough to predict failure for proportional-only control, but not much more. To achieve better performance, you'll need a more sophisticated controller, and to tune it, you will need a more comprehensive arm model. In particular, you will add an integral (or summation) term to your controller (the "I" in PID), and then tune the three gains (proportional, K_p, derivative, K_d, and integral, K_i) using a model that includes a non-instant relation between changes in motor command and the resulting changes in propeller thrust. And to analyze this complicated controller and model system? For that, you will need to make use of the more sophisticated analysis techniques you've just learned.

Assemble and Test

Please build the propeller-arm control system as described here. Be sure to complete the testing at the end of the assembly guide so that:

  1. the angle sensor axle is oriented correctly,
  2. the measured angle displayed by the serial plotter is zero when the arm is horizontal,
  3. and you've adjusted the nominal motor command so that the associated propeller thrust holds the arm level (that is, horizontal).

Checkoff 1:

Demonstrate your calibrated arm holding itself level (with the low proportional gain given in the assembly guide) and that your serial plotter shows a measured angle of zero

  • Try blowing on the arm after you have calibrated the nominal command. How well does the arm hold position?
  • If you set K_p = 0 when trying to level the arm, can you adjust the nominal command so that the arm remains at -0.75 radians (approximately -45 degrees)? How about adjusting the nominal command so that the arm is remains at +0.75 radians? Can you explain what happened (maybe think about apples?).

Experiment with Proportional Gain

For the second checkoff, we would like you to try some preliminary experiments with proportional feedback, to help you develop an appreciation for the differences between the arm angle and speed control problems. We strongly recommend taking "screen-shots" of the serial plotter (after pausing it) as you run these experiments, and recommend you read through the checkoff questions BEFORE YOU BEGIN. It will help you focus your effort.

Once you have set the nominal command, please use the same setup to experiment with increasing the proportional gain, K_p, using the following approach:

  1. Use the send window to set an new K_p (type "3 0.6" for example).
  2. Hold the arm (with your hand) so that the serial plotter shows the arm is about 60 milliradians above horizontal.
  3. Let go and be prepared to pause the plotter!
  4. Try again with a new K_p

You should be able to find K_p's in the range \frac{1}{4} < K_p < 2 that produce both stable and unstable oscillating behaviors (like the two figures below). Try to find one that is stable (decays to zero like the first figure below), and one that is unstable (like the second figure below). Be sure you included the over-rotation limiter and are ready to unplug the big power suppy!. Also, try to find the smallest K_p that results in unstable oscillations.

Examining Cmd and DEdt/10

Once you have found a pair of K_p's (one producing decaying, and the other growing, oscillations), turn on the serial plotter plots for the motor command and the derivative of the error, and redo your growing oscillation experiment. You should be able to produce a figure like the one below.

The DEdt plot shows a difference approximation to the time derivative of the arm angle error. The error is defined as the desired minus the measured angle,

e[n] \equiv \theta_d[n] - \theta_a[n],
and the difference approximation to its derivative is given by
DEdt[n] = \frac{e[n]- e[n-m]}{m\Delta T}
or in block diagram form

where

m = 1 + extraBack
indicates how far backward to look for a difference sample . If m is large, the "derivative" is less noisy, but is less "up to date". If m is small, the "derivative" is noisy, but is also more immediate. A typical case is shown in the figure below.

Try increasing m (integers between 1 and 10) using index 0 (EXTRABACK) in the send window. You should be able to set m to produce a figure like the one below.

Checkoff 2:
  • What was the largest value of K_p for which your system was stable (the oscillations decayed)?
  • What was the smallest value of K_p for which your was unstable, and what was its the oscillation period (measured before the amplitude exceeded 0.5 radians).
  • When you examined the plots of angle, command and DEdt, how were the waveforms related, and why? Did the peaks in the oscillations line up? Why or why not?
  • What would happen if you set m to 100 or 200?

Modeling

In this section, we assume that the motor command and arm acceleration are related by a scaling factor, and use that model to determine a second-order difference equation model for propeller arm system with proportional control.

The Structural and Functional Blocks

The main structural components of our angle control system are blocked out below.

The connection between the structural components and the abstract control functions are detailed in the figure below.

In the above diagram, the command to the actuator (the motor command) is divided into two parts, C = C_{nom} + c. Note that C_{nom} was set to a fixed value during calibration, one that produced a thrust that exactly cancelled any torques due to gravity when \theta_a = 0 (the horizontal arm case). Therefore, as long as we consider small rotations from horizontal, we can ignore C_{nom} and gravity, and develop models that relate arm acceleration to c alone (note "little c").

From angular acceleration to angle

Before diving into the deep end (the deep end being modeling the relation between motor command and arm acceleration), let us consider the relationship between acceleration and velocity, followed by the relationship between velocity and angle.

Just like linear acceleration, if the angular acceleration is a constant, \alpha_a[n-1], for the time between the n-1^{th} and the n^{th} sample, then the change in angular velocity, \omega_a, is given by

\omega_a[n] = \omega_a[n-1] + \Delta T \cdot\alpha_a[n-1],
and the change in angle is approximately
\theta_a[n] \approx \theta_a[n-1] + \Delta T \cdot \omega_a[n-1]
where \Delta T is the time between samples in seconds.

We can assemble the above pair of difference equations into a two-state state-space description,

\begin{bmatrix}\theta_a[n] \\ \omega_a[n]\end{bmatrix} = \begin{bmatrix}1 & \Delta T\\ 0 & 1\end{bmatrix} \begin{bmatrix}\theta_a[n-1] \\ \omega_a[n-1]\end{bmatrix} + \begin{bmatrix}0 \\ \Delta T\end{bmatrix} \alpha_a[n-1]

A simple model relating motor command to arm acceleration

As we noted above, if the c part of the motor command is non-zero, then the propeller produces a thrust that is not entirely cancelled by gravity, and that excess thrust will accelerate the arm. The simplest motor-command to arm-acceleration model is to assume linear proportionality. That is,

\alpha_a[n] \approx \gamma_a c[n].
where \gamma_a is the (scalar) proportionality constant.

If we examine the description of the actuator in section 4.1, we can see that we are greatly simplifying a complicated process. And what is that complicated process? Roughly: increasing the motor command increases the duty cycle of a Teensy-generated pulse-width-modulation (PWM) signal, which increases the PWM duty cycle, which increases the average motor voltage produced by an H-bridge driver, which increases propeller speed, which increases thrust, which accelerates the arm. Whew, seems like a lot of steps to model with one proportionality constant. And in addition, we already know the relationship between motor command and propeller speed is not instantaneous, because we modeled that as part of the first lab.

So, the simplest model won't be perfect, models never are, but some are useful. Let us see if this one is. As a first step, let us use the model to eliminate \alpha_a from our state-space description,

\begin{bmatrix}\theta_a[n] \\ \omega_a[n]\end{bmatrix} = \begin{bmatrix}1 & \Delta T\\ 0 & 1\end{bmatrix} \begin{bmatrix}\theta_a[n-1] \\ \omega_a[n-1]\end{bmatrix} + \begin{bmatrix}0 \\ \gamma_a \Delta T\end{bmatrix} c[n-1].

Control

If the goal is to use feedback to keep our propeller arm level, it would be natural for the motor command to be proportional to the negative of the distance from level. As we have seen analytically (and somewhere dramatically in the first lecture), proportional control can be unstable, but can it be stabilized? Will our model help us decide?

Proportional (P) Control

By proportional control (assuming the desired angle is zero), we mean

c[n] = K_p\left(-\theta_a[n]\right),
where c[n] is the perturbation from the forcing-balancing-at-horizontal nominal command to the motor (which we can ignore as noted above), K_p is our proportional gain, and \theta_a[n] is our measured arm angle.

Using c[n] = K_p\left(-\theta_a[n]\right) in our state-space description,

\begin{bmatrix}\theta_a[n] \\ \omega_a[n]\end{bmatrix} = \begin{bmatrix}1 & \Delta T\\ 0 & 1\end{bmatrix} \begin{bmatrix}\theta_a[n-1] \\ \omega_a[n-1]\end{bmatrix} + \begin{bmatrix}0 \\ \gamma_a \Delta T\end{bmatrix} c[n-1],
results in
\begin{bmatrix}\theta_a[n] \\ \omega_a[n]\end{bmatrix} = \begin{bmatrix}A_{11} & A_{12} \\ A_{21} & A_{22}\end{bmatrix} \begin{bmatrix}\theta_a[n-1] \\ \omega_a[n-1]\end{bmatrix}.

Analysis

What are A_{11}, A_{12}, A_{21}, A_{22} as functions of \Delta T, \gamma_a, and K_p? What do the eigenvalues of

\mathbf{A} \equiv \begin{bmatrix}A_{11} & A_{12} \\ A_{21} & A_{22}\end{bmatrix}
tell you about the natural frequencies, and the stability, of the proportional feedback system? And can you compute those eigenvalues analytically?

Proportional+Derivative (PD) Control

Physical analogies can be misleading when first learning about feedback control, but in the case of the propeller arm with PD control, perhaps the intuitive insight is worth the risk. So, consider the above proportional control experiments on the arm. After you set a gain, you pull on the arm, then let go and then watch the arm oscillate. That sounds a lot like pulling on a spring, then letting it go, and watching it oscillate. Also, spring forces are typically proportional to displacement from equilibrium, with stiffer springs generating larger forces. Analogously, proportional feedback produces a "force" for the arm is proportional to the error in angular position, with larger values of K_p generating larger "forces". So isn't using a larger K_p like switching to a stiffer spring, don't they both result in faster oscillations?

Pull on a spring, and at least in this reality, its oscillation will not grow in time. That is, springs don't go unstable but our arm does. Nevertheless, if one sticks with the spring analogy, then one might be tempted to try "damping" the spring's oscillations by adding a friction term. Friction forces are typically proportion to velocity, the time derivative of position, so perhaps it is not so surprising that one can "damp out" the arm's oscillation by adding a feedback term that is proportional to the position error's time derivative.

From the above analogy, perhaps we can stabilize proportional control with

c[n] = K_p\left(-\theta_a[n]\right) + K_d \left(-\frac{\left(\theta_a[n] - \theta_a[n-1]\right)}{\Delta T}\right).

Experiment

Try the following experiment, what does it tell you about adding "derivative" feedback?

  1. Set K_d = 0.1 (type "1 0.1" in the send window) and K_p = 0.5
  2. Hold the arm (with your hand) so that the serial plotter shows the arm is about 60 milliradians above horizontal and then let go. Be sure to note the behavior.
  3. Repeat the above two steps with K_p = 1.0, then 1.5, and then 2.0. What happens? What changes if you double K_d?

Checkoff 3

Checkoff 3:
  • Show how you determined formulas for the natural frequencies for the P controlled system, and show plots (in the complex plane) of the natural frequency versus proportional gain. Can you make observations about stability without knowing a numerical value for \gamma_a?
  • What does your analysis predict about the stability of the P controlled system? Does that analysis match your experiments?
  • What did your experiments indicate about the stability of PD control? Can you find a K_d that will allow you to use K_p =5? How about K_p =10?
  • Does increasing extraBack help when using high values for K_d? How?
  • Set K_d=0.2, K_p=2, AMP=0.3, FREQ=0.1. What happens to the step responses as you increase EXTRABACK from 0 to 50.
  • If you have time: set K_d=0.05, K_p=0.5, AMP=0.3, FREQ=0.1, EXTRABACK=0. Can you explain the difference between the rising and falling step responses?

STOP HERE FOR WEEK A!!!!

Better Controls, Models, and Manipulations

PID (Proportional, Integral, Derivative) controllers are ubiquitous in feedback systems, though for discrete-time systems, it would be more accurate to refer to such controllers as PSD (Proportional, Sum, Delta). An ad-hoc approach to designing a PSD controller is to select a proportional feedback gain, K_p, and then increase the gain of the Delta (or derivative) feedback, K_d, until the step response is sufficiently stable. Finally, add Sum (or integral) feedback, with gain K_i, to eliminate any remaining steady-state error.

So if we can easily run experiments, even automate the running of those experiments, what is the value of modeling? With a model we can get far more information that just the result of a single input-output experiment. In particular, we can compute the closed-loop system's natural frequencies as a function of PID controller gains, K_p, K_d, and K_i,, which will tell us how the system will response to a whole of range of inputs and disturbances. In addition, we can even generate plots of how those natural frequencies move as a function of a parameter, a generalization of the so-called "root-locus" plot. Such plots can tell us what is feasible, like when we used a plot of natural frequency versus proportional gain above to show it was impossible to stabilize the arm with proportional gain alone. Finally, we can use the model to solve a minimax problem with respect to the magnitude of the natural frequencies. That is, we could let the computer search through millions of senarios, to find the gains that minimize the closed-loop system's maximum magnitude natural frequency. We would then be sure that resulting closed-loop system would be fast, and that any errors would decrease rapidly. But we digress. There is much to the story of data and models, some of it with connections to machine learning, and this issue will reemerge many times during the semester.

In the second half of this lab, we will focus on using our understanding of natural frequencies to calibrate progressive more complete models of a propeller arm system with PID control. We have included a state-space based matlab script (rootPlotLab02SS, linked on the top of this page) that you can use to examine initial condition responses, and create parameterized plots of natural frequencies, both to help with model calibration and controller design. We use state-space because: it is easy augment the state-space representation, its system matrix eigenvalues are the natural frequencies, and it is easy to "plug-and-chug" the state-space respresentation to simulate our system's zero-input response, which will allow us to compare model and experiment and improve our model's calibration.

We will start by calibrating \gamma_a in the model for which we assumed that thrust is proportional to motor command, using the natural frequency formula we derived last week. After demonstrating that the instant-thrust model is inaccurate, we will augment the model so that propeller thrust does not change instantly with motor command (because thrust is related to propeller speed, and from the speed control lab we know motor speed does not change instantly with changes in motor command), and calibrate the associated \gamma_a and \beta. Finally, we will make use of the third term in PID, the "integral" or sum term, but now we will have three gains to set, K_p, K_d, and K_i. Fortunately, we will have a calibrated model of the arm system, we can add the integral term to our model, use the model to determine reasonable gains, and then use those gains on the arm.

Calibrate and Test the Instant-Thrust Model

Last week, you found the smallest K_p gain for which your arm produced a growing oscillations. Redo your experiment for the K_p you found before, and then repeat it with a doubled K_p. During each experiment, be sure to pause the serial plotter quickly, so you can measure the oscillation periods (using the plotter's curser) when the growing oscillation amplitude is still small. Keep in mind that \Delta T = 0.001 seconds, and that the plotter plots every tenth sample (SO MULTIPLY THE NUMBER OF PLOTTED POINTS IN ONE PERIOD BY 10 TO GET NUMBER OF SAMPLES)!

By comparing these measured oscillation periods to the natural frequency formulas you derived last week, you should be able estimate \gamma_a for your model, as well as test its prediction (have a quick look at Week 3b lecture notes and sections 4 and 5 of the oscillating prelab, or ask for help). You can also compare your responses to simulation produced by our matlab script (you can use the on-line version of matlab, every MIT student has an automatic account, see here. Using the script is summarized in the figure below (note that zoom is on line fourteen of the script).

The matlab script implements the simple motor command to acceleration model, the same one you calibrated above using oscillation periods of the destabilized arm. Note that we have implemented a zoom feature (line 14), and show the plots of natural frequency trajectories with and without the zoom set to true. Note that because all our natural frequencies are extremely close to one, the zoomed natural frequency plot is much more useful.

Please keep in mind that you will have to scale your experimental results when comparing to matlab ZIR responses. And note that you can also use the matlab script to analyze the case with PD control with your calibrated value for \gamma_a as shown in the figure below.

Try the following experiment, and compare the results to the matlab simulations above (remember that linearity implies that the step responses below have the same form as the ZIR simulated above).

  1. Set K_d = 0.1 (type "1 0.1" in the send window) and K_p = 0.5
  2. Set the step frequency to 0.2 (type "5 0.2" in send window), and then set the step amplitude to 0.05 (type "6 0.05"). Check that the arm moves from just a little below level to a little above.
  3. Gradually increase K_p, to K_p = 1.0, and then 1.5, and then 2.0. Does the arm go unstable? Are the natural frequencies computed (and ZIR responses) computed by the matlab script consistent with that instability?

Checkoff 4:
  • Be prepared to describe how you determined \gamma_a from your measured oscillation period and your formula for natural frequency.

  • How well does your calibrated model predict the step responses for PD control. Try a few sets of K_p and K_d values, does your calibrated model correctly predict the stability of your arm.

  • For gains that produce a barely stable step response (very oscillatory), turn on the command plot (CMD) in the plotter and adjust the number of steps back used in the derivative estimation, m, from one to ten (e.g. type "0 2" in the send window to set m to three). Keep the value of m that minimizes the CMD noise WITHOUT worsening stability. Set that m to be the default by changing the zero on line 33 in the arduino sketch #define offsetExtraBack 0 to your optimized value of m.

  • Examine the state-space model's 3 \times 3 \;\; \bf{A} matrix on lines 38, 39 and 40 in the matlab script. Based on the elements of \bf{A}, what are states one, two and three of this model?

  • Use the matlab script to compute natural frequency trajectories as K_p varies from zero to two when K_d=0.1, and as K_d varies from zero to 0.5 when K_p=2. Do you see how to use these trajectory plots to help you design a good controller?

Non-Instant Motor Command to Arm Acceleration Model

Propeller thrust produces arm acceleration, and thrust tracks propeller speed instantly but nonlinearly, being approximately proportional to the square of the instantaneous propeller speed. Propeller speed tracks motor command, but not instantly, and somewhat nonlinearly. Together these observations might suggest we need a very non-linear and non-instant model relating motor command to arm acceleration, but that is not the case. The motor command to arm acceleration is suprisingly linear (fortuitous cancellations no doubt), though definitely NOT instant.

Above we used oscillation period measurements versus proportional control gain (K_p) to calibrate \gamma_a in the following relationship between motor command and arm acceleration,

\alpha_a[n] \approx \gamma_{a} c[n].
If we believe above the relationship is correct for very slowly changing motor commands, but not for rapidly changing ones, we could substitute
\alpha_a[n] \approx \alpha_a[n-1] + \Delta T \cdot \beta \left( \alpha_a[n-1] - \gamma_{a} c[n-1]\right),
where \beta is assumed negative.

If c[n] = c[\infty], a constant, and -\frac{1}{\Delta T} < \beta < 0 , then what is \lim_{n \rightarrow \infty} \alpha_a[n]?

Testing the PD controller and the model.

Implement the above non-instant model in the matlab script (look for lines in the script labeled *FIX THIS, lines 42,43 and 45) and calibrate the values of \gamma_a and \beta by matching the simulated ZIR responses to measured steps on the arm for various values of K_p and K_d. Keep in mind that the matlab model is linear, so keep your step sizes small (e.g. "6 0.05"), Also, it is easier to match waveforms that are highly oscillatory waverforms.

If you modified the matlab script to include the non-Instant model, then you should be able to produce a plot like the one below.

Checkoff 5:
  • Adding the angular acceleration equation to your model will increase the number of states to four. The associated 4 \times 4 \; \bf{A} matrix is computed on lines 47 through 50 of the matlab script. Based on examining row three of the matrix (line 49 of the matlab script), what is the fourth state?
  • Show us your changes to the matlab model, and show that the matlab simulations predict the behavior of your system (remember to stick to small step sizes, amplitudes of 0.05).
  • What values did you get for \beta and \gamma_a?
  • Does your new model correctly predict the onset of instability? When your arm's step responses are decaying oscillations, do their decay rates and oscillation periods match the simulation?
  • What happens if you set m to 5, 10 or 20? Can you use larger values of K_d and then larger values of K_p ? What is the advantage of using higher K_p values (think disturbingly)?

Sum (Integral) Feedback

We can add an integral, or more precisely, a sum feedback term to our controller. The advantage of including an integral term is that any persistent error, no matter how small, will cause the sum to grow steadily. When the sum term is large enough, it will cause an adjustment to the motor command, persumably an adjustment that eliminates the small error.

The motor command with the proportional, delta, and sum feedback can be described by the difference equations

c[n] = K_p \cdot e[n] + K_d \cdot del[n] + K_i\cdot sum[n]
del[n] = \frac{e[n]-e[n-m]}{m \Delta T}
sum[n] = dt\cdot e[n]+sum[n-1]
where e[n] = \theta_d[n] - \theta_a[n], del[n] is the delta ("derivative") term, and sum is the sum ("integral") term.

Testing the PID Controller.

In this section you will analyze our new closed loop system and conduct experiments to understand the model's predictive power.

  • Add the integral term to the matlab model for the controller, Ki (line 52, labeled "fix this").
  • Use your complete matlab model to design the gains of your controller. What are you going to try to minimize? Note: There are practical tradeoffs to make here. The higher the gains, the more the noise in measurement will effect the output. The lower the proportional gain (and associated K_d), the slower the response and greater the error. This choice is an open ended question. There is no 'correct' answer, but rather, many answers can be justified. Use computation and your model!!
  • How is the rejection of transient and steady-state disturbances affected by including the integral (aka sum) term? To see the advantage of using the integral term, try dropping a Lego "U" on the arm as shown in the picture below.

Checkoff 6:
  • How does the predicted behavior for your system (examine the calculated poles and plots of step responses) compare to the experimental behavior.
  • Keeping K_p and K_d terms constant, what does your model predict as the highest stable K_i ? What is the maximum K_i you determined from your experiment? Given a Kp and Kd, does adding Ki improve stability?
  • For very small values of K_i, where is the extra natural frequency added by the integral term?
  • How large must you make K_i so that your arm returns to steady-state reasonably quickly?
  • According to the linear model, without K_i, what is the steady-state error (assuming you leveled the arm perfectly).
  • Try taking larger steps, up to about +/- 45 degrees, what do you notice about the behavior with and without using the K_i term?
  • Try dropping a Lego "U" on the arm, how does the response change with a zero and non-zero K_i. Does K_i > 0 improve rejection of this steady disturbance?
  • Try tapping on the arm with a chopstick. How does the arm's response change with a zero and non-zero K_i. Does K_i > 0 improve rejection of this transient disturbance.
  • Find values of K_d, K_p and K_i so that the step response is reasonable and you get some "dropping Lego U" disturbance rejection.
  • Simulating the response to disturbances with the matlab model requires an additional modification of the script, a topic we will address that in the postlab. TAKE SCREEN SHOTS OF YOUR DROPPING THE LEGO U EXPERIMENT WITH ZERO AND NONZERO K_i, to use for your postlab.