I have designed a digital controller to control a DC motor. The motor has the following parameters:
J = 0.01; % moment of inertia of the rotor 0.01 kg.m^2
b = 0.1; % motor viscous friction constant 0.1 N.m.s
K = 0.01; % electromotive force constant 0.01 V/rad/sec
% motor torque constant 0.01 N.m/Amp
R = 1; % electric resistance 1 Ohm
L = 0.5; % electric inductance 0.5 H
s = tf('s');
P_motor = K/((J*s+b)*(L*s+R)+K^2) % Open loop Transfer function of a Dc motor Speed/Voltage
I have used a Dahlin controller to control this motor with:
Ts=0.05;
k=2;
q=1;
Tz=((z^(-k-1))*(1-exp(-Ts/q)))/(1-(exp(-Ts/q))*z^(-1));
Dz=(1/(dP_motor))*(Tz/(1-Tz));
sys_cl_4 = feedback(Dz*dP_motor,1);
[x4,t] = step(sys_cl_4,8);
stairs(t,x4);
xlabel('Time (seconds)')
ylabel('Velocity (rad/s)')
title('Stairstep Response: with Dahlin controller')
The transfer function of the Dahlin controller is:
0.04877 z^6 - 0.1201 z^5 + 0.09688 z^4 - 0.02546 z^3
-------------------------------------------------------------------------
0.002059 z^7 - 0.002231 z^6 - 0.001445 z^5 + 0.001539 z^4 + 7.821e-05 z^3
The response of the motor to step input is fine, but I have some questions regarding this controller:
- The controller output goes up to 23.68 for 1rad/s (Step input),which can be considered as a saturation.
- The controller rings (oscillates) and it is undesirable as far as I know.

My question:
- How should I proceed, and what considerations should I take to avoid the saturation of the controller output.
- What makes this controller rings (oscillates), even though this controller is well known
Dahlin controllers can be susceptible to "ringing", as demonstrated here.
The cause of this issue can be seen when looking at the Bode plot of just the controller, which has a sharp increase in gain at the Nyquist frequency:
This increase comes from the inversion of the discretized transfer function of the motor. This transfer function of the motor has a very small gain at high frequencies and thus inverting this can lead to a high gain at that frequency in the control signal.
If you don't want to change the controller design too much, then you could compensate for this using some form of low-pass filter. For example consider to following two filters
\begin{align} H_1(z) &= \frac{z+1}{2\,z}, \\ H_2(z) &= \frac{1 - e^{-\omega\,T_s}}{z - e^{-\omega\,T_s}}. \end{align}
Since the controller has a numerator of lower order as its denominator, so one could also combine it with $H_1(z)$ while omitting the pole at $z=0$, resulting in a combined controller with equal order in the numerator and denominator. So I will use $H_1(z)=(z+1)/2$ instead. When choosing the cut-off frequency $\omega$ of $H_2(z)$ at 12 rad/s (or about 2 Hz) results in the following step responses:
All three filtered options reduce, but not completely remove, the ringing. One might be able to get less ringing with a different (low-pass) filter, maybe at the "cost" of a slightly different step response (of the complementary sensitivity).
Another option could be to shape the incoming reference signal, for example by adding a pre-filter, such that the reference signal doesn't excite the ringing mode. However, this is less robust to model variations.
It can be noted that one must always be care when dealing with controllers that utilize the inverse of the model of the system that you want to control. Namely, this can lead to that the control output contains strong oscillations, at the frequencies at which the system itself has very little response, such as at high frequencies for systems with high relative degree or at anti-resonances of the system. The effect of high relative degree on the controller output of a Dahlin controller is already demonstrated in this case, but a system with anti-resonance can also cause controller output of a Dahlin controller to be "ringing" at a low(er) frequency.
Another thing you have to be careful with are systems that are unstable or non-minimum phase.
It can also be noted that your controller can be of lower order, by using a minimum realization of it, which removes pole-zero cancelation. Assuming that you are using Matlab, you could do this using minreal. In this case this will reduce the controller from seventh order to forth order.