# Gain of an experimental first order step response

I have a pwm driven DC motor control system with magnetic encoder that measures the output shaft speed and outputs the RPM values every 50ms over serial comms to plot a graph of RPM vs Time. The system is stepped from 0 to 10% of the maximum possible duty cycle initially and then after a period of time stepped again from 10% of the maximum to 20% of the maximum. I would now like to determine the parameters of the system from this graph - mainly the time constant, gain and time delay.

$\tau$ is measured as 0.63 of the steady state value. So this is obtained by taking 0.63*112 = 70.56 and finding the corresponding time, roughly 400ms.

I'd like to know if I have the correct approach in obtaining the gain. I found this formula:

$K = \frac{\Delta Y}{\Delta U}(t \to \infty)$

Does this mean I can calculate the gain as the RPM difference between 10% and 20% duty cycle step divided by the difference between the duty cycle step. i.e

$K = \frac{120-112}{20-10} = 10.8$

edit:

I plotted the theoretical response obtained from the experimental response. The step to 20% duty cycle does not seem to correspond to the experimental output.

k = 10.8;
tau = 0.4;

num = k;
den = [tau 1];

H =tf(num,den,'InputDelay',0.1)

t = 0:0.01:10;
u = 10*(t>0)+10*(t>6);

lsim(H,u,t)


• Where does the 220 RPM come from? The graph shows 120 RPM, making $\Delta Y = 120-112$. Still, the system as plotted exhibits quite a non-linear behavior over the 0% to 20% range: the gain is clearly different on each step, which should not happen in a linear system if the control increase in each step was of the same amplitude. You can only approximate a first order linear system if you limit the considered operational range, it definitely is not first order linear system from the entirety of 0% to 20%. – Vicente Cunha Sep 1 '18 at 22:34
• @VicenteCunha apologies, that was a typo. Thanks for your response. In plotting the theoretical transfer function I noticed that for a gain of 10.8 the 20% input should give an RPM closer to 200 than 120 so something must be wrong in the physical system itself. – Blargian Sep 2 '18 at 8:28
• Decrease your sampling time (increase sampling freq.) in order to produce a decent plot. – Dirceu Rodrigues Jr Sep 2 '18 at 15:15