|
From: | Sergei Steshenko |
Subject: | Re: Not able to add delay to transfer function |
Date: | Tue, 4 Aug 2020 00:59:46 +0300 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.1.0 |
On 03/08/2020 10:11, shall689 wrote:
Now that you have your transfer function, if not yet you better test its accuracy. By that I mean measure the transfer function magnitude and phase responses and compare them to the actual system measured data (using which you approximated the transfer function) and make sure that the differences are small enough - I'd say no more than 1db in magnitude and no more than 5 degrees in phase.Hello Sergei and GoPro, I was able to compute the actual transfer function, so I won't need to convert the frequency response to the transfer function right now. Also, I came to the conclusion I didn't actually need a delay. I needed a ZOH hold. I was able to get it by doing the following (using info Torsten gave me): s = tf('s') [num,den] = padecoef(1/20000,1) % 1st order pade sys = tf(num,den) zoh = (1-sys)/s Also, I was able to get the same thing from slide 14 of http://ecee.colorado.edu/~ecen5807/course_material/sampled/ Stephen -- Sent from: https://octave.1599824.n4.nabble.com/Octave-General-f1599825.html
Having done that you might consider changing the tool. I suggest to switch to a SPICE-type simulator with convenient GUI. I myself LTSpice a lot under Linux under 'wine'.
LTSpice has arbitrary behavior voltage and current sources, and they can utilize Laplace transform - on that read in e.g. http://ltwiki.org/?title=B_sources_%28complete_reference%29 . So you can code your system transfer function and the rest should be trivial. If I understand correctly, PID controller in terms of electronics is Ri -> C -> Rd circuit with possibly an amplifier, with Ri being mostly responsible for integration, and Rd being mostly responsible for differentiation (this is a very simplified explanation).
So all in all you'll have to draw a very simple circuit in LTSpice circuit editor and you will be able to easily simulate it and easily play with PID controller parameters. LTSpice has very nice graphs/waves display, so you'll have easy access to all intermediate points of your system model.
--Sergei.
[Prev in Thread] | Current Thread | [Next in Thread] |