# Z transform of real-time input to discrete transfer function

I am trying to implement a first order discrete transfer function to model a small centrifugal pump to control its output flow rate. I started with a continuous first order transfer function which relates outlet flow to an input voltage sent to the driving DC motor given as: $$\frac{K_{gain}}{\tau s+1}$$ Where $K_{gain}$ represents the steady state flow rate response to a step input and $\tau$ the time constant. (The flowrate is linearly related to the input voltage in the range 0-10v).

I require a difference equation representation of this continuous transfer function to implement programmatically at sample rate $\frac{1}{T}$. Since I am using an artificial neural network controller with back propagation (i.e. it trains itself), I don't have the function of the input voltage (control) signal in advance to multiply with the transfer function to predict its output. The discrete transfer function I derived which included a ZOH was: $$G(z)=\frac{K_{gain}(1-e^{-T/\tau})}{z-e^{-T/\tau}}$$ I can convert this to a difference equation with something like WolframAlpha but I'm missing the discrete input signal representation. I have also tried taking the inverse Laplace transform of the continuous transfer function and blindly applying the RK4 technique to solve the resulting ODE in real-time which produced a result although did not reflect the time constant and steady state values I set.

Have I made an error somewhere or overlooked something? I've exhausted all options I can think of and would appreciate any insight, thanks.

• How are you missing the discrete input in the difference equation? Namely $G(z)$ would be defined as $Y(z)=G(z)\,U(z)$, with $Y(z)$ and $U(z)$ the z-transform of the output and input respectively. – Kwin van der Veen Aug 20 '18 at 9:44
• I did multiply the input with the transfer function as you rightly suggest before I posted but later realised that I require a description of the input function in discrete form rather than a sample of the input. After consultation with others experienced in the field, it appears that what I was trying to accomplish is impossible since the input can not be described as a mathematical function (i.e. unforeseen disturbances in the piping system e.t.c. will influence the calculated control signal which cannot be accounted for). – marlu Aug 20 '18 at 10:42
• you are using a ZOH method for discretization, so the input should be constant during one sample time in order for your discrete system to match the continuous system at the sample times. – Kwin van der Veen Aug 20 '18 at 11:05