Plecs { Name "full_bridge_peak_current_mode_Z_domain" Version "3.7" CircuitModel "ContStateSpace" StartTime "0.0" StopTime "simuation_total_time" Solver "radau" MaxStep "1e-3" InitStep "-1" FixedStep "1e-3" Refine "1" ZCStepSize "1e-9" RelTol "1e-3" AbsTol "-1" TurnOnThreshold "0" SyncFixedStepTasks "2" UseSingleCommonBaseRate "1" LossVariableLimitExceededMsg "3" NegativeSwitchLossMsg "3" DivisionByZeroMsg "2" StiffnessDetectionMsg "2" MaxConsecutiveZCs "1000" AssertionAction "1" InitializationCommands "fid = fopen(\"myfile.txt\");\n\nfor i = 1:100\n\tfli" "ne = fgetl(fid);\n\t\n\tif(fline == -1)\n\t\tbreak;\n\tend\n\n\tdisp(fline);" "\n\teval(fline);\n\t\t\n\t\nend\n\nfclose(fid)" InitialState "1" SystemState "" CodeGenTopologies "[]" CodeGenSwitchingAlgorithm "1" CodeGenMatrixCodingStyle "1" CodeGenParameterInlining "2" CodeGenInliningExceptions "AAAACwAAAAAA" CodeGenIntegerWordSize "32" CodeGenAbsTimeUsageMsg "3" CodeGenBaseName "" CodeGenOutputDir "" CodeGenExtraOpts "" ExtendedMatrixPrecision "1" MatrixSignificanceCheck "2" Schematic { Location [0, 45; 3840, 2060] ZoomFactor 1.87249 SliderPosition [478, 0] ShowBrowser off BrowserWidth 100 Component { Type Constant Name "Voltage \nController\nReference" Show on Position [145, 680] Direction right Flipped off Frame [-10, -10; 10, 10] LabelPosition [0, 13] LabelAlign up Parameter { Variable "Value" Value "Vc_v" Show off } } Component { Type Sum Name "Sum" Show off Position [210, 680] Direction up Flipped off Parameter { Variable "IconShape" Value "2" Show off } Parameter { Variable "Inputs" Value "|+-" Show off } } Component { Type Saturation Name "Saturation" Show on Position [380, 680] Direction right Flipped off Parameter { Variable "UpperLimit" Value "VM_i*0.99" Show on } Parameter { Variable "LowerLimit" Value "VM_i*0.01" Show on } } Component { Type Gain Name "Voltage \nSensor Gain" Show on Position [210, 755] Direction up Flipped off Parameter { Variable "K" Value "Hs_v" Show off } Parameter { Variable "Multiplication" Value "1" Show off } } Component { Type From Name "From11" Show off Position [210, 850] Direction up Flipped off Parameter { Variable "Tag" Value "Vo" Show off } Parameter { Variable "Visibility" Value "1" Show off } } Component { Type ZeroOrderHold Name "Zero-Order\nHold Vfb" Show on Position [210, 810] Direction up Flipped off Parameter { Variable "Ts" Value "Tsamp" Show off } } Component { Type DiscreteTransferFunction Name "Discrete\nTransfer Fcn Vo" Show on Position [285, 680] Direction right Flipped off Frame [-30, -15; 30, 15] LabelPosition [0, 18] LabelAlign up Parameter { Variable "Numerator" Value "[b0z_v b1z_v b2z_v]" Show off } Parameter { Variable "Denominator" Value "[a0z_v a1z_v a2z_v]" Show off } Parameter { Variable "Ts" Value "Tsamp" Show off } Parameter { Variable "X0" Value "0" Show off } } Component { Type Comparator Name "Comparator2" Show on Position [510, 675] Direction right Flipped off } Component { Type Sum Name "Sum3" Show off Position [440, 760] Direction left Flipped off Parameter { Variable "IconShape" Value "2" Show off } Parameter { Variable "Inputs" Value "|++" Show off } } Component { Type TriangleGenerator Name "Artifical Ramp2" Show on Position [490, 760] Direction left Flipped off Parameter { Variable "Min" Value "0" Show off } Parameter { Variable "Max" Value "Va" Show off } Parameter { Variable "f" Value "fsw" Show off } Parameter { Variable "DutyCycle" Value "0.99" Show off } Parameter { Variable "Delay" Value "0" Show off } } Component { Type From Name "From1" Show off Position [440, 800] Direction up Flipped off Parameter { Variable "Tag" Value "Ipri" Show off } Parameter { Variable "Visibility" Value "1" Show off } } Component { Type PulseGenerator Name "Pulse\nGenerator1" Show on Position [540, 605] Direction right Flipped off Parameter { Variable "Hi" Value "1" Show off } Parameter { Variable "Lo" Value "0" Show off } Parameter { Variable "f" Value "fsw" Show off } Parameter { Variable "DutyCycle" Value "0.01" Show off } Parameter { Variable "Delay" Value "0" Show off } } Component { Type Reference SrcComponent "Components/Control/Logical/SR Flip-flop" Name "SR Flip-flop1" Show on Position [635, 665] Direction up Flipped off Frame [-20, -20; 20, 20] LabelPosition [0, 23] LabelAlign up Parameter { Variable "x_init" Value "0" Show off } Terminal { Type Input Position [-20, 10] Direction left } Terminal { Type Input Position [-20, -10] Direction left } Terminal { Type Output Position [24, -10] Direction right } Terminal { Type Output Position [24, 10] Direction right } } Component { Type Reference SrcComponent "Components/Control/Logical/JK Flip-flop" Name "JK Flip-flop" Show on Position [785, 655] Direction up Flipped off Frame [-20, -20; 20, 20] LabelPosition [0, 23] LabelAlign up Parameter { Variable "trigger" Value "1" Show off } Parameter { Variable "x_init" Value "0" Show off } Terminal { Type Input Position [-20, -10] Direction left } Terminal { Type Input Position [-20, 0] Direction left } Terminal { Type Output Position [24, -10] Direction right } Terminal { Type Output Position [24, 10] Direction right } Terminal { Type Input Position [-20, 10] Direction left } } Component { Type Constant Name "Constant" Show on Position [690, 605] Direction right Flipped off Frame [-10, -10; 10, 10] LabelPosition [0, 13] LabelAlign up Parameter { Variable "Value" Value "1" Show off } } Component { Type LogicalOperator Name "Logical\nOperator" Show on Position [955, 615] Direction up Flipped off Parameter { Variable "Operator" Value "1" Show off } Parameter { Variable "Inputs" Value "2" Show off } } Component { Type From Name "From" Show off Position [915, 620] Direction right Flipped off Parameter { Variable "Tag" Value "osc" Show off } Parameter { Variable "Visibility" Value "2" Show off } } Component { Type From Name "From3" Show off Position [915, 600] Direction right Flipped off Parameter { Variable "Tag" Value "Q1" Show off } Parameter { Variable "Visibility" Value "2" Show off } } Component { Type LogicalOperator Name "Logical\nOperator1" Show on Position [955, 695] Direction up Flipped off Parameter { Variable "Operator" Value "1" Show off } Parameter { Variable "Inputs" Value "2" Show off } } Component { Type From Name "From4" Show off Position [915, 700] Direction right Flipped off Parameter { Variable "Tag" Value "osc" Show off } Parameter { Variable "Visibility" Value "2" Show off } } Component { Type From Name "From5" Show off Position [915, 680] Direction right Flipped off Parameter { Variable "Tag" Value "Q2" Show off } Parameter { Variable "Visibility" Value "2" Show off } } Component { Type Goto Name "Goto2" Show off Position [720, 700] Direction right Flipped off Parameter { Variable "Tag" Value "osc" Show off } Parameter { Variable "Visibility" Value "2" Show off } } Component { Type Goto Name "Goto3" Show off Position [835, 645] Direction right Flipped off Parameter { Variable "Tag" Value "Q1" Show off } Parameter { Variable "Visibility" Value "2" Show off } } Component { Type Goto Name "Goto4" Show off Position [835, 665] Direction right Flipped off Parameter { Variable "Tag" Value "Q2" Show off } Parameter { Variable "Visibility" Value "2" Show off } } Component { Type Goto Name "Goto5" Show off Position [1000, 615] Direction right Flipped off Parameter { Variable "Tag" Value "PWM1" Show off } Parameter { Variable "Visibility" Value "1" Show off } } Component { Type Goto Name "Goto7" Show off Position [1000, 695] Direction right Flipped off Parameter { Variable "Tag" Value "PWM2" Show off } Parameter { Variable "Visibility" Value "1" Show off } } Component { Type DCVoltageSource Name "V_dc" Show off Position [195, 195] Direction down Flipped on Parameter { Variable "V" Value "Vinput" Show on } } Component { Type Inductor Name "L1" Show off Position [700, 115] Direction left Flipped off Parameter { Variable "L" Value "Lout" Show on } Parameter { Variable "i_init" Value "0" Show off } } Component { Type Resistor Name "R" Show off Position [950, 210] Direction down Flipped off Parameter { Variable "R" Value "Rload50" Show on } } Component { Type Capacitor Name "C1" Show off Position [870, 275] Direction down Flipped on Parameter { Variable "C" Value "Cout" Show on } Parameter { Variable "v_init" Value "Vout" Show on } } Component { Type PlecsProbe Name "Probe\nIL-Vo" Show on Position [60, 185] Direction right Flipped off } Component { Type SignalDemux Name "Demux1" Show off Position [105, 185] Direction right Flipped on Parameter { Variable "Width" Value "2" Show off } } Component { Type Voltmeter Name "Vout" Show on Position [1105, 220] Direction up Flipped off } Component { Type Goto Name "Goto" Show off Position [1145, 220] Direction right Flipped off Parameter { Variable "Tag" Value "Vo" Show off } Parameter { Variable "Visibility" Value "1" Show off } } Component { Type Resistor Name "R1" Show off Position [1005, 365] Direction down Flipped off Parameter { Variable "R" Value "Rload50" Show on } } Component { Type Switch Name "S1" Show on Position [1005, 410] Direction down Flipped off Parameter { Variable "s_init" Value "0" Show off } } Component { Type PulseGenerator Name "50% to 100%" Show on Position [950, 410] Direction right Flipped off Parameter { Variable "Hi" Value "1" Show off } Parameter { Variable "Lo" Value "0" Show off } Parameter { Variable "f" Value "fdisturbance" Show off } Parameter { Variable "DutyCycle" Value "0.5" Show off } Parameter { Variable "Delay" Value "0" Show off } } Component { Type Ground Name "Ground" Show off Position [1005, 460] Direction up Flipped off } Component { Type Transformer Name "Tr2" Show on Position [520, 205] Direction right Flipped on Parameter { Variable "Windings" Value "[1 1]" Show off } Parameter { Variable "n" Value "[primary_turns_number secondary_turns_number]" Show off } Parameter { Variable "Polarity" Value "+" Show off } Parameter { Variable "Lm" Value "inf" Show off } Parameter { Variable "im0" Value "0" Show off } } Component { Type Mosfet Name "T2" Show off Position [415, 265] Direction down Flipped on Parameter { Variable "Ron" Value "0" Show off } Parameter { Variable "s_init" Value "0" Show off } Parameter { Variable "thermal" Value "" Show off } Parameter { Variable "T_init" Value "0" Show off } } Component { Type From Name "From9" Show off Position [460, 265] Direction left Flipped off Parameter { Variable "Tag" Value "PWM1" Show off } Parameter { Variable "Visibility" Value "1" Show off } } Component { Type Mosfet Name "T3" Show off Position [415, 140] Direction down Flipped on Parameter { Variable "Ron" Value "0" Show off } Parameter { Variable "s_init" Value "0" Show off } Parameter { Variable "thermal" Value "" Show off } Parameter { Variable "T_init" Value "0" Show off } } Component { Type From Name "From10" Show off Position [460, 140] Direction left Flipped off Parameter { Variable "Tag" Value "PWM2" Show off } Parameter { Variable "Visibility" Value "1" Show off } } Component { Type Ground Name "Ground1" Show off Position [870, 350] Direction up Flipped off } Component { Type Mosfet Name "T4" Show off Position [295, 265] Direction down Flipped on Parameter { Variable "Ron" Value "0" Show off } Parameter { Variable "s_init" Value "0" Show off } Parameter { Variable "thermal" Value "" Show off } Parameter { Variable "T_init" Value "0" Show off } } Component { Type Mosfet Name "T5" Show off Position [295, 140] Direction down Flipped on Parameter { Variable "Ron" Value "0" Show off } Parameter { Variable "s_init" Value "0" Show off } Parameter { Variable "thermal" Value "" Show off } Parameter { Variable "T_init" Value "0" Show off } } Component { Type From Name "From12" Show off Position [340, 140] Direction left Flipped off Parameter { Variable "Tag" Value "PWM1" Show off } Parameter { Variable "Visibility" Value "1" Show off } } Component { Type From Name "From13" Show off Position [340, 265] Direction left Flipped off Parameter { Variable "Tag" Value "PWM2" Show off } Parameter { Variable "Visibility" Value "1" Show off } } Component { Type Diode Name "D1" Show on Position [575, 130] Direction down Flipped off Parameter { Variable "Vf" Value "0" Show off } Parameter { Variable "Ron" Value "0" Show off } Parameter { Variable "thermal" Value "" Show off } Parameter { Variable "T_init" Value "0" Show off } } Component { Type Diode Name "D2" Show on Position [575, 275] Direction down Flipped off Parameter { Variable "Vf" Value "0" Show off } Parameter { Variable "Ron" Value "0" Show off } Parameter { Variable "thermal" Value "" Show off } Parameter { Variable "T_init" Value "0" Show off } } Component { Type Diode Name "D3" Show on Position [625, 130] Direction down Flipped off Parameter { Variable "Vf" Value "0" Show off } Parameter { Variable "Ron" Value "0" Show off } Parameter { Variable "thermal" Value "" Show off } Parameter { Variable "T_init" Value "0" Show off } } Component { Type Diode Name "D4" Show on Position [625, 275] Direction down Flipped off Parameter { Variable "Vf" Value "0" Show off } Parameter { Variable "Ron" Value "0" Show off } Parameter { Variable "thermal" Value "" Show off } Parameter { Variable "T_init" Value "0" Show off } } Component { Type Label Name "Label3" Show off Position [1005, 90] Direction up Flipped off Parameter { Variable "Tag" Value "Vout" Show off } Parameter { Variable "Visibility" Value "1" Show off } } Component { Type Resistor Name "R2" Show off Position [870, 195] Direction down Flipped off Parameter { Variable "R" Value "Cout_ESR" Show on } } Component { Type Resistor Name "R3" Show off Position [770, 115] Direction left Flipped off Parameter { Variable "R" Value "Lout_ESR" Show on } } Component { Type Scope Name "Scope" Show on Position [145, 185] Direction up Flipped off Location [0, 0; 0, 0] State "" SavedViews "" HeaderState "" PlotPalettes "" Axes "2" TimeRange "0" ScrollingMode "1" SingleTimeAxis "1" Open "0" Ts "-1" SampleLimit "0" XAxisLabel "" Axis { Name "IL" AutoScale 1 MinValue 0 MaxValue 1 Signals {} SignalTypes [ ] Untangle 0 KeepBaseline off BaselineValue 0 } Axis { Name "Vout" AutoScale 1 MinValue 0 MaxValue 1 Signals {} SignalTypes [ ] Untangle 0 KeepBaseline off BaselineValue 0 } Fourier { SingleXAxis on AxisLabel "Frequency" Scaling 0 PhaseDisplay 0 Axis { Name "" AutoScale 1 MinValue 0 MaxValue 1 Signals {} Untangle 0 KeepBaseline off BaselineValue 0 } Axis { Name "" AutoScale 1 MinValue 0 MaxValue 1 Signals {} Untangle 0 KeepBaseline off BaselineValue 0 } } } Component { Type Resistor Name "Rsense" Show on Position [245, 305] Direction right Flipped off Parameter { Variable "R" Value "Rsense" Show off } } Component { Type Voltmeter Name "Vm" Show on Position [245, 355] Direction right Flipped off } Component { Type Goto Name "Goto1" Show off Position [245, 390] Direction down Flipped off Parameter { Variable "Tag" Value "Ipri" Show off } Parameter { Variable "Visibility" Value "1" Show off } } Connection { Type Signal SrcComponent "Sum" SrcTerminal 1 DstComponent "Discrete\nTransfer Fcn Vo" DstTerminal 1 } Connection { Type Signal SrcComponent "Discrete\nTransfer Fcn Vo" SrcTerminal 2 DstComponent "Saturation" DstTerminal 1 } Connection { Type Signal SrcComponent "Voltage \nController\nReference" SrcTerminal 1 DstComponent "Sum" DstTerminal 2 } Connection { Type Signal SrcComponent "Voltage \nSensor Gain" SrcTerminal 2 DstComponent "Sum" DstTerminal 3 } Connection { Type Signal SrcComponent "From11" SrcTerminal 1 DstComponent "Zero-Order\nHold Vfb" DstTerminal 1 } Connection { Type Signal SrcComponent "Zero-Order\nHold Vfb" SrcTerminal 2 DstComponent "Voltage \nSensor Gain" DstTerminal 1 } Connection { Type Signal SrcComponent "Artifical Ramp2" SrcTerminal 1 DstComponent "Sum3" DstTerminal 3 } Connection { Type Signal SrcComponent "Sum3" SrcTerminal 1 Points [440, 670] DstComponent "Comparator2" DstTerminal 1 } Connection { Type Signal SrcComponent "Constant" SrcTerminal 1 Points [720, 605; 720, 645] Branch { DstComponent "JK Flip-flop" DstTerminal 1 } Branch { Points [720, 665] DstComponent "JK Flip-flop" DstTerminal 5 } } Connection { Type Signal SrcComponent "Logical\nOperator" SrcTerminal 1 DstComponent "Goto5" DstTerminal 1 } Connection { Type Signal SrcComponent "From" SrcTerminal 1 DstComponent "Logical\nOperator" DstTerminal 3 } Connection { Type Signal SrcComponent "From3" SrcTerminal 1 Points [925, 600] DstComponent "Logical\nOperator" DstTerminal 2 } Connection { Type Signal SrcComponent "Logical\nOperator1" SrcTerminal 1 DstComponent "Goto7" DstTerminal 1 } Connection { Type Signal SrcComponent "From4" SrcTerminal 1 DstComponent "Logical\nOperator1" DstTerminal 3 } Connection { Type Signal SrcComponent "From5" SrcTerminal 1 Points [925, 680] DstComponent "Logical\nOperator1" DstTerminal 2 } Connection { Type Signal SrcComponent "JK Flip-flop" SrcTerminal 4 DstComponent "Goto4" DstTerminal 1 } Connection { Type Signal SrcComponent "JK Flip-flop" SrcTerminal 3 DstComponent "Goto3" DstTerminal 1 } Connection { Type Signal SrcComponent "SR Flip-flop1" SrcTerminal 3 Points [690, 655] Branch { DstComponent "JK Flip-flop" DstTerminal 2 } Branch { Points [690, 700] DstComponent "Goto2" DstTerminal 1 } } Connection { Type Signal SrcComponent "Pulse\nGenerator1" SrcTerminal 1 Points [600, 605] DstComponent "SR Flip-flop1" DstTerminal 2 } Connection { Type Signal SrcComponent "Comparator2" SrcTerminal 3 DstComponent "SR Flip-flop1" DstTerminal 1 } Connection { Type Signal SrcComponent "Saturation" SrcTerminal 2 DstComponent "Comparator2" DstTerminal 2 } Connection { Type Wire SrcComponent "R" SrcTerminal 2 Points [950, 115] Branch { Points [870, 115] Branch { DstComponent "R2" DstTerminal 2 } Branch { DstComponent "R3" DstTerminal 2 } } Branch { Points [1005, 115] Branch { Points [1105, 115] DstComponent "Vout" DstTerminal 1 } Branch { DstComponent "R1" DstTerminal 2 } Branch { DstComponent "Label3" DstTerminal 1 } } } Connection { Type Signal SrcComponent "Probe\nIL-Vo" SrcTerminal 1 DstComponent "Demux1" DstTerminal 1 } Connection { Type Signal SrcComponent "Vout" SrcTerminal 3 DstComponent "Goto" DstTerminal 1 } Connection { Type Wire SrcComponent "R" SrcTerminal 1 Points [950, 330] Branch { Points [870, 330] Branch { DstComponent "C1" DstTerminal 2 } Branch { Points [625, 330] Branch { Points [575, 330] DstComponent "D2" DstTerminal 1 } Branch { DstComponent "D4" DstTerminal 1 } } Branch { DstComponent "Ground1" DstTerminal 1 } } Branch { Points [1105, 330] DstComponent "Vout" DstTerminal 2 } } Connection { Type Wire SrcComponent "S1" SrcTerminal 2 DstComponent "R1" DstTerminal 1 } Connection { Type Signal SrcComponent "50% to 100%" SrcTerminal 1 DstComponent "S1" DstTerminal 3 } Connection { Type Wire SrcComponent "S1" SrcTerminal 1 DstComponent "Ground" DstTerminal 1 } Connection { Type Signal SrcComponent "From9" SrcTerminal 1 DstComponent "T2" DstTerminal 3 } Connection { Type Signal SrcComponent "From10" SrcTerminal 1 DstComponent "T3" DstTerminal 3 } Connection { Type Wire SrcComponent "T2" SrcTerminal 2 Points [415, 305; 295, 305] Branch { Points [280, 305] Branch { DstComponent "Rsense" DstTerminal 1 } Branch { Points [280, 355] DstComponent "Vm" DstTerminal 1 } } Branch { DstComponent "T4" DstTerminal 2 } } Connection { Type Wire SrcComponent "T3" SrcTerminal 1 Points [415, 95; 295, 95] Branch { Points [195, 95] DstComponent "V_dc" DstTerminal 1 } Branch { DstComponent "T5" DstTerminal 1 } } Connection { Type Wire SrcComponent "T5" SrcTerminal 2 Points [295, 185] Branch { DstComponent "T4" DstTerminal 1 } Branch { DstComponent "Tr2" DstTerminal 1 } } Connection { Type Wire SrcComponent "T2" SrcTerminal 1 Points [415, 215] Branch { DstComponent "T3" DstTerminal 2 } Branch { DstComponent "Tr2" DstTerminal 2 } } Connection { Type Signal SrcComponent "From12" SrcTerminal 1 DstComponent "T5" DstTerminal 3 } Connection { Type Signal SrcComponent "From13" SrcTerminal 1 DstComponent "T4" DstTerminal 3 } Connection { Type Wire SrcComponent "Tr2" SrcTerminal 3 Points [530, 165; 575, 165] Branch { DstComponent "D1" DstTerminal 1 } Branch { DstComponent "D2" DstTerminal 2 } } Connection { Type Wire SrcComponent "Tr2" SrcTerminal 4 Points [625, 215] Branch { DstComponent "D4" DstTerminal 2 } Branch { DstComponent "D3" DstTerminal 1 } } Connection { Type Wire SrcComponent "D1" SrcTerminal 2 Points [625, 115] Branch { DstComponent "D3" DstTerminal 2 } Branch { DstComponent "L1" DstTerminal 1 } } Connection { Type Wire SrcComponent "C1" SrcTerminal 1 DstComponent "R2" DstTerminal 1 } Connection { Type Wire SrcComponent "R3" SrcTerminal 1 DstComponent "L1" DstTerminal 2 } Connection { Type Signal SrcComponent "Demux1" SrcTerminal 2 DstComponent "Scope" DstTerminal 1 } Connection { Type Signal SrcComponent "Demux1" SrcTerminal 3 DstComponent "Scope" DstTerminal 2 } Connection { Type Wire SrcComponent "V_dc" SrcTerminal 2 Points [195, 305; 210, 305] Branch { DstComponent "Rsense" DstTerminal 2 } Branch { Points [210, 355] DstComponent "Vm" DstTerminal 2 } } Connection { Type Signal SrcComponent "Vm" SrcTerminal 3 DstComponent "Goto1" DstTerminal 1 } Connection { Type Signal SrcComponent "From1" SrcTerminal 1 DstComponent "Sum3" DstTerminal 2 } } ProbeBlock { Tag "full_bridge_peak_current_mode_Z_domain/Probe\\nIL-Vo" Probe { Component "L1" Path "" Signals {"Inductor current"} } Probe { Component "C1" Path "" Signals {"Capacitor voltage"} } } } DemoSignature "9wPPuPfssWlqOej7A2cJ/4YZsFDhPKcYTA7fbQnt2fs="