Hello, I am having some difficulties in finding out how to implement in Simulink a discrete time controller for an analog plant in a way that the frequency response of the "equivalent continuous-time controller" seen by the plant reflects the distortion produced by the zero-order-hold digital implementation.
From the theory it is known that if a digital controller Kd is implemented through a sample and hold mechanism, the "equivalent continuous-time controller" seen by the plant will have a distortion term equal to D(s) = (1-exp(-s*Ts)) / (s*Ts), where Ts is the sampling time.
To make my question clearer, consider the attached Simulink model ContVsDiscreteTime.slx
It has a continuous time noise source and a discrete-time LTI system (I will call it the controller) with transfer function K(z)=(631.3 z -578)/(z-0.3522) and sampling period Ts = 0.1 s. The transformations from the continuous-time source signal to the discrete-time controller input and from the discrete-time controller output back to continuous time at the outport are performed using two Rate Transition blocks as illustrated in the Fault-Tolerant Fuel Control System demo sldemo_fuelsys provided in the Simulink documentation.
To anayze the system, I use the Simulink Model Linearizer app. First I compute the Bode plot of the gain from B to C: as expected the Bode plot obtained matches the frequency response of the discrete-time block. Then I compute the Bode plot of the gain from A to D. My expectation is to obtain a continuous-time linear system whose frequency response is essentially equal to that of the discrete-time system modified by the distortion term D(s), which affects especially the phase. However, as shown in the attached screen shot, the Simulink Model Linearizer returns the same discrete-time system of the previous step, as if the conversions from and to continuous time were not present (the values stored in the To Workspace blocks clearly show.that the signals in A and D are not discrete-time with sampling time Ts)
This is particularly misleading when it's part of a feedback loop, because it characterizes closed-loop performance as if the deterioration D(s) due to the digital implementation was not present.
How should I modify the Simulink diagram to have the distortion term included in the analysis? Obviously, I can always explicitly add the block D(s) as an LTI system after converting back the controller output to continuous time. However, I have the feeling that it might not be the cleanest way to do it, as it is difficult to imagine that Simulink would overlook the necessity of directly implementing such an essential part of the conversion.
Thank you for any answers or comments.
Below are two JPG files with the block diagram and the relevant settings.
Best Answer