# Motor Position Control

Posted on at

1. Objective

To control the position of motor by calculating its transfer function and construct its control system.

1. Analysis

I calculate the equation for this system and find its transfer function through which I design its controller(PID) and by changing its parameters (Kp,Kd,Ki) observe its response and check that for which values of parameters system gave exact output

1. Procedure
2.  Modeling:
• give values to the parameters
• Write equations for  the system
• Find transfer function from equation
• Also find matrix form in state space
• For conformation just run the code for above equations in Mat lab
1.  Analysis:
• For open and close loop systems plot step response and their stability
1.  PID controller:
2.  Proportional controller:

Check response of this controller for its different gains and get ignorable steady state error.

1. integrator controller:

Check response of this controller for its different gains and get ignorable rising time error

1. Differentiator  controller:

Check response of this controller for its different gains and get overshoot error.

1.  Results
2.   Modeling:

J = 3.2284E-6;

b = 3.5077E-6;

K = 0.0274;

R = 4;

L = 2.75E-6;

1.  . Transfer Function

P_motor = K/(s*((J*s+b)*(L*s+R)+K^2))

0.0274

-------------------------------------------

8.878e-12 s^3 + 1.291e-05 s^2 + 0.0007648 s

1.   State-Space

motor_ss = ss(A,B,C,D)

motor_ss =

a =   x1          x2          x3

x1           0           1           0

x2           0      -1.087        8487

x3           0       -9964  -1.455e+06

b =     u1

x1          0

x2          0

x3  3.636e+05

c =   x1  x2  x3

y1   1   0   0

d =  u1

y1   0

1.   Analysis:
2.  Open loop system:

command step to analyze the open-loop step response.

t = 0:0.001:0.2;

step(P_motor,t)

After this fig.we see that the output is approaches to infinity hence system get unstable

Command to check the stability of system

isstable(P_motor)

ans =  0

For stability we also check the poles of system

pole(P_motor)

so due to unstability of system and to make system stable we use close loop system (feed back system)

1. Close loop system:

After giving step response to feedback system we see that system approximately get stable