Variable Gain Value Dependent on input in Simulink.

22 vues (au cours des 30 derniers jours)
Conor Hardiman
Conor Hardiman le 21 Mar 2017
Commenté : Ludo Houben le 20 Juin 2023
I am modelling a four wheeled vehicle in simulink using Newtons 2nd law
I wish to change the damping coefficient, currently a gain block, dependant on the input into the block.
Any ideas would be grateful, Thank you.

Réponse acceptée

ES
ES le 22 Mar 2017
no. This is not what i mean.
First if you have only two possible gains, then best way to do it is as below
My original answer was If you have more than two possible value for gain, instead of cascading many simple switches, you can have one multiport switch. Then based on the value of input, the multiport switch will produce the gain as output. .
  2 commentaires
Conor Hardiman
Conor Hardiman le 22 Mar 2017
Thank you, this worked perfectly
Ludo Houben
Ludo Houben le 20 Juin 2023
Hi ES
Is it possible to connect the CsR_High or CsR signal, which are used in the Gain block, to an inport? If yes, how to do this? Many thanks
Ludo

Connectez-vous pour commenter.

Plus de réponses (1)

ES
ES le 21 Mar 2017
what is "dependant on the input into the block"? If you want to change the gain from workspace, you can do so by specifying a workspace variable as gain in the block parameter. If you want to change the gain according to the value of input, you will have to model it.
For example if input is >0.5, pass it through a gain block with gain =100. else if input is <0.5, pass it through a gain block with gain =120. You can use a multiport switch to do this.
  2 commentaires
Conor Hardiman
Conor Hardiman le 21 Mar 2017
Thank you Chocolate,
I've had tried what you suggested, however the if block causes an error.
I tried the index vector and multipork block like you said.
Port 1 of 'Full_Simulation_Model_11DoF_1/Full Vehicle Model/LR/If' can only be connected to an action subsystem and may not be connected to more than one action subsystem.
The input going in is damper velocity and i want to specify two damping rates, one below 80 and one above.
Thanks
James Richard
James Richard le 14 Oct 2019
Could you please give me an example of variable gain by using the multiport switch? I have read the documentation and still haven't understand.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Automotive Applications dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by