how to use previous value in simulink? [(k-1) value]
3 views (last 30 days)
Currently, I am designing filtered velocity of the two wheel balancing robot, using encoder, and accelerometer, using following 2 equation.
I am trying to use MATLAB function block in simulink, which is the following picture.
But there is an error which says that I can't use direct feedback..
Can somebody help me with this problem?
Les Beckham on 5 Jun 2023
It looks like what you need to do is remove the new_filtered_V input from your MATLAB function block and add this line at the top of your code:
That will eliminate the direct feedback and then the code will use the remembered previous value of new_filtered_V to update the new value.