Project - Position control of mass spring damper system
project:~







wn=2*pi*fn;
wn
zeta =
0.5000
wn =
6.2832
>> wn^2
ans =
39.4784
>> m
m =
36
>> 1/m
ans =
0.0278
zeta =
0.5000
wn =
6.2832
zeta =
0.5000
wn =
6.2832
ans =
0.0278
zeta =
0.5000
wn =
6.2832
ans =
0.0278
zeta =
0.5000
wn =
6.2832
ans =
0.0278
k/m
ans =
11.1111
>> 1/m
ans =
0.0278
>> out.input
ans =
27.5000
>> out.velocity
ans =
1.0e+248 *
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
1.4249
>> out.acc
ans =
1.0e+248 *
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
1.0122
>> out.displacement
ans =
1.0e+243 *
0
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
1.4006
>> subplot(211);plot(out.time,out.input,'bo');grid;hold;
Current plot held
>> subplot(211);plot(out.time,out.input,'bo');grid;hold;
>> subplot(211);plot(out.time,out.input,'m--');grid;hold;title('refrence signal');
Current plot held
>
>> subplot(212);plot(out.time,out.acc,'b--');grid;hold;title('acceleration');
>> subplot(313);plot(out.time,out.velocity,'y--');grid;hold;title('velocity');
Current plot held
Ki=2000;
>> subplot(313);plot(out.time,out.displacement,'m--');grid;hold;title('displacement');

conclusion:~ i have build a model having step as an input response usein kp,ki,kd and integrator blocks with different initial conditions.