0
\$\begingroup\$

I am trying to discretize the transfer function of my compensation.

After modelling my system in continuous domain thanks to books of Christophe Basso and books of Erickson Robert W., Maksimovic Dragan, I did the compensation of my system in the continuous domain but by knowing that I will discretize this compensation. So I needed to take into account the effect of sampling and of the ZOH in the continous domain for doing the right compensation (as some of the members of this forum help me to do it). Then I used the "tustin" method for discretizing the transfer function of my compensation.

In order to be sure of my results, I decided to use Simulink to verify that the 2 systems, the one in the continuous domain and the one mixed between continous and discrete, give the same response. Here is my problem they do not give the same response.

Here is the transfer function of my compensator in the discret and continuous domain for a phase margin equal to 70°

enter image description here

Here are what I wanted to simulate on Simulink.

The first picture is in the continuous domain with the Zero Order Hold block given by Matlab where we can set the "sample time" to the value we want. I set it to 200 µs as my sampling frequency is 5kHz

enter image description here

The second picture is in the continuous domain with the transfer function of a Zero Order Hold find on wikipedia with "T" set to 200µs :

enter image description here

enter image description here

And when I look the response between the both circuit where only the ZOH block is different, the responses of the different diagramm are differents. This is a point that I do not understand. And I would say that the correct simulation is the one with the transfer function of the ZOH from wikipedia as regards of the response and the effect of the phase margin on the response.

The third picture is the mixed diagramm : enter image description here

Finally here are the responses :

enter image description here

where the green response whose the settling time and rise are the longest corresponds to the 1st picture and the third picture. They completely fit, so it is not possible to see 2 curves. And the blue reponse corresponds to the 2nd picture (the one with the ZOH transfer function from wikipedia which according to me seems to be the right... )

enter image description here

According to me all the diagramms that I showed you are the same, or actually I set it to be the same ... Could you, please, tell my why the systems are different ?

Tell me if you need more informations.

Thank you very much and have a nice day :)

----------------------------------E D I T-----------------------------------

The parameter control box is an LTI Block and its parameter is the transfer function *sys_zoh" whose the definition is the following :

enter image description here

I added the ZOH block :

enter image description here

I am sorry for the late response, I do not have matlab at home ...

---------------------- DOUBLE EDIT ----------------------------------------

Here is how I define the sys_zoh transfer function and its bode plot

enter image description here

enter image description here

Thank you :)

\$\endgroup\$
11
  • 1
    \$\begingroup\$ I can't fully understand what your doing, but if you have discrete controller and a continuous plant, the usual approach is to combine \$(1-e^{-sT}) \rightarrow \frac{z-1}{z}\$ with the controller, and \$\frac{1}{sT}\$ with the plant. Then z-transform the continuous bits (or use the bilinear transform), and finally combine everything into a ZTF. \$\endgroup\$
    – Chu
    Commented Jul 9, 2021 at 12:21
  • \$\begingroup\$ Thank you for your reply ! @Chu I do not do what you are saying :/ I just place a transfer function into the S domain. $$\dfrac{1-e^{-sT}}{sT}$$ \$\endgroup\$
    – Jess
    Commented Jul 12, 2021 at 6:39
  • \$\begingroup\$ @AJN I will modify the post for updating the informations :) \$\endgroup\$
    – Jess
    Commented Jul 12, 2021 at 6:41
  • \$\begingroup\$ @Chu I will try to do what you say :) If you have any book to recommand me, do not hesitate :) \$\endgroup\$
    – Jess
    Commented Jul 12, 2021 at 7:03
  • \$\begingroup\$ @Chu I can not do what you are saying in your first comment. I have a mixed system. The compensation of the system is done numerically the rest of the system is done analogicaly. Nevertheless for studying the stability of my system, I do not know how to do it with a mixed system. So in order to obtain the discrete transfer function of my compensation, I decided to represent my whole system in the S domain and by taking into account the effect of sampling and DAC in the S domain. Then I could design a compensator correctly in the S domain that I would simply discretize it to obtain adiscrete TF \$\endgroup\$
    – Jess
    Commented Jul 12, 2021 at 11:24

1 Answer 1

2
\$\begingroup\$

Well, it was my bad. Everything is working perfectly on Matlab. The error was coming from the definition of the ZOH transfer function. I added a gain G0 as you can see. And this gain was not take into account on the other diagramms, so it could not fit with the diagramm with the LTI system block sys_zoh... Here are the results between the mixed system and the continuous system. As you can see the ZOH and sampling effect seems to be correctly took into account.

enter image description here

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.