Matlab step response. Just need a quick check

Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
12 replies · 3K views
AnkleBreaker
Messages
22
Reaction score
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
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..
 
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   Reactions: AnkleBreaker
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
 
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.
 
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
 
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
 
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   Reactions: AnkleBreaker
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
 
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.
 
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