# Matlab Derivative block analysis and filter design

May someone helps me regarding this!?

I have a controller which will control AC motor as attached. In this controller, a stage comes where I need to use a Derivative Block before point 'B' as shown in the attached picture "controller block diagram" in the attached link at the end of the this post. Now this derivative block adds some noise and fluctuation to the output of the system and I got the reason that why it happens. The reason is below:

"The Derivative block output might be very sensitive to the dynamics of the entire model. The accuracy of the output signal depends on the size of the time steps taken in the simulation. Smaller steps allow a smoother and more accurate output curve from this block. However, unlike with blocks that have continuous states, the solver does not take smaller steps when the input to this block changes rapidly. Depending on the dynamics of the driving signal and model, the output signal of this block might contain unexpected fluctuations. These fluctuations are primarily due to the driving signal output and solver step size. The exact linearization of the Derivative block is difficult because the dynamic equation for the block is y=˙u, which you cannot represent as a state-space system. The Laplace domain transfer function for the operation of differentiation is: Y(s)/X(s)=s This equation is not a proper transfer function, nor does it have a state-space representation. However, you can approximate the linearization by adding a pole to the Derivative to create a transfer function s/(c∗s+1). The addition of a pole filters the signal before differentiating it, which removes the effect of noise. A best practice is to change the value of c to1/fb, where fb is the break frequency for the filter" [ https://www.mathworks.com/help/simulink/slref/derivative.html#br3m9zv-1 ].

The reference above is from official Matlab Website which is 100% verified by Matlab, so we can totally rely on it.

Now my question here is if I follow the above reference and I replace my derivative block with filter $\frac{s}{c*s+1}$ where $c=\frac{1}{fc}$. HOW SHOULD I CHOOSE OR DESIGN THE VALUE OF $fc$? I also have the expected output signal characteristics and the bode plot as attached in the following link [ https://drive.google.com/open?id=0B9NQhKDld_D4T0xwZTdZY1V6NHM ].

• The derivative block amplifies noise (look at the Bode plot of $s$ to see why). The necessary filter will slow down response. If you are working on simulation, test and check what works better. If it's a real process, then you need to understand the frequency distribution of the noise. – Pait Jul 31 '17 at 12:54