Reputation: 469
I am trying to run a closed loop system on simulink as shown below.
When I run it it get this result.
As you can see, there is a slight time delay in getting the step function up to 1. The closed loop output also doesn't start until around 1.5 sec. I understand that this is what would occur in the real world, but I was wondering if there was a way to get rid of this time delay and make the output show 'ideal' results.
Thanks
Edit
Just thought i'd add a bit more info. The step input is a standard step input and the only things I have changed in terms of settings is the simulation time is 8 seconds, and the solver is a fixed-step ode1 (euler).
Upvotes: 0
Views: 879
Reputation: 10772
You are using a fixed step solver, so the step size defaults to (stop_time-start_time)/50, which in your case equals 0.16. Hence you do not have a time step at exactly 1s. At the 6th time step = 0.96, the step is 0. At the 7th time step = 1.12, the step is 1. That is exactly what is being shown, and correct for the simulation parameters you are using.
With a fixed step solver, if you want the step to occur at exactly 1s then you need to specify a step size so that the model takes a time step at 1s. You do that by going to the Solver panel of the Simulation Parameters pull down menu and change the Step Size to something appropriate. (Note that the plot will still show the step starting at 1, but finishing one time step later.)
Alternatively you can use a variable step solver. (This would display the step as being exactly vertical at 1s.)
Regarding the time delay, you have a 3 more poles than zeros so will have a 3 step time delay when using fixed-step Euler. The only way to change that is to use a different solver.
Upvotes: 2