PDA

View Full Version : Parametric identification and IIR questions


Quoc Thang NGUYEN
07-01-2005, 06:38 PM
Dear all,

I have little practical knowledge of digital signal processing, but I am
facing a problem which is beyond what can I think of. Could someone in this
newsgroup help?

The problem is the following:
I would like to compensate for the frequency response of a device, which
behaves roughly linearly (it has a Class 0 servo inside) with an underdamped
step response (the response of the system looks like that of a 3-pole
low-pass Butterworth filter, with a rise time of about 150 us). The device
is controlled by an analog input, which is generated by a D/A board in a
computer. The output from the D/A board has a rate varying between 0.2-1.5
MHz. Because of the slow response of the device, the output of the device is
distorted compared to its input. I'd like to program a linear filter that
would precompensate the input waveform to feedforward correct the response
of the device. I do not know the practical problems that could arise in such
compensation schemes, but I am a bit wary of the behavior of the filter at
high frequencies.

I would like to do the following:
- Record and average the step response of the device over a few trials to
remove noise for a given input waveform rate T
- Differentiate the response to get the impulse response
- FFT the impulse response to get amplitude A(w) and phase F(w) of the
transfer function
- The feedforward analog linear filter will have a gain 1/A(w) and
phase -F(w)
- Use the Matlab invfreqz using the previous gain and phase to identify the
parameters of an IIR digital filter that would do the job.
- Filter the command waveform and send it to the device.

- Any advice on the steps above?
- Once I get the parameters of the IIR filter, how do I adapt them for the
different rates of the device input waveform? Do I have
to recalculate the IIR filter coefficients for each T?


Thanks a lot for all advices.

Tim Wescott
07-01-2005, 07:29 PM
Quoc Thang NGUYEN wrote:
> Dear all,
>
> I have little practical knowledge of digital signal processing, but I am
> facing a problem which is beyond what can I think of. Could someone in this
> newsgroup help?
>
> The problem is the following:
> I would like to compensate for the frequency response of a device, which
> behaves roughly linearly (it has a Class 0 servo inside)

Read _everything_ below this line with a great big pinch of salt. The
method you outline, and the one that I expound upon, both depend on a
linear plant. Nonlinearities in the plant will make both methods break
down rather rapidly (there are things that you can do, but not these).
Servo systems routinely drive their actuators (whatever it may be at
those speeds) into saturation -- when that happens your system looses
all pretence of linearity, and neither your method nor mine will give
satisfactory results.

Even if the system isn't currently saturating you may find that the
filter you whomp up to do the job will saturate _its_ output, or will
require that you drive your device beyond the range that it can safely
hardle.

There _are_ things you can do, ranging from trying to model the internal
nonlinearities and correct from them, to having a family of linear
approximations for varying sizes of excitations. All of them will be
more work than you would face with a purely linear system, none of them
will be as mathematically sound, and chances are none of them will
perform as well as a linear model would predict.

OK, back to our regularly scheduled program:

> with an underdamped
> step response (the response of the system looks like that of a 3-pole
> low-pass Butterworth filter, with a rise time of about 150 us). The device
> is controlled by an analog input, which is generated by a D/A board in a
> computer. The output from the D/A board has a rate varying between 0.2-1.5
> MHz. Because of the slow response of the device, the output of the device is
> distorted compared to its input. I'd like to program a linear filter that
> would precompensate the input waveform to feedforward correct the response
> of the device. I do not know the practical problems that could arise in such
> compensation schemes, but I am a bit wary of the behavior of the filter at
> high frequencies.
>
> I would like to do the following:
> - Record and average the step response of the device over a few trials to
> remove noise for a given input waveform rate T
> - Differentiate the response to get the impulse response
> - FFT the impulse response to get amplitude A(w) and phase F(w) of the
> transfer function
> - The feedforward analog linear filter will have a gain 1/A(w) and
> phase -F(w)
> - Use the Matlab invfreqz using the previous gain and phase to identify the
> parameters of an IIR digital filter that would do the job.

Trying to fit IIR filter coefficients to a FFT can be a major pain. I
would do this using a simple time-domain ARMA method; you can find a
very good description in "Adaptive Control" by Astrom (although I don't
recall him using the acronym). Basically what you do is a linear
regression on the plant transfer function coefficents using the plant
input and output vectors. You'll get a nice model in the z domain

Your biggest difficulty will come about if the model is unstable -- if
that's the case then the closest you'll be able to come to perfection
will most likely be to take the inverse of all the unstable zero
positions and make your IIR filter.

> - Filter the command waveform and send it to the device.
>
> - Any advice on the steps above?
> - Once I get the parameters of the IIR filter, how do I adapt them for the
> different rates of the device input waveform? Do I have
> to recalculate the IIR filter coefficients for each T?
>
By "different rates" do you mean different sampling rates, or do you
mean different input waveforms? If the former, just don't do that! If
it's the latter then no, your filter shouldn't have to change.

You will be able to get an improved match for the shape of the output if
you can stand to delay things a bit: i.e. if you can plan ahead a bit
and initiate things on the output _before_ you need to see it. If you
do that then you can use a cascaded IIR and FIR filter (or just an FIR
filter) to take care of those unstable zeros.

--
-------------------------------------------
Tim Wescott
Wescott Design Services
http://www.wescottdesign.com