# Help with a Closed loop and zero order hold function ZoH * 1/s(s+a) type

i would appreciate some help in solving this problem, i need to find the transient response for a unit step, i have a brief idea of how to solve, but my graphs in matlab doesnt seem to fit with the graph form i have to reach, i would appreciate any help or advice.

i also attach an example of matlab commands for a example function of ZoH * s/s(s+1), same problem but with a=1, i cant manage to have a response like i attached too since my a is 2 and im trying to work it out with an "adjustment" as can be seen in my process.

Any kind of advice or help, would be very appreciatted, thanks in advance.

Also, i add these images, in case anyone can point whats wrong with my calculations.       • The input to the zoh is a continuous signal.
– Chu
Apr 3 '20 at 0:48
• No sorry, is a sample with T=1second Apr 3 '20 at 1:02

I haven't checked your solution in any detail, but my analysis gives the OLTF:

$$\small G_{OL}=\frac{z}{z-1}\: \large \mathcal {Z}\small \left( \frac{a}{s^2(s+a)}\right ) = \frac{z}{z-1}\: \large \mathcal {Z}\small \left( \frac{1}{s^2} -\frac{1/a}{s} +\frac{1/a}{s+a}\right )$$

taking z-transforms:

$$\small G_{OL}(z)= \frac{z-1}{z}\left( \frac{Tz}{(z-1)^2}-\frac{1}{a}\frac{z}{(z-1)}+\frac{1}{a}\frac{z}{(z-e^{-aT})}\right )$$

$$\small \therefore \: G_{OL}(z)= \frac{T}{(z-1)}-\frac{1}{a}+\frac{1}{a}\frac{z-1}{(z-e^{-aT})}$$

and the CLTF, taking $$\\small T=1\$$: $$\small G(z)=\frac{(a+e^{-a}-1)z+(1-e^{-a}-ae^{-a})}{az^2+(e^{-a}-1-ae^{-a})z+(1-e^{-a}) }$$

In regard to your parameter values, $$\\small a=T=1\$$ gives a critically stable closed loop (pole on the unit circle). However, taking $$\\small a=2; T=1\$$, gives the CLTF: $$\small G(z)=\frac{0.57z+0.29}{z^2-0.57z+0.43}$$ which factorises to:

$$\small G(z)=\frac{0.57z+0.29}{(z-0.285+ j0.59)(z-0.285- j0.59)}$$ and, with poles inside the unit circle, this CLTF is stable.

To plot the unit step response, we may obtain the difference equation from $$\\small G(z)\$$, thus:

$$\small y[k]=0.57x[k-1]+0.29x[k-2]+0.57y[k-1]-0.43y[k-2]$$

Excel produces the following step response from the difference equation: i would appreciate some help in solving this problem, i need to find the transient response for a unit step

But your filter in Matlab is calculating an impulse.

• thats the professor matlab calculation, so how do i manage to get it working in mine like that? i have the transfer function coefficients in matlab, but is a different response Apr 2 '20 at 23:58
• the only difference is the input, you are doing an impulse [1 zeros(1,40)] to have a step you could just change it to [1 1+zeros(1,40)] that way you have an array of ones as inputs.
– jDAQ
Apr 3 '20 at 0:01
• Well i tried with an array of zeros, but doesnt works either, any chance you can check my process to see if i have any problems? i would appreciate it, im just doing it as my professor sent, but i dont find any sense at all Apr 3 '20 at 0:03
• If you input to it an input that is always zero the filter will just output zero, I did not suggest doing that.
– jDAQ
Apr 3 '20 at 0:07
• Well i will try as you posted before, thanks for the advice Apr 3 '20 at 0:08