MATLAB user defined function results in finite rise time

1 view (last 30 days)
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

Accepted Answer

Anirudh Roy
Anirudh Roy on 1 Dec 2019
Edited: Anirudh Roy on 1 Dec 2019
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.

More Answers (0)

Categories

Find more on Simulink in Help Center and File Exchange

Products


Release

R2018b

Community Treasure Hunt

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

Start Hunting!