필터 지우기
필터 지우기

pid controller with daq

조회 수: 4 (최근 30일)
mado
mado 2014년 3월 26일
댓글: mado 2014년 3월 27일
i want to use PID to make control on buck converter , output the control signal using daq card usb6008 .
any suggestion on building the controller in real time. or how to do this equation
vn= vn-1+ kp(en - en-1) + ki((en + en-1)/2)t + kd/t(en - (2en-1) + en-2),
  댓글 수: 1
mado
mado 2014년 3월 27일
i tried this equation but it isn't working
for i=1:3
read=getsaample(ai)
Vmeasured=read(:,1)
e(i+1)= Vmeasured*2-Vref
IE=sum(e); %Integral of Error
%e= 18 - Vref
dt=.01
KP=2;
KI =1;
Int(i+1) = (e(i+1) + e(i))*dt/2; % integration of the error
I(i+1) = sum(Int); % the sum of the integration of the error
u=(KP*(e(i+1))+KI*I(i+1)) % control signal
end

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Electromechanical에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by