Sei sulla pagina 1di 7

PID CONTROL Lab report- 2013

M.Tech Mechatronics

Aim:

Demonstrate understanding of scilab for dealing with transfer function. Demonstrate its use for implementing a PID controller for stabilizing a 1- DOF robot manipulator. Use of PID controller for 1 dof manipulator.... Step by step process is discussed below. Step1 - The use of PID controller is discussed in submitted answer sheet. Step2 - The general block diagram of PID controller is drawn in the sheet. Step3 - Using scilab the PID controller is simulated. Step4 - We use Xcos in scilab for simulating the block diagram. Xcos is a block diagram Editor and GUI for hybrid simulator. Step5 - The below diagram explains simulation in Xcos and corresponding graph.

Logic:

Block Diagram:

Figure 2

Scilab comes with an application called Xcos. With this application we can formulate our problem. In Xcos we can construct models of hybrid dynamic models. Models can be assembled, loaded, saved, compiled, simulated using GUI of Xcos. We can use it as block diagram editor.

Results:

1) With P=1, I=0, D=0here

Here we can understand that the output shoots to peek after time lag, and it takes 9 sec to reach input value

2) With P=10, I=0, D=0

Here the signal overshoots and undershoots frequently and reaches near input at 10 sec

3) With P=10, I=2, D=6

Here the D component makes the output to reach input in 1.5 sec Code Generation_

function [x,y,typ]=PID(job,arg1,arg2) x=[];y=[],typ=[] select job case 'plot' then standard_draw(arg1) case 'getinputs' then [x,y,typ]=standard_inputs(arg1) case 'getoutputs' then [x,y,typ]=standard_outputs(arg1) case 'getorigin' then [x,y]=standard_origin(arg1) case 'set' then newpar=list(); xx1=arg1.model.rpar.objs(3) exprs(1)=xx1.graphics.exprs(1)

p_old=xx1.model.rpar xx2=arg1.model.rpar.objs(5) exprs(2)=xx2.graphics.exprs(1) i_old=xx2.model.rpar xx3=arg1.model.rpar.objs(6) exprs(3)=xx3.graphics.exprs(1) d_old=xx3.model.rpar y=0 while %t do [ok,p,i,d,exprs0]=scicos_getvalue('Set PID parameters',.. ['Proportional';'Integral';'Derivation'],list('vec',-1,'vec',-1,'vec',1),exprs) if ~ok then break,end if ok then xx1.graphics.exprs=exprs0(1) xx1.model.rpar=p xx2.graphics.exprs=exprs0(2) xx2.model.rpar=i xx3.graphics.exprs=exprs0(3) xx3.model.rpar=d arg1.model.rpar.objs(3)=xx1 arg1.model.rpar.objs(5)=xx2 arg1.model.rpar.objs(6)=xx3 break end end

Conclusion:
Thus we can understand that the PID controller is effective control method and it can be used for the robot manipulator which can be designed using Xcos of Scilab.

Potrebbero piacerti anche