help-octave
[Top][All Lists]

## Re: PID controlle design with OCST

 From: A S Hodel Subject: Re: PID controlle design with OCST Date: Mon, 12 Apr 2004 10:24:34 -0500

```On Friday, April 9, 2004, at 06:16 AM, [name deleted] wrote:

```
```Hi. I am a uni student studying Comp. Sys. Eng. And I am
currently doing a Discrete Systems control subject.

I have an assignment to design a PID controller and optimise it with
ITAE Steepest Descent minimisation. I am trying to use GNU octave for
most of my subjects as I can't afford MATLAB (who CAN?) and I really
like GNU Octave's OCST.

I am having trouble thinking of how to develop a PID controller as
Octave doesn't seem to support derivatives. I noticed you have some
particular problem. I did not quite understand the solution you
mentioned:

"It's sloppy, but the only way I know to do PID design in the OCST is
to have both y and ydot (output and its derivative) available in the
plant model."

I have to admit, I have no idea what you mean by y and ydot. Could you
spare a few minutes and elaborate a little further on it?

```
```
The OCST data structure can only handle causal transfer functions, i.e.,
systems that can be written in the form
dx/dt = A x + B u
y = C x + D u
which have corresponding transfer function
P(s) = C*inv(s*I - A)*B + D
```
A PID control law does not fit this form. In point of fact, a "true" PID control law is non-causal - it is impossible to implement a derivative in physical
```hardware.  One reader once responded to me saying, "But wait, there's
```
that op-amp circuit ..." The op-amp circuit is the answer to your question: op-amps have very fast internal dynamics that we usually ignore. However, they're still there. So, to get a derivative, you will need to approximate
```K_D s (derivative term) by K_D s/( tau s + 1 ).

```
For low frequencies (s = j omega, omega small) this will closely approximate a derviative. For higher frequencies, you get the same problem the op-amp
```has: poor approximation of a derivative.

```
A good project for someone to do in the future is to extend the tf and zp
```data structure forms in the OCST so that they will admit non-proper
```
transfer functions. (functions that do not admit state space realizations). This change will percolate through nearly the entire OCST, so it's no small
```task.

A. S. Hodel Dept. ECE, 200 Broun Hall, Auburn University AL 36849-5201
```
(334) 844-1854/fax(334) 844-1809, http://www.eng.auburn.edu/users/hodelas , address@hidden
```

-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------

```