Why is during intgration of velocity signal in simulink exhibits drift in position signal ?

8 vues (au cours des 30 derniers jours)
I have an input signal which is velocity v(t). Normally when you want the position signal x(t) then you can use the integrator block in simulink and it gives you the position signal. When i do this i got a position signal but it looks like it is drifting in time. Does someone have an explanation for this phenomena??

Réponses (2)

Jim Riggs
Jim Riggs le 2 Juil 2018
Modifié(e) : Jim Riggs le 2 Juil 2018
If you have two different simulation of the same thing that show different results, it is clearly an indication of an implementation difference. You should check your integrator implementation to see if it is an inherently inaccurate one (e.g. Euler integration). Is the integrator a fixed-step or variable step integrator? If variable step, how is the error controlled? These are all fundamental parameters which will significantly effect the numerical accuracy.
Looking at the integrator is just the first step. What about the over-all simulation time step and the other models in the two simulations? How do they compare/differ?

Captain Karnage
Captain Karnage le 19 Mai 2023
This is an old question, and I can't say for sure without seeing your exact Simulink model, but here is a potential answer. When you take the integral, you lose your initial conditions. The simplest example of this is a line. Standard x,y equation for a line is
y = mx + b
if you take dx/dy, you just get m. When you integrate that, now you get mx. You've lost the b. The b is your initial condition.
A way to overcome this is that the integral block can add a port for initial conditions. Go to the block paramters, then "initial condition source" and select "external".
Integrator Block Parameters
Then connect your original position signal with the initial condition port that appears.
If you're still seeing some drift, another option is to add an external reset as well (the line above the initial condition source). Then you have to determine what is the best reset signal - usually it's a zero crossing but it could be something else depending on your specific system. Then each time it is reset, it will also reset the initial conditions to whatever is connected.

Community Treasure Hunt

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

Start Hunting!

Translated by