Plecs { Name "forward_peak_current_mode_error_amplifier" 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 [301, 287; 2219, 2295] ZoomFactor 1.87249 SliderPosition [0, 0] ShowBrowser off BrowserWidth 100 Component { Type From Name "From9" Show off Position [695, 680] Direction up Flipped off Parameter { Variable "Tag" Value "Ifb" Show off } Parameter { Variable "Visibility" Value "1" Show off } } Component { Type Reference SrcComponent "Components/Control/Logical/SR Flip-flop" Name "SR Flip-flop1" Show on Position [865, 545] 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 PulseGenerator Name "Pulse\nGenerator1" Show on Position [770, 485] 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 Comparator Name "Comparator1" Show on Position [765, 555] Direction right Flipped off } Component { Type Sum Name "Sum2" Show off Position [695, 630] Direction left Flipped off Parameter { Variable "IconShape" Value "2" Show off } Parameter { Variable "Inputs" Value "|++" Show off } } Component { Type TriangleGenerator Name "Artifical Ramp1" Show on Position [745, 630] 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 Reference SrcComponent "Components/Electrical/Electronics/Op-Amp" Name "Op-Amp" Show on Position [240, 535] Direction up Flipped off Frame [-20, -20; 20, 20] LabelPosition [0, -23] LabelAlign down Parameter { Variable "A" Value "1e6" Show off } Terminal { Type Port Position [-25, -10] Direction left } Terminal { Type Port Position [-25, 10] Direction left } Terminal { Type Port Position [25, 0] Direction right } Terminal { Type Port Position [0, 15] Direction down } } Component { Type Ground Name "Ground2" Show off Position [135, 460] Direction right Flipped off } Component { Type Resistor Name "Rupper" Show on Position [85, 510] Direction up Flipped off Parameter { Variable "R" Value "Rupper" Show off } } Component { Type Resistor Name "Rbottom" Show on Position [85, 590] Direction up Flipped off Parameter { Variable "R" Value "Rbottom" Show off } } Component { Type Ground Name "Ground3" Show off Position [85, 645] Direction up Flipped off } Component { Type Resistor Name "Rz" Show on Position [215, 610] Direction right Flipped off Parameter { Variable "R" Value "Rz" Show off } } Component { Type Capacitor Name "Cz" Show on Position [265, 610] Direction right Flipped on Parameter { Variable "C" Value "Cz" Show off } Parameter { Variable "v_init" Value "0" Show off } } Component { Type Ground Name "Ground4" Show off Position [240, 565] Direction up Flipped off } Component { Type Capacitor Name "Cp" Show on Position [235, 665] Direction right Flipped on Parameter { Variable "C" Value "Cp" Show off } Parameter { Variable "v_init" Value "0" Show off } } Component { Type Voltmeter Name "Viref" Show on Position [365, 560] Direction up Flipped off } Component { Type Ground Name "Ground5" Show off Position [365, 600] Direction up Flipped off } Component { Type DCVoltageSource Name "Voltage \nController\nReference" Show on Position [180, 460] Direction left Flipped on Parameter { Variable "V" Value "Vc_v" Show off } } Component { Type Gain Name "Gain" Show on Position [510, 560] Direction right Flipped off Parameter { Variable "K" Value "EA_gain" Show off } Parameter { Variable "Multiplication" Value "1" Show off } } Component { Type Saturation Name "Saturation" Show on Position [435, 560] Direction right Flipped off Parameter { Variable "UpperLimit" Value "Vref_IC" Show on } Parameter { Variable "LowerLimit" Value "0" Show on } } Component { Type Saturation Name "Saturation1" Show on Position [590, 560] 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 Label Name "Label4" Show off Position [85, 460] Direction up Flipped off Parameter { Variable "Tag" Value "Vout" Show off } Parameter { Variable "Visibility" Value "1" Show off } } Component { Type Goto Name "Goto7" Show off Position [925, 535] Direction right Flipped off Parameter { Variable "Tag" Value "PWM" Show off } Parameter { Variable "Visibility" Value "1" Show off } } Component { Type DCVoltageSource Name "V_dc" Show off Position [275, 125] Direction down Flipped on Parameter { Variable "V" Value "Vinput" Show on } } Component { Type Inductor Name "L1" Show off Position [645, 95] 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 [880, 190] Direction down Flipped off Parameter { Variable "R" Value "Rload50" Show on } } Component { Type Capacitor Name "C1" Show off Position [800, 225] 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 [135, 110] Direction right Flipped off } Component { Type SignalDemux Name "Demux1" Show off Position [180, 110] Direction right Flipped on Parameter { Variable "Width" Value "2" Show off } } Component { Type Voltmeter Name "Vout" Show on Position [990, 190] Direction up Flipped off } Component { Type Goto Name "Goto" Show off Position [1035, 190] 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 [935, 310] Direction down Flipped off Parameter { Variable "R" Value "Rload50" Show on } } Component { Type Switch Name "S1" Show on Position [935, 355] Direction down Flipped off Parameter { Variable "s_init" Value "0" Show off } } Component { Type PulseGenerator Name "50% to 100%" Show on Position [880, 355] 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 [935, 415] Direction up Flipped off } Component { Type Transformer Name "Tr2" Show on Position [520, 135] 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 [435, 195] 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 [480, 195] Direction left Flipped off Parameter { Variable "Tag" Value "PWM" Show off } Parameter { Variable "Visibility" Value "1" Show off } } Component { Type Mosfet Name "T3" Show off Position [435, 70] 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 "From11" Show off Position [480, 70] Direction left Flipped off Parameter { Variable "Tag" Value "PWM" Show off } Parameter { Variable "Visibility" Value "1" Show off } } Component { Type Diode Name "D1" Show on Position [395, 80] 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 [355, 180] 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 Ground Name "Ground1" Show off Position [530, 300] Direction up Flipped off } Component { Type Diode Name "D3" Show on Position [565, 95] Direction left 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 [595, 190] 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 [935, 75] 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 [800, 170] Direction down Flipped off Parameter { Variable "R" Value "Cout_ESR" Show on } } Component { Type Resistor Name "R3" Show off Position [720, 95] Direction left Flipped off Parameter { Variable "R" Value "Lout_ESR" Show on } } Component { Type Scope Name "Scope" Show on Position [220, 110] Direction up Flipped off Location [971, 693; 1382, 1128] State "AAAA/wAAAAD9AAAAAgAAAAEAAAAAAAAAAPwCAAAAA/sAAAAQAFoAbwBvA" "G0AQQByAGUAYQAAAAAA/////wAAAGcA////+wAAABQAUwBhAHYAZQBkAFYAaQBlAHcAcwAAAAAA//" "///wAAAHEA////+wAAAAwAVAByAGEAYwBlAHMAAAAAAP////8AAABxAP///wAAAAMAAAAAAAAAAPw" "BAAAAAfsAAAAUAEQAYQB0AGEAVwBpAGQAZwBlAHQAAAAAAP////8AAABpAP///wAAAZsAAAGQAAAA" "BAAAAAQAAAAIAAAACPwAAAABAAAAAgAAAAEAAAAOAFQAbwBvAGwAQgBhAHIBAAAAAP////8AAAAAA" "AAAAA==" SavedViews "AAAAAgAAAAA=" HeaderState "AAAA/wAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAL/gMAAAAJAAAAC" "QAAAGQAAAAIAAAAZAAAAAcAAABkAAAABgAAAGQAAAAFAAAAZAAAAAQAAABkAAAAAwAAAGQAAAACAA" "AAZAAAAAEAAABkAAAA1QAAAAsBAAABAAAAAAAAAAAAAAAAZP////8AAACBAAAAAAAAAAMAAAChAAA" "AAQAAAAAAAAAAAAAACQAAAAAAAAA0AAAAAQAAAAA=" PlotPalettes "AAAAAQAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAA" "AEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=" 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 "R4" Show off Position [320, 235] Direction left Flipped off Parameter { Variable "R" Value "Rsense" Show on } } Component { Type Voltmeter Name "Vm1" Show on Position [320, 275] Direction right Flipped off } Component { Type Goto Name "Goto1" Show off Position [320, 310] Direction down Flipped off Parameter { Variable "Tag" Value "Ifb" Show off } Parameter { Variable "Visibility" Value "1" Show off } } Connection { Type Signal SrcComponent "Pulse\nGenerator1" SrcTerminal 1 Points [830, 485] DstComponent "SR Flip-flop1" DstTerminal 2 } Connection { Type Signal SrcComponent "Artifical Ramp1" SrcTerminal 1 DstComponent "Sum2" DstTerminal 3 } Connection { Type Signal SrcComponent "Comparator1" SrcTerminal 3 DstComponent "SR Flip-flop1" DstTerminal 1 } Connection { Type Signal SrcComponent "Sum2" SrcTerminal 1 Points [695, 550] DstComponent "Comparator1" DstTerminal 1 } Connection { Type Wire SrcComponent "Ground3" SrcTerminal 1 DstComponent "Rbottom" DstTerminal 2 } Connection { Type Wire SrcComponent "Rz" SrcTerminal 1 DstComponent "Cz" DstTerminal 1 } Connection { Type Wire SrcComponent "Ground4" SrcTerminal 1 DstComponent "Op-Amp" DstTerminal 4 } Connection { Type Wire SrcComponent "Viref" SrcTerminal 2 DstComponent "Ground5" DstTerminal 1 } Connection { Type Wire SrcComponent "Rz" SrcTerminal 2 Points [165, 610] Branch { Points [165, 545] Branch { DstComponent "Op-Amp" DstTerminal 2 } Branch { Points [85, 545] Branch { DstComponent "Rbottom" DstTerminal 1 } Branch { DstComponent "Rupper" DstTerminal 2 } } } Branch { Points [165, 665] DstComponent "Cp" DstTerminal 1 } } Connection { Type Wire SrcComponent "Cz" SrcTerminal 2 Points [305, 610] Branch { Points [305, 665] DstComponent "Cp" DstTerminal 2 } Branch { Points [305, 535] Branch { Points [365, 535] DstComponent "Viref" DstTerminal 1 } Branch { DstComponent "Op-Amp" DstTerminal 3 } } } Connection { Type Wire SrcComponent "Op-Amp" SrcTerminal 1 Points [210, 525; 210, 460] DstComponent "Voltage \nController\nReference" DstTerminal 1 } Connection { Type Wire SrcComponent "Voltage \nController\nReference" SrcTerminal 2 DstComponent "Ground2" DstTerminal 1 } Connection { Type Signal SrcComponent "Viref" SrcTerminal 3 DstComponent "Saturation" DstTerminal 1 } Connection { Type Signal SrcComponent "Saturation" SrcTerminal 2 DstComponent "Gain" DstTerminal 1 } Connection { Type Signal SrcComponent "Gain" SrcTerminal 2 DstComponent "Saturation1" DstTerminal 1 } Connection { Type Signal SrcComponent "Saturation1" SrcTerminal 2 DstComponent "Comparator1" DstTerminal 2 } Connection { Type Wire SrcComponent "Rupper" SrcTerminal 1 DstComponent "Label4" DstTerminal 1 } Connection { Type Signal SrcComponent "SR Flip-flop1" SrcTerminal 3 DstComponent "Goto7" DstTerminal 1 } Connection { Type Wire SrcComponent "R" SrcTerminal 2 Points [880, 95] Branch { Points [800, 95] Branch { DstComponent "R2" DstTerminal 2 } Branch { DstComponent "R3" DstTerminal 2 } } Branch { Points [935, 95] Branch { Points [990, 95] 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 [880, 275] Branch { Points [800, 275] Branch { DstComponent "C1" DstTerminal 2 } Branch { Points [595, 275] Branch { Points [530, 275] Branch { DstComponent "Tr2" DstTerminal 4 } Branch { DstComponent "Ground1" DstTerminal 1 } } Branch { DstComponent "D4" DstTerminal 1 } } } Branch { Points [990, 275] 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 "From10" SrcTerminal 1 DstComponent "T2" DstTerminal 3 } Connection { Type Signal SrcComponent "From11" SrcTerminal 1 DstComponent "T3" DstTerminal 3 } Connection { Type Wire SrcComponent "T2" SrcTerminal 2 Points [435, 235; 355, 235] Branch { DstComponent "R4" DstTerminal 2 } Branch { DstComponent "D2" DstTerminal 1 } Branch { Points [355, 275] DstComponent "Vm1" DstTerminal 1 } } Connection { Type Wire SrcComponent "Tr2" SrcTerminal 1 Points [435, 115] Branch { DstComponent "T3" DstTerminal 2 } Branch { Points [355, 115] DstComponent "D2" DstTerminal 2 } } Connection { Type Wire SrcComponent "Tr2" SrcTerminal 2 Points [435, 145] Branch { DstComponent "T2" DstTerminal 1 } Branch { Points [395, 145] DstComponent "D1" DstTerminal 1 } } Connection { Type Wire SrcComponent "T3" SrcTerminal 1 Points [435, 25; 395, 25] Branch { Points [275, 25] DstComponent "V_dc" DstTerminal 1 } Branch { DstComponent "D1" DstTerminal 2 } } Connection { Type Wire SrcComponent "Tr2" SrcTerminal 3 Points [530, 95] DstComponent "D3" DstTerminal 1 } Connection { Type Wire SrcComponent "D3" SrcTerminal 2 Points [595, 95] Branch { DstComponent "L1" DstTerminal 1 } Branch { DstComponent "D4" DstTerminal 2 } } 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 Signal SrcComponent "From9" SrcTerminal 1 DstComponent "Sum2" DstTerminal 2 } Connection { Type Wire SrcComponent "V_dc" SrcTerminal 2 Points [275, 235] Branch { DstComponent "R4" DstTerminal 1 } Branch { Points [275, 275] DstComponent "Vm1" DstTerminal 2 } } Connection { Type Signal SrcComponent "Vm1" SrcTerminal 3 DstComponent "Goto1" DstTerminal 1 } } ProbeBlock { Tag "forward_peak_current_mode_error_amplifier/Probe\\nIL-Vo" Probe { Component "L1" Path "" Signals {"Inductor current"} } Probe { Component "C1" Path "" Signals {"Capacitor voltage"} } } } DemoSignature "Vab5qpYTF0bwIcSUrKBUQ3WkdaqeK/KobKX4pKWbFWM="