MATLAB user defined function results in finite rise time

1 visualización (últimos 30 días)
Anirudh Roy
Anirudh Roy el 1 de Dic. de 2019
Editada: Anirudh Roy el 1 de Dic. de 2019
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

Respuesta aceptada

Anirudh Roy
Anirudh Roy el 1 de Dic. de 2019
Editada: Anirudh Roy el 1 de Dic. de 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.

Más respuestas (0)

Categorías

Más información sobre Simulink en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by