Next |
Prev |
Top
|
REALSIMPLE Top
Now you will gain some intuition into adjusting the PID control parameters
and Try to avoid adjusting the PID parameters in a manner
that causes the system to become unstable. If instability occurs, the output
from the pd patch will become louder and louder until the pd patch
shuts itself off and sends the message UNSTABLE to the pd message
window. If you ever see this message, close the patch and open it again. One way to avoid instability is to adjust the parameters slowly-backing off if
ever the sound from the model starts becoming louder and louder. The blue
button ``Reset parameters for no control'' will set , , and
and may also be triggered by pressing the space bar.
The sliders for adjusting , and are set up to make as much of
the useful parameter space as available as possible. For example, the default
position for the slider, which corresponds to , leaves little room
for making negative by moving the slider to the left. This is because
even slightly negative values will cause the energy in the string to grow quite
fast. Note that the actual values for
each PID control parameter is shown in a box underneath the corresponding slider.
- Download the pd patch 4-1.pd,
and open it in pd .
- Ensure that the patch is not in editing mode, and check the ``compute audio'' box in the main pd window.
- To virtually pluck the string, press any key or click the ``PLUCK'' button. You may optionally check the box ``pluck repeatedly.'' Adjust the ``Master volume'' slider on the right until the volume level is comfortable.
- The four sliders on the upper left calibrate the characteristics of the
vibrating string model. Consider reviewing the
digital waveguide model laboratory assignment
to remind yourself of the meanings of these parameters.
- The fourth slider labeled ``Sensor and actuator position'' may be used to
move the virtual sensor and actuator along the string. So that the string may
be controlled successfully, the sensor and actuator must be located at the same
position [1]. What sensor locations cause the sensor to measure
no energy at the second harmonic? (Hint: If the sensor is placed near one of these
locations, then the sensor will measure very little energy at the second
harmonic. You may observe this effect by viewing the spectrum while adjusting the
``Sensor and actuator position'' slider.)
- How do you adjust so that the overall decay time constant becomes shorter?
- Click the button ``Reset parameters for no control'' and adjust for
integral control damping. What differences do you observe in the spectrogram
when integral control damping is applied?
- While damping behaves as predicted in the theory section, you will find that
altering the pitch is more difficult. This might seem surprising given our
derivation, but recall that we assumed that there
was only one harmonic. Now alters the pitch of all of
the harmonics simultaneously; however, it also alters the damping some. The way in which it
alters the damping is complicated, so for larger values of , one or more of the harmonics
becomes unstable. This means that the pitch may be altered significantly only
in conjunction with additional damping required to preserve stability. Try to
see how far you can shift the lowest harmonic while preserving stability.
Write down , , , and for making both as
large as possible and as small as possible.
- Compare your results with those shown in Figure 3 where is
chosen so high that only the lowest harmonic appears on the spectra. Flatted notes have
relatively lower pitch (see Figure 3, top), while sharpened notes have relatively
higher pitch (see Figure 3, bottom). You will probably find that you cannot shift the pitch
quite as far because your PID controller parameters are limited to a smaller space.
- Do you notice any problems in the sound of the controlled tones when the frequency is altered? One thing you may notice is inharmonicity. Can you surmise why this might occur?
- Challenge problem: Modify the subpatch pd controlled-string to induce tremolo in the modeled vibrating string. For our purposes here, we will let tremolo be defined as periodic variations in the amplitude of a signal. See the hint in the subpatch to help you decide where to make the required changes. Save the result into the file 4-1.tremolo.pd.
Figure 3:
Example spectra for frequency shifting via PID
control (top: flat (decreased pitch), middle: no control, and bottom: sharp (increased
pitch))
|
Next |
Prev |
Top
|
REALSIMPLE Top
Download pidcontrol.pdf