D6ad7101d01

  • Uploaded by: jumadul pilca
  • 0
  • 0
  • April 2020
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View D6ad7101d01 as PDF for free.

More details

  • Words: 813
  • Pages: 6
Progam matlab untuk pengontrolan mesin DC Untuk membuat program pengontrolan mesin Dc dengan menggunakan matlab, pertama tam kita harus bisa menentukan rangkaian ekuivalen dari mesin DC tersebut. Sekarang kita ambil contoh mesin DC dengan penguatan terpisah ( the separately magnetising DC Machine). Gambar rankgkainnya bisa dilihat di bawah ini :

Dari gambar dia ats maka kita bisa mencari persamaan rangkaian listriknya : dia dω r + ω rψ dan mekaniknya J = Te − TL = ψ ia − TL dt dt Dan setelah di laplace kan.. maka blok diagramnya akan sesuai dengan di bawah ini : U a = Ria + L

Kemudian untuk membuat kita akan menggunakan metode state space, beberapa hal yang harus diperhatikan yaitu : 1. States (x), biasanya merupakan kuantity yang menyimpan energy, seperti arus yang melalui induktor, tegangan yang ada di kapasitor, kecepatan dan posisi. 2. signal input (u) : bisa berupa tegangan input dan torka 3. signal output (y) : kecepatan dan arus

Dan bentuk dasar dari state space yaitu : .

x = Ax + Bu y = Cx + Du Dimana A, B, C dan D merupakan matriks Sehingga jka kita selesaikan persamaan diatas maka akan di dapatkan bentuk sebagai berikut : di a ψ ω r Ua dω r ω r i a bω r TL R = − ia − + = − − dan dt L L L dt J J J Sehingga matriknya yaitu :  ia   ia  U a  x =   , u =   , y =  ω r  ω r   TL   Te  Dan matriks A; B;C dan D nya yaitu sebagai berikut :  R ψ  1   1...0  − L− J   L ....0    A=   , B=   dan C =  0...1 ψ 1 b   0.. −  −  ψ ..0  J   J  J Kemudian baru kita buat program Matlabnya dengan simulinknya dengan menggunakan S-Sunction.. Kita buat program dengan nama simDCmach.m %***************************** % simDCmach % % program ini untuk mensimulasikan mesin dc penguatan terpisah % % %****************************** clear all close all clc % Bagian 1 definisi parameter wrat=2000*2*pi/60; %wrat is the kecepatan rating (n_rated =2000rpm) Umax=200; Imax=20; Pmek_rat=3600; Ra=1; La=0.028; psi=0.86; J=0.045; %beban %assuming linear load: T=bw b=Pmek_rat/wrat^2; %(P=T*w and T=b*w)

% setting up the simulation time and time step step=0.001; Tstart=0; Tstop=2; xi=[0;0]; %initial conditions, armature current and rotor speed. t=0:step:1; %time vector % formation of inputs Ua = 200; TstepTime=0.9; TstepValue=5; % bagian 2 simulation call sim('DSdcmach',[Tstart,Tstop]); % Call for the m-file that plots the results of the simulation postprocessingLM

Kemudian kita bikin program m –file lagi untuk eksekusi s-function dan disimpen dengan nama Dsdcmach.m function [sys,x0,str,ts] = dcmach(t,x,u,flag,Ra,La,psi,J,b,xi) %CSFUNC An example M-file S-function for defining a continuous system. % Example M-file S-function implementing continuous equations: % x' = Ax + Bu % y = Cx + Du % % See sfuntmpl.m for a general S-function template. % % See also SFUNTMPL. % Copyright (c) 1990-97 by The MathWorks, Inc. % $Revision: 1.4 $ switch flag, %%%%%%%%%%%%%%%%%% % Initialization % %%%%%%%%%%%%%%%%%% case 0, [sys,x0,str,ts]=mdlInitializeSizes(t,x,u,flag,Ra,La,psi,J,b,xi); %%%%%%%%%%%%%%% % Derivatives % %%%%%%%%%%%%%%% case 1, sys=mdlDerivatives(t,x,u,flag,Ra,La,psi,J,b,xi); %%%%%%%%%%% % Outputs % %%%%%%%%%%% case 3, sys=mdlOutputs(t,x,u,flag,Ra,La,psi,J,b,xi); %%%%%%%%%%%%%%%%%%% % Unhandled flags %

%%%%%%%%%%%%%%%%%%% case { 2, 4, 9 }, sys = []; %%%%%%%%%%%%%%%%%%%% % Unexpected flags % %%%%%%%%%%%%%%%%%%%% otherwise error(['Unhandled flag = ',num2str(flag)]); end % end csfunc % %====================================================================== ======= % mdlInitializeSizes % Return the sizes, initial conditions, and sample times for the Sfunction. %====================================================================== ======= % function [sys,x0,str,ts]=mdlInitializeSizes(t,x,u,flag,Ra,La,psi,J,b,xi) sizes = simsizes; sizes.NumContStates sizes.NumDiscStates sizes.NumOutputs sizes.NumInputs sizes.DirFeedthrough sizes.NumSampleTimes

= = = = = =

2; 0; 4; 3; 0; 1;

sys = simsizes(sizes); x0 = xi; str = []; ts = [0 0]; % end mdlInitializeSizes % %====================================================================== ======= % mdlDerivatives % Return the derivatives for the continuous states. %====================================================================== ======= % function sys=mdlDerivatives(t,x,u,flag,Ra,La,psi,J,b,xi) %state variables: x(1)=ia, x(2)=w; ia=x(1); w=x(2); % input signals from m-file u(1)=ua, u(3)=Textraload, u(2) not used; ua=u(1); Textraload=u(3); A=[-Ra/La psi/J B=[ 1/La

-psi/La -b/J]; 0

0

-1/J];

sys = A*[ia;w] + B*[ua;Textraload]; % end mdlDerivatives % %====================================================================== ======= % mdlOutputs % Return the block outputs. %====================================================================== ======= % function sys=mdlOutputs(t,x,u,flag,Ra,La,psi,J,b,xi) % the time t is already available in all function in the s-function ia=x(1); w=x(2); Te=psi*ia; sys = [t,ia,w,Te]; % end mdlOutputs

Kemudian kta bikin satu lagi m-file untuk menampilkan grafik keluarannya dan kita kasih nama psotprocessingLM.m % postprocessingLM Pe=Te.*w; Pa=Ua.*ia; plot(time,ia,'b') grid on xlabel('time (s)') ylabel('armature current (A)') title('start of DC-machine') figure plot(time,w*30/pi,'b') grid on xlabel('time (s)') ylabel('rotor speed (rpm)') title('start of DC-machine') figure plot(time,Te,'b') grid on xlabel('time (s)') ylabel('electrodynamical torque (Nm)') title('start of DC-machine') figure

plot(time,Pe,'b',time,Pa,'r') grid on xlabel('time (s)') ylabel('power (W)') title('Shaft power blue, armature power red')

selanjutnya kita masuk ke simulink dan kita bikin blok diagram seperti di bawah ini :

Related Documents

D6ad7101d01
April 2020 2

More Documents from "jumadul pilca"