On 29/07/2020 22:53, shall689 wrote:

I do not understand why you are trying to add something to your transfer

function (delay in this case). IIRC, in the beginning you stated you had

frequency response of your system. I asked whether the response was

complex (as in complex numbers) or just magnitude - I don't remember

getting a reply; I asked the question to better understand the task at hand.

If you have complex frequency response, you probably don't even need the

corresponding transfer function. This is because having the response and

the PID parameters you can have the resulting complex frequency response

which can be converted by 'ifft' into the resulting impulse response,

which also means it can be converted into step response (probably the

step response of most interest).

Anyway, having complex frequency response you can try to obtain rational

polynomial (i.e. either B(s)/A(s) or B(z)/A(z)) using 'invfreqs' or

'invfreqz' functions respectively. I believe what I'm writing is

methodologically correct, though from practice I know that for "funky"

frequency responses obtaining the resulting rational polynomial is very

tricky, i.e. small polynomial orders are not sufficient, and high

polynomial orders give convergence problems - do not fit the input

complex frequency response well.

If you only have magnitude response, you still need to obtain complex

frequency response - otherwise you can't build the corrected systems. Is

this the case and are you trying to add delay to the magnitude response

? If that's the case, I do not think your methodology is correct. Not

that you don't need delay - quite the opposite. But for minimum phase

systems magnitude response and phase response are tightly related - see

https://en.wikipedia.org/wiki/Kramers%E2%80%93Kronig_relations#Magnitude_(gain)%E2%80%93phase_relation
,

https://en.wikipedia.org/wiki/Minimum_phase#Relationship_of_magnitude_response_to_phase_response
. So, you really need to know complete true phase response of your system.

Anyway, I'm just a curious observer ...

--Sergei.