MATLAB user defined function results in finite rise time

조회 수: 1 (최근 30일)
Anirudh Roy
Anirudh Roy 2019년 12월 1일
편집: Anirudh Roy 2019년 12월 1일
I am writing a behavioural code fo driving some setiches for a DC DC power converter. My code should produce (ideally) quasi squre waves (ie zero rise time) however during simulation its not the case.
Any help would be appreciated (regarding why this is happening and what can be done)Output_Waveforms_Gate_Driver.bmp
function [DIP1,DIP2,DN1,DN2,DOP1,DOP2,DOP3] = GATE_DRIVER(T,Tper) %T-real time, Tper- Period
t=mod(T,Tper);DOP2=0;DOP3=0;
if(t<3e-5) %Ton
DN2=1;
DN1=0;
DOP1=0;
DIP1=1;
DIP2=0;
else %Toff
DIP1=0;
DIP2=0;
DN2=0;
DN1=1;
DOP1=1;
end
Gate_Driver_Test.bmp

채택된 답변

Anirudh Roy
Anirudh Roy 2019년 12월 1일
편집: Anirudh Roy 2019년 12월 1일
The problem was that the step size was not fixed, fo example T=[1e-5,2e-5,4-5......] so at 2e-5 the utput was 1 but at 4-5 it was zero (for one particaular signal) so MATLAB made a linear interpolation for 3e-5.
The soln is to speicfy the step size keeping this interpolation in mind.

추가 답변 (0개)

카테고리

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

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by