Discrete input to continuous transfer function

12 vues (au cours des 30 derniers jours)
Luca Ferro
Luca Ferro le 14 Fév 2023
Commenté : Paul le 16 Fév 2023
I'm modeling a discrete pid to control a step response for a continuous system.
From left to right:
i have a continuous signal in feedback that is converted using ZOH to it's discrete counterpart. The scopes are there to check what actually happens and i can confirm that it gets correctly converted. Then the discrete signal goes into the discete pid and has the control variable as output, still discrete as it should be (scope confirms).
This is where i get lost (double red '?'): i put the discrete control variable in input to a continuous system and it actually works as intended by having a continuous output. But what actually happens to the signal? does the signal get converted to continuous and used as input to the continuous system? or somehow it uses it as discrete? Shouldn't it need an explicit DAC block (which i couldn't find)?
Any clarification would help.
FYI: the sample time is 0.01
  1 commentaire
Luca Ferro
Luca Ferro le 14 Fév 2023
I figured that continuous is just a cover up for very finely discrete. Nothing can be really continuous in simulink, the visualization in the scope is just a visual artifice.
Most probably what it does is a concealed rate transition between the 0,01 of the pid and the very fine sample time of the 'continuous'.
I'll keep the question open for some time, after that i will close it if there is no one to contribute to the discussion.

Connectez-vous pour commenter.

Réponse acceptée

Paul
Paul le 14 Fév 2023
Modifié(e) : Paul le 16 Fév 2023
Hi Luca,
I'm 99.99% sure that the output of a block with a Discrete Sample Time is held constant until it changes. I know that used to be explicitly documented. Maybe it still is, but I can't find it. Nothing else would make sense.
I wouldn't think of Continuous Sample Time as a "very fine sample time." Blocks with Continous Sample Time have to use the ode solver, which could be using variable steps, so it's not really like a very small Discrete Sample Time.
If you want, you can use a Rate Transition Block with appropriate settings to convert the Discrete Sample Time to Continuous, but I really don't think that's needed for basic simulation.
Also, I've always found it interesting (and troubling) that Simulink uses the ZOH block for an ADC, as in your model, even though in control system theory the ZOH is use to represent a DAC.
  2 commentaires
Luca Ferro
Luca Ferro le 16 Fév 2023
wouldn't using a rate transition block mean that the continuous is just a discrete with a different, finer, rate?
i agree, i wish there was a proper ADC and DAC block to make things clearer and simpler.
I forgot to mention that as it is right know it actually works properly with the expected results.
Also, i cut the ZOH and works the same meaning it was redundant and a hidden rate transition happens by default at the entry point of the pid as well
Paul
Paul le 16 Fév 2023
I'm not sure what you mean by "different, finer, rate." Continuous Sample Time should not be interpreted as if if it's a very small Discrete Sample Time if that's what you're thinking.
As I said, you could use a Rate Transition Block with appropriate parameters and get the exact same result as without it. In that sense, it's no different than what you have now.
Not surprised you can cut the ZOH block and it works, as long as the Sample Time parameter for PID(z) is set to the desired value, rather than inheriting from the Sample Time of the ZOH block.

Connectez-vous pour commenter.

Plus de réponses (0)

Produits


Version

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by