Skip to main content

Timeline for Discretization of a PID controller

Current License: CC BY-SA 4.0

29 events
when toggle format what by license comment
Feb 29 at 19:54 comment added Pete W If I'm trying to build something like a bandpass filter for accurate data collection, this stuff really matters. For a PID controller, it usually is secondary importance
Feb 29 at 19:42 comment added Pete W @weirdgyn - See here: dsp.stackexchange.com/questions/58533/… ... derivative, and even the identity function $y(t)=u(t)$ are both causal and anti-causal. In continuous-time, it's not an issue. In my view it only becomes an issue when you do discretize, since something like $\frac{u[n]-u[n-1]}{T_s}$ most closely approximates $du/dt$ at a point in time a half-sample ago, rather than "now". If I do the analysis in continuous time, and my discrete implementation has sufficient sample rate, I can worry about something else.
Feb 29 at 15:28 comment added weirdgyn I got what you meant but I was meaning a different thing... in legacy control theory given a transfer function the maximum differential order of the inputs must be lower or equal thant the maximum differential order of the outputs... i.e. more poles than zeros... moreover discretization of non causal transfer functions lead to something like $ u_n = e_{n+1} + ... $ that's obviously wrong. Of course as I said I'm not an expert so if there are exceptions to this rule I'm absolutely interested...
Feb 29 at 14:42 comment added Pete W Yes. It's obviously not "really" $du/dt$, but can and often is practical
Feb 29 at 14:35 comment added weirdgyn @PeteW you meant $ \frac{du(t)}{dt} = \frac{u_n - u_{n-1}}{T_s} $ ?
Feb 29 at 14:07 comment added Pete W I.e. the most basic discretization simply as "du_dt = (u[n] - [n-1]) / t_samp" would produce a "meaningful result" in terms of a control loop satisfying requirements. For this to happen, you need enough breathing room in frequency terms (about 10x), between the system's (and the control loop's) dynamics, and the sampling rate
Feb 29 at 14:04 comment added Pete W @weirdgyn - I agree in the sense that $\frac{du}{dt}$ is obviously unbounded without a frequency limitation. But as a practical matter, system designers can limit the frequency band and accept the requirement of continuous inputs and outputs, and accept a tolerance on the result. In that case, the discrete approximation works fine. To limit the frequency range and smooth out discontinuities, we can sub $s$ with $\frac{s}{1+s/\omega}$ as you originally had. But what I'm saying is, for purposes of analysis, and also discretization, under favorable conditions you can ignore that extra pole
Feb 29 at 10:23 comment added weirdgyn @PeteW you mean there's a way to discretize something like $y(t)=\frac{du(t)}{dt}$ and having a meanigful result ? I would like to see an example... from my control theory book this's something that cannot be done but maybe there are exceptions...
Feb 29 at 8:05 history edited weirdgyn CC BY-SA 4.0
deleted 47 characters in body
Feb 29 at 7:54 history edited weirdgyn CC BY-SA 4.0
added 47 characters in body
Feb 28 at 15:43 comment added weirdgyn uhm... let put it in this way: if $y(t)$ is the output of the system and $u(t)$ the plant command this differential equation $y(t)=\frac{du(t)}{dt}$ is not something you can translate into something physical. Viceversa $u(t)=\frac{dy(t)}{dt}$ is something you can phisically implement. Of course both equations are mathematically solvable.
Feb 16 at 14:09 comment added Pete W If I understand correctly, continuous time d/dt is a borderline case. if we can stipulate no holes in the function (such as a discontinuity), it can be constructed to be either causal (ie if you take the limit coming from the left) or anti-causal (if you take the limit coming from the right). In any case, s-plane design/analysis techniques can usually be applied without problems, and when we to transform into discrete time, as long as the system poles/zeros are "far away" from the sampling time, it will work. But special attention should be paid to pole/zero cancellation. (your example has)
Feb 16 at 7:42 comment added weirdgyn @PeteW no no no... I just meant causal because if you have more zeros than poles (like in an ideal derivator) outputs are not preceded by inputs. The same infinite HF gain is something that's not achieavable in practice then to make it real (that's nothing to do with real vs complex nunbers) you need to put an extra pole and of course this should be something in HF (or anyway out of the bandwidth of the plant itself)
Feb 14 at 14:16 comment added Pete W Ok makes sense. Re: extra pole in differentiator - it puts a limit on high frequency gain, whereas ideal "s" has infinite HF gain. "Non-causal" would be if you have RHP poles or zeros, that's a little different. And the term "real" often used to contrast vs "complex", i.e. poles or zeros being complex conjugates - which often isn't a problem (depends on angle in complex plane), so much as an algebraic inconvenience
Feb 14 at 9:11 comment added weirdgyn @AJN 1 this's the most basic form of antiwindup I know ... since the antiwindup is typically driven by the integral term it suggest to void the integral term when cutoff is applied 2 yes and no... I'have been a little bit surprised by the magnitude of the differences between integral and derivative terms coefficients and I tought that this maybe was given by some error into controller modelling 3 the condition is for the cutoff not for the antiwindup itself.
Feb 14 at 9:04 comment added weirdgyn @PeteW as TimWescott argued this's the result of matlab command $c2d(G_c,10^{-3}, "tustin")$. But doing it by hand with lead to the very same result
Feb 14 at 8:52 history edited weirdgyn CC BY-SA 4.0
added 130 characters in body
Feb 14 at 8:48 comment added weirdgyn @TimWescott because the question was to create a PID controller that was real and not ideal... without that extra pole the controller transfer function will result to have more zeros than poles and thus NON causal (I dont't know if this's the correct english term)
Feb 14 at 4:42 answer added TimWescott timeline score: 2
Feb 14 at 4:25 comment added TimWescott "note that I needed to put an high frequency pole into derivative term to keep it real" Keep what real? Why? What method did you use? What criteria were you designing for? If it's pertinent, edit your question with this information.
Feb 14 at 4:24 comment added TimWescott @PeteW it looks like the OP just asked Matlab, and it coughed up answers where the $1 / \Delta t$ and $\Delta t$ terms were implicit -- if you account for that, then the gains should look a lot more like the time-domain gains.
Feb 13 at 18:57 comment added Pete W also shouldn't there be factors of $1/\Delta t$ and $\Delta t$ multiplying into the derivative and integral terms?
Feb 13 at 18:05 comment added weirdgyn @PeteW I've not been asked to take noise into account.
Feb 13 at 16:17 comment added Pete W Re: the high D coefficient - I didn't follow your calculation, but yes I would question it. Likely to amplify noise unnecessarily.
Feb 13 at 16:05 answer added Pete W timeline score: 2
Feb 13 at 15:42 comment added AJN 1 Why did you make uI[1]=0 (effectively uI[0] is also made zero immediately afterwards). Do you have a text book reference for this type of anti wind-up implementation? 2 "I don't feel very comfortable with such high derivative terms and low integral" Is that part of the question? It seems to be un related to the anti-wind-up part of the question. 3 why is a condition on u checked for anti-wind-up rather than uI it self?
Feb 13 at 14:51 history edited weirdgyn CC BY-SA 4.0
deleted 4 characters in body
S Feb 13 at 14:39 review First questions
Feb 14 at 4:43
S Feb 13 at 14:39 history asked weirdgyn CC BY-SA 4.0