MATLAB user defined function results in finite rise time

1 次查看(过去 30 天)
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