Project - Position control of mass spring damper system
Obtain the transfer function of a mass spring damper system and use it in the model. Add a PID controller to adjust the force on mass so that its position follows a reference signal.
Ans.we have to add a control system to the model
m = 3.6; %kg k = 400; %N/m c = 100; %Ns/m
% This file contains the design parameter to model a Dc motor
J=0.01; % Moment of inertia of rotor in kg-m^2
B=0.1; % Motor viscous friction constant in N-m-s
Km=0.01; % Back EMF constant in N-M/amp
Kt=0.01; % Motor torque constant in N-m/amp
Ra=1.0; % Resistance of the armature in circuit in ohms
La=0.5;% Inductance of the armature circuit in henrieswhos
Kp=3.86;% Percenage gain
Kd=628.32;% Derivative gain
u=0.00;
%Nomial parameters of spring mass system
M=3.6;% mass of spring mass system
k=400;% stifness constant of the spring mass system
C=100;%Ns/m
%design parameters
fn=1.0;% wn/(2*pi)hz
wn=6.232;% sqrt(k/m) rad/sec
zeta=0.5;% under damped system design
%desired poles
p1=-zeta*wn+wn*sqrt(zeta^2-1);
p2=-zeta*wn-wn*sqrt(zeta^2-1);
%A&B matrices
A=[0 1;-k/M -C/M];
B=[0 1/M];
K1=Kp;
K2=Kd;