Challenge

Project - Position control of mass spring damper system

project:~

%spring mass damper parameters
m=36;% mass in kg
k=400;% spring constant in N/m
c=100;%damping element in N/m
fn=1;%the natural frequency of spring-mass damper is 1Hz
zeta=0.5% under-damped system
wn=2*pi*fn;
wn
p1=-zeta*wn+wn*sqrt(zeta^2-1);
p2=-zeta*wn-wn*sqrt(zeta^2-1);
p=[p1;p2];
1/m

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.

Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.