Matlab step response. Just need a quick check

In summary: This was part of a question. In the question they say:Arm dynamics are represented by:G(s) = 3 / ((s^2) +3)So G(s) = 3 / ((s^2) +3) is part of the question and I did not derive itAnd they want us to find a phase lead controller/compensator to fit required poles, which I did. I was just confused on why the step response of the original system didn't behave normallyIn summary, the conversation discusses a question regarding a step response diagram created in Matlab, with the user seeking confirmation on its accuracy and troubleshooting potential errors. The conversation also touches on the concept of damping in control engineering and the relationship between a
  • #1
AnkleBreaker
22
1

Homework Statement


Could someone just quickly check my Step Reponse diagram which I made using Matlab. It does not look like the usual shape for a step response system which is making me a bit worried. I'm a fairly new to Matlab and Control Engineering
untitled.jpg

Homework Equations


G(s) = 3 / ((s^2) +3)

The Attempt at a Solution


This was the code which I entered in Matlab to obtain the above step response:
num = [3]
den = [1 0 3]
G=tf(num,den)
step(G)
 
Physics news on Phys.org
  • #3
Mark44 said:
The image you posted isn't showing up.

Here's your image:
View attachment 94899
Yes that's my image.. Very sorry.. I tried re uploading it and I thought it was working..
 
  • #4
AnkleBreaker said:
Yes that's my image.. Very sorry.. I tried re uploading it and I thought it was working..
I added more to my previous post after you replied...
 
  • Like
Likes AnkleBreaker
  • #5
Mark44 said:
I added more to my previous post after you replied...
untitled_after_help.jpg

This is the new step response graph I am getting after I did like you asked
 
  • #6
Correction:
Matlab:
G=tf(3, [1, 0, 3])
This is probably the same as what you initially tried.

I don't know much about Control Engineering, but I do know something about Laplace transforms and such. The inverse Laplace transform of your G(s) function, ##\mathcal{L}^{-1}[G(s)]##, is ##\sqrt{3}\sin(\sqrt{3}t)##. That would explain the oscillation of the graph you show, but it doesn't explain either the period of this graph or the range (low to high values). The time-domain function I show has a period of ##\frac{2\pi}{\sqrt{3}}## and an amplitude of ##\sqrt{3}##, meaning the values should range between ##-\sqrt{3}## and ##\sqrt{3}##. For your original graph, the values range between 0 and 2, and the period seems to be right around ##2\pi##. There also seems to be an upward shift by 1 unit.
 
  • #7
Mark44 said:
Correction:
Matlab:
G=tf(3, [1, 0, 3])
This is probably the same as what you initially tried.

I don't know much about Control Engineering, but I do know something about Laplace transforms and such. The inverse Laplace transform of your G(s) function, ##\mathcal{L}^{-1}[G(s)]##, is ##\sqrt{3}\sin(\sqrt{3}t)##. That would explain the oscillation of the graph you show, but it doesn't explain either the period of this graph or the range (low to high values). The time-domain function I show has a period of ##\frac{2\pi}{\sqrt{3}}## and an amplitude of ##\sqrt{3}##, meaning the values should range between ##-\sqrt{3}## and ##\sqrt{3}##. For your original graph, the values range between 0 and 2, and the period seems to be right around ##2\pi##. There also seems to be an upward shift by 1 unit.
Thank you very much for your help. I'll try to ask Sir tomorrow what went wrong with my graph. One last question, on the time axis I have only put values up to 50. Is that enough or should I put more/less than 50, in your opinion
 
  • #8
AnkleBreaker said:
Thank you very much for your help. I'll try to ask Sir tomorrow what went wrong with my graph. One last question, on the time axis I have only put values up to 50. Is that enough or should I put more/less than 50, in your opinion
50 should be enough, I think.

You didn't show the rest of your m-file, so perhaps there's something wrong in it. Here's a link to the documentation for step() - http://www.mathworks.com/help/control/ref/step.html
 
  • #9
AnkleBreaker said:

Homework Equations


G(s) = 3 / ((s^2) +3)
That is a second order system with zero damping, so once it is given a jolt it will oscillate sinusoidally forever, as your graph demonstrates.

To see what to expect in terms of damping and natural frequency, compare your system's denominator s2 + 3
with the denominator for a general second-order system, viz.,
s2 + 2ζωns + ωn2
 
  • Like
Likes AnkleBreaker
  • #10
NascentOxygen said:
That is a second order system with zero damping, so once it is given a jolt it will oscillate sinusoidally forever, as your graph demonstrates.

To see what to expect in terms of damping and natural frequency, compare your system's denominator s2 + 3
with the denominator for a general second-order system, viz.,
s2 + 2ζωns + ωn2
Ohh there was no damping ratio. I get it now. That explains a lot. Thank you very much
 
  • #11
Mark44 said:
50 should be enough, I think.

You didn't show the rest of your m-file, so perhaps there's something wrong in it. Here's a link to the documentation for step() - http://www.mathworks.com/help/control/ref/step.html
Thank you for all your help. User NascentOxygen's answer states that the graph oscillates infinitely due to there being an absence of a damper, which makes a lot of sense and explains a whole lot.
 
  • #12
AnkleBreaker said:
Ohh there was no damping ratio. I get it now. That explains a lot. Thank you very much
So possibly there is a mistake in your denominator? Perhaps you meant the denominator to be (s + 3)^2

How was the denominator determined?
 
  • #13
NascentOxygen said:
So possibly there is a mistake in your denominator? Perhaps you meant the denominator to be (s + 3)^2

How was the denominator determined?
This was part of a question. In the question they say:
Arm dynamics are represented by:
G(s) = 3 / ((s^2) +3)

So G(s) = 3 / ((s^2) +3) is part of the question and I did not derive it

And they want us to find a phase lead controller/compensator to fit required poles, which I did. I was just confused on why the step response of the original system didn't behave normally
 

What is a step response in Matlab?

A step response in Matlab is a plot that shows the behavior of a dynamic system when a step input is applied. It is used to analyze the stability and performance of a system.

How do I generate a step response plot in Matlab?

To generate a step response plot in Matlab, you can use the "step" function. This function takes in the system transfer function and other optional parameters, and produces a step response plot.

What does the step response plot tell me about my system?

The step response plot can provide information about the stability, settling time, and overshoot of a system. It can also be used to compare the performance of different systems.

Can I customize the step response plot in Matlab?

Yes, you can customize the step response plot in Matlab by changing the plot title, axis labels, and line colors. You can also add a legend and grid lines to the plot.

Are there any limitations to using the step response plot in Matlab?

One limitation of the step response plot in Matlab is that it assumes the system is linear and time-invariant. It may not accurately represent the behavior of nonlinear or time-varying systems.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
4
Views
2K
Replies
13
Views
4K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
4
Views
12K
  • Engineering and Comp Sci Homework Help
Replies
4
Views
13K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
6
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
4K
  • Engineering and Comp Sci Homework Help
Replies
3
Views
2K
Back
Top