MATLAB: There is a sudden jump from 0 to 2pi and from 2pi to 0 in position of DC motor in the Design in simulink? And why are the continuous simulations occurring in the design

dc motorposition;simulink

Here is a sudden jump from 0 to 2pi and from 2pi to 0 in position of DC motor in my Design in simulink. I want to know why this is happening.
And also the oscillations are also continuous, so how can we remove the continuously occuring oscillations.
PFA for the Reference design.

Best Answer

The quadrature shaft decoder outputs the current angle of motor's shaft, which can only vary between [0, 2*pi]. To convert it into a continuous signal, attach the unwarp block: https://www.mathworks.com/help/dsp/ref/unwrap.html after the position output of the decoder.
Related Question