How to add an s+1 block on simulink?

Hi everyone, I'm new to Simulink and had a quick question.
How do I add a block that says "s+1" on Simulink? I tried adding a transfer function with numerator [1 1] and denominator [1] but it won't let me do that. I understand s+1 is a lead/lag filter, but Simulink's transfer function lead/lag doesn't seem to match what I need. Any pointers would be much appreciated. Thanks!

4 commentaires

Sam Chak
Sam Chak le 22 Nov 2024
Control theory doesn't allow improper transfer function (degree of numerator > degree of denominator). Describe the control objective and performance requirements, as well as show us the Plant. Then, we may be able to advise you what to do.
Julian
Julian le 22 Nov 2024
This is the complete block diagram:
I'd like to use Simulink to plot the phase portrait of this system
Mathieu NOE
Mathieu NOE le 22 Nov 2024
s is a derivation, so s + 1 can be replaced by a derivative block in parallel to a unitary gain block , followed by a sum block
Paul
Paul le 22 Nov 2024
If using the Derivative block, be sure to read the doc page first and carefully review its recommendations and warnings.

Connectez-vous pour commenter.

Réponses (2)

Sam Chak
Sam Chak le 22 Nov 2024
Modifié(e) : Sam Chak le 23 Nov 2024

0 votes

Since you are unable to clearly define the control objective and performance requirements, I can only advise you to use the PD controller as a substitute for the '' (in the frequency domain), with a proportional gain and Derivative gain . However, there is a caveat in your design: it will only function properly as long as . No mathematical proof is provided in my response though.
Note: Please remember to disable the zero-crossing detection in the Sign block. This is a software technical issue, not a sliding mode control mathematics issue.

4 commentaires

Paul
Paul le 22 Nov 2024
Hi Sam,
Any recommendation on how to select the "Filter Coefficient (N)" in the PID controller block?
Also, why disable zero-crossing detection in the Sign block? Wouldn't it be important to accurately model the switch in this type of application?
Sam Chak
Sam Chak le 23 Nov 2024
In my run, I had to disable the zero-crossing detection; otherwise, it would throw an error message upon reaching the sliding manifold (x + x' = 0) due to rapid zero-crossing caused by the very high switching frequency from the Sign function block. I seldom use Simulink nowadays. Do you have a solution for this issue?
In determining the value for the 'Filter Coefficient (N)' in the PID controller block, I chose N = 1000 (without using a formula), which is a sufficiently high value to produce a stabilizing result. In the past, I used the Derivative block, similar to @Mathieu NOE's suggestion, to render the improper transfer functions. However, I prefer to use workarounds to substitute for or approximate certain control conditions.
Phase Portrait:
Error message:
I typically do not naively follow or construct models similar to those depicted in control block diagrams, as much information is often omitted from these diagrams in published papers to save space. Since @Julian did not provide additional information, I would likely design the following configuration, which allows for flexibility in tuning four control parameters and setting the initial values of the plant, without the need to design a state observer.
Unlike the solution depicted above, in the absence of external disturbances, the proposed controller will ensure global stability.
Control Block Diagram:
Phase Portrait:
Time response of the state x:
Paul
Paul le 23 Nov 2024
Hi Sam,
Becasue the OP is interested in the phase portrait with zero input, my inclination would be to implement the system like this wiht IC's on the second order integrator in the plant.
Next, I was thinking about a basic describing function analysis to determine if the loop is stable, but I can't recall if describing function analysis can be used when the loop transfer function has a pole in the RHP, as is the case here. I would try do some sort of analysis first to at least get a qualitative idea as to what might happen for different IC's and then simulate, at which point it might be clearer if zero-crossing detection is needed or not to get an accurate result.
Sam Chak
Sam Chak le 25 Nov 2024
Since the relay-type controller produces sustained oscillations as long as , I believe that the describing function method can be employed to conduct the analysis.

Connectez-vous pour commenter.

Rahul
Rahul le 22 Nov 2024
I understand that you are trying to implement a continuous transfer function ‘s+1’ in Simulink, where you are getting an error stating the given transfer function is an improper transfer function. the order of the transfer function numerator polynomial must be smaller than the degree of the denominator polynomial
You can try to add a MATLAB function to simulate the effect of (s) as a derivative and add 1, since Simulink operates in the time domain.
function y = transfer_func(u)
% Transfer function implementation: (s + 1)
persistent prev_u prev_y
if isempty(prev_u)
prev_u = 0;
prev_y = 0;
end
% Compute derivative term (approximation)
sample_time = 0.01; % Replace with your Simulink fixed-step size if known
du = (u - prev_u) / sample_time;
% Compute output
y = du + u; % s * u + 1 * u
% Update persistent states
prev_u = u;
end
I tried to simulate the given MATLAB function on a model containing a signal generator block, like sine wave, and then visualized the output in a scope block. Here’s the model structure along with the final output waveform:
This approach simulates the (s) operation by computing a numerical derivative using a simple difference quotient, and then adds 1 to the result. You can adjust the ‘dt value to match your system's sample time for accurate results.
To know more about the usage of ‘persistent’ variables, enter the following command in MATLAB:
>> doc persistent
Hope this helps!

Catégories

Produits

Version

R2024a

Question posée :

le 22 Nov 2024

Commenté :

le 25 Nov 2024

Community Treasure Hunt

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

Start Hunting!

Translated by