ME 368 Laboratory 12 Understanding controllers, tuning, and disturbances

Laboratory12

Understanding controllers, tuning, and disturbances

Equipment Needed

  • Resistance substitution box
  • Capacitance substitution box
  • NI myDAQ / LabVIEW

Goals and Objectives

  • Tune KP, KI, and KD values using recipes such as the Ziegler-Nichols recipe as well as manual adjustments
  • Gain familiarity with the controller you will be using in Lab 13 so that you are prepared to do a good job controlling the temperature of a hot air jet.
  • Understand the concept of a disturbance and how to evaluate a controller’s role in correcting it

This lab is intended to be a lighter lab, so you have time to work on the associated full report.

You will be writing a full report for this lab. The report is only to cover sections 2.0-4.0 below. It is dueFriday 5/4/2012. The items indicated below as “for_report_x:” are items you are encouraged to include in your report.

Your report must have each of the following 4 sections:

  • abstract
  • introduction / background / theory (this has been broken into 2 separate sections previously, but for this report you can include whatever elements you think make most sense to you. just call the section “introduction” or “background” or “theory”, not “introduction / background / theory”
  • experimental description
  • results and discussion

You are encouraged to:

  • use lab time to prepare all the information you need (e.g. equipment information for your experimental description section, making sure you have all your plots the way you want them for your report)
  • review the previous writing assignments you’ve worked for this course this semester
  • write the abstract last

For this report, you must keep the total word count below 1,500. Everything but figures, their captions, and any appendices are to be counted in this word count. Use 12 point Times New Roman font, single-spaced, with 1” margins on all 4 sides. On the cover page, you must also handwrite your total word count, and handwrite the honor code “I have not given, received, or tolerated others’ use of unauthorized aid on this report”, and sign and date it.

You will probably find it challenging to keep the word count below the limit, so start with an outline, then write concisely following the outline, tracking your word count as you write to make sure you are on pace.

1.0 Non-control cases against which to compare future PID control results

Start by building the same RC low-pass filter setup as you did in the previous lab, with the physical input coming from the ao0 channel on the myDAQand the physical output going to theai0 channel. You will be comparing various controllers on the same circuit for the same setpoint step change. Use R = 1 MΩ, C = 1 µF to answer the questions in this lab. You are also encouraged to see how your controller performs differently with shorter or longer time constants. One of our goals this week is to practice for using the controller on the heat gun next week. As discussed in lecture, the combined response curve due to the heater, the heater electrical supply, and the thermocouple is dominated by the heater and will behave approximately like a first-order system with a time constant of under 10 s.

Loadlab_11_PID_incomplete.vi or preferably your own version that you completed in in Lab 11.

Later in this lab, we will be using this code to do PID control of the RC filter, but your first job is actually to strip the code so all it does is apply the setpoint voltage to the filter input and readoutput filter voltage (in other words, remove all the PID control stuff).

Run the code and periodically change the setpoint using arrows left of the corresponding control to see the step response of the controller. Observe the first-order exponential curves when you change your setpoint.

We will be comparing the filter response from many tests on a single plot in this lab. To make all comparisons fair and easy to line up on one plot, use the same set point change (7 down to 4 V, and optionally also 4 up to 7 V) in this and future tests.

for_report_a:For the setpoint change, output response data into Excel or similar. Make sure all columns in the file are sensible before moving on. You will be combining a plot of the data you just exported with other plots generated below. What you need from this part is the data to produce the set point step curve and the data to produce the first-order response curve.You will not be producing a separate plot for just this question or for b, c, or d, but rather a single plot that includes a-d; we recommend accumulating the curves as you go, so you can keep an eye on how your data is looking.

for_report_b: Add the best possible set point change response to your plot. You may use the approach from Friday’s lecture (resulting in experimental data), or simulate the data (resulting in a theoretical response).

2.0 PID control

Refresh to lab_11_PID_incomplete.vi or preferably your own version that you completed in in Lab 11.

for_report_c: Get the response to work as well as you can for a set point increment with P only gain; ignore steady-state error and just get the transition to settle as quickly as possible to the new steady-state value without significant overshoot and ringing. Add this data to your plot. In the text of your report, we suggest including an explanation in your own words as to why steady-state error will always exist for P-only control.

We will now try to add intelligent levels of I and D control to get the best possible performance out of this controller.

Use the Ziegler-Nichols method to add appropriate amounts of I and D control. You may find it useful to perform your own internet search for related information; if you find anything that seems extremely useful, please let your lab instructor know so it can be archived.

The Ziegler–Nichols tuning method is a heuristic method of tuning a PID controller. It was developed by John G. Ziegler and Nathaniel B. Nichols. To apply this method, first set KI and KD to zero. Then, increase KP from zero until it reaches the ultimate gainKU, at which set-point changes induce oscillationsthat do not die out for 10s. Note the period of the oscillations, TU. (Hint: a convenient way to measure the period is to count points and multiply by the loop dt, which is indicated on the front panel.)

Use the values of Ku and Tu to determine values of PID gain setting according to the following tuning rule table. The 2nd-4th rows are modified versions of classic Ziegler-Nichols tuning:

Rule Name / Tuning Parameters
Classic Ziegler-Nichols / Kp = 0.6 Ku Ti = 0.5 Tu Td = 0.125 Tu
Pessen Integral Rule / Kp = 0.7 Ku Ti = 0.4 Tu Td = 0.15 Tu
Some Overshoot / Kp = 0.33 Ku Ti = 0.5 Tu Td = 0.33 Tu
No Overshoot / Kp = 0.2 Ku Ti = 0.5 Tu Td = 0.33 Tu

Selected from the tuning rules listed in the paper "Rule-Based Autotuning Based on Frequency Domain Identification," Anthony S. McCormack and Keith R. Godfrey, IEEE Transactions on Control Systems Technology, vol 6 no 1, January 1998.

Note: KI = KP/TI ; KD = KP * TD

for_report_d:Output to Excel the response you obtain using Ziegler-Nichols straight away without any post-tweaking. The result might look far from the ideal response you were hoping for; that is OK. Add the data to your plot.

Now adjust the P, I, and D gains manually from the baseline Ziegler-Nichols values, or use other rules from the table above, or anything else you can think of, trying to get the best possible controller performance. How close to curve b can you achieve?

for_report_e: Add this final curve to the Excel plot you’ve accumulated.

In next lab’s heat gun control experiment, one of the tests you will run will be the case where you change the output gas jet setpoint temperature, with the goal of settling on the new set point as quickly as possible. Archive the best controller gain settings you found above, as they are likely to be a good starting point next week for this test.

3.0 Disturbances

Another test you will run next week on the heat gun is the case where the set point temperature is held fixed, but the temperature of the intake air for the heat gun varies. When the intake air temperature changes, that is called a disturbance. In many cases, disturbances represent the only reason a controller is needed in the first place. If there were no disturbances, you could just tweak things until you achieved the desired results, and then leave them there. But because disturbances are often present, a controller is required to maintain the set point.

We will use the function generator above your lab station to add disturbances in this week’s electrical circuit control lab. To begin, use the Tektronix oscilloscope to set the function generator to output a square wave that steps from 0 to ~ 2 V every 5 s (f = 0.2 Hz). Then, without changing the voltage or frequency settings, push the different waveform buttons (sine, ramp, etc.) to see the different types of voltage disturbances you will be able to apply to your filter circuit.

Once you are familiar with the function generator and the disturbances you will be applying, return it to the square waveform. Learn how to turn the amplitude to the minimum value and back to the location resulting in about 2 Vpp amplitude so that you can do it without the aid of the oscilloscope. Disconnect the function generator from the oscilloscope and connect it in series with the ao0 channel so that you can deliver the sum of the voltages output by the ao0 channel and the function generator to your circuit. In your best-tuned PID controller, set the set point to 5 V. With the amplitude minimized, verify that your control system works approximately as before. Then return to the ~ 2Vpp amplitude, and observe how well your controller responds to disturbances.

You may wish to further tune your controller so it is more robust against disturbances and then archive the controller gain settings, as they may be useful in next week’s lab when we apply a near-step change to the heat gun’s intake air temperature and seek the fastest-possible recovery to the original jet temperature.

for_report_f: Compare on the same plot a response to the square-wave disturbance and a response to a set point change. Describe (as quantitatively as possible) the way(s) in which these two responses are similar and the way(s) in which they are different.

Now you are in a position to use the function generator to test disturbances other than square waves; because these disturbances vary gradually, they will be unlike abrupt set point changes. Experiment!

for_report_g: Find an interesting result using a triangle-wave disturbance and describe the result as quantitatively as possible, using at least one screen capture.

1 of 411/17/20188:29:59 AM