Plecs { Name "buck_boost_average_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 [1921, 45; 3839, 2048] ZoomFactor 1.87249 SliderPosition [0, 0] ShowBrowser off BrowserWidth 100 Component { Type Sum Name "Sum2" Show off Position [160, 510] Direction up Flipped off Parameter { Variable "IconShape" Value "2" Show off } Parameter { Variable "Inputs" Value "|+-" Show off } } Component { Type Sum Name "Sum3" Show off Position [410, 510] Direction up Flipped off Parameter { Variable "IconShape" Value "2" Show off } Parameter { Variable "Inputs" Value "|+-" Show off } } Component { Type DiscreteTransferFunction Name "Discrete\nTransfer Fcn Vo" Show on Position [240, 510] 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 DiscreteTransferFunction Name "Discrete\nTransfer Fcn IL" Show on Position [485, 510] Direction right Flipped off Frame [-30, -15; 30, 15] LabelPosition [0, 18] LabelAlign up Parameter { Variable "Numerator" Value "[b0z_i b1z_i b2z_i]" Show off } Parameter { Variable "Denominator" Value "[a0z_i a1z_i a2z_i]" Show off } Parameter { Variable "Ts" Value "Tsamp" Show off } Parameter { Variable "X0" Value "0" Show off } } Component { Type ZeroOrderHold Name "Zero-Order\nHold Vfb" Show on Position [160, 665] Direction up Flipped off Parameter { Variable "Ts" Value "Tsamp" Show off } } Component { Type ZeroOrderHold Name "Zero-Order\nHold Ifb" Show on Position [410, 665] Direction up Flipped off Parameter { Variable "Ts" Value "Tsamp" Show off } } Component { Type Delay Name "Delay" Show on Position [685, 510] Direction right Flipped off Parameter { Variable "N" Value "1" Show off } Parameter { Variable "X0" Value "0" Show off } Parameter { Variable "Ts" Value "1/digital_controller_write_delay" Show off } } Component { Type Subsystem Name "Modulator" Show on Position [785, 510] Direction down Flipped off Frame [-50, -20; 50, 20] LabelPosition [0, 0] SampleTime "-1" MaskIconFrame on MaskIconOpaque off MaskIconRotates on Terminal { Type Output Position [-54, 0] Direction left } Terminal { Type Input Position [50, 0] Direction right } Schematic { Location [0, 20; 960, 467] ZoomFactor 1 SliderPosition [121, 0] ShowBrowser off BrowserWidth 100 Component { Type TriangleGenerator Name "Sawtooth\nGenerator" Show off Position [265, 95] Direction right Flipped on Parameter { Variable "Min" Value "0" Show off } Parameter { Variable "Max" Value "1" Show off } Parameter { Variable "f" Value "fsw" Show on } Parameter { Variable "DutyCycle" Value "1" Show off } Parameter { Variable "Delay" Value "0" Show off } } Component { Type RelationalOperator Name "Relational\nOperator" Show off Position [205, 150] Direction right Flipped on Parameter { Variable "Operator" Value "3" Show off } } Component { Type Output Name "PWM" Show on Position [150, 150] Direction left Flipped off Parameter { Variable "Index" Value "1" Show on } Parameter { Variable "Width" Value "-1" Show off } } Component { Type Gain Name "Gain" Show off Position [375, 155] Direction right Flipped on Parameter { Variable "K" Value "1/VM_i" Show off } Parameter { Variable "Multiplication" Value "1" Show off } } Component { Type Saturation Name "Saturation" Show off Position [295, 155] Direction right Flipped on Parameter { Variable "UpperLimit" Value "0.99" Show on } Parameter { Variable "LowerLimit" Value "0.01" Show on } } Component { Type Input Name "Vc" Show on Position [445, 155] Direction right Flipped on Parameter { Variable "Index" Value "2" Show on } Parameter { Variable "Width" Value "-1" Show off } } Connection { Type Signal SrcComponent "Sawtooth\nGenerator" SrcTerminal 1 Points [235, 95] DstComponent "Relational\nOperator" DstTerminal 1 } Connection { Type Signal SrcComponent "Relational\nOperator" SrcTerminal 3 DstComponent "PWM" DstTerminal 1 } Connection { Type Signal SrcComponent "Gain" SrcTerminal 2 DstComponent "Saturation" DstTerminal 1 } Connection { Type Signal SrcComponent "Vc" SrcTerminal 1 DstComponent "Gain" DstTerminal 1 } Connection { Type Signal SrcComponent "Saturation" SrcTerminal 2 DstComponent "Relational\nOperator" DstTerminal 2 } } } Component { Type Saturation Name "Saturation" Show on Position [335, 510] 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 Saturation Name "Saturation1" Show on Position [595, 510] 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 Constant Name "Voltage \nController\nReference" Show on Position [90, 510] Direction right Flipped off Frame [-10, -10; 10, 10] LabelPosition [0, 13] LabelAlign up Parameter { Variable "Value" Value "Vc_v" Show off } } Component { Type Goto Name "Goto6" Show off Position [870, 510] Direction right Flipped off Parameter { Variable "Tag" Value "PWM" Show off } Parameter { Variable "Visibility" Value "1" Show off } } Component { Type From Name "From1" Show off Position [410, 725] Direction up Flipped off Parameter { Variable "Tag" Value "IL" Show off } Parameter { Variable "Visibility" Value "1" Show off } } Component { Type From Name "From" Show off Position [160, 725] Direction up Flipped off Parameter { Variable "Tag" Value "Vo" Show off } Parameter { Variable "Visibility" Value "1" Show off } } Component { Type Gain Name "Voltage \nSensor Gain" Show on Position [160, 590] Direction up Flipped off Parameter { Variable "K" Value "Hs_v" Show off } Parameter { Variable "Multiplication" Value "1" Show off } } Component { Type Gain Name "Current\nSensor Gain" Show on Position [410, 590] Direction up Flipped off Parameter { Variable "K" Value "Hs_i" Show off } Parameter { Variable "Multiplication" Value "1" Show off } } Component { Type DCVoltageSource Name "V_dc" Show off Position [230, 225] Direction down Flipped on Parameter { Variable "V" Value "Vinput" Show on } } Component { Type Mosfet Name "T1" Show off Position [285, 115] Direction right 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 Resistor Name "R" Show off Position [575, 215] Direction down Flipped off Parameter { Variable "R" Value "Rload50" Show on } } Component { Type Capacitor Name "C1" Show off Position [485, 220] Direction down Flipped on Parameter { Variable "C" Value "Cout" Show on } Parameter { Variable "v_init" Value "0" Show on } } Component { Type Goto Name "Goto" Show off Position [760, 225] Direction left Flipped off Parameter { Variable "Tag" Value "Vo" Show off } Parameter { Variable "Visibility" Value "1" Show off } } Component { Type From Name "From2" Show off Position [285, 70] Direction down Flipped off Parameter { Variable "Tag" Value "PWM" Show off } Parameter { Variable "Visibility" Value "1" Show off } } Component { Type Resistor Name "R1" Show off Position [695, 185] Direction down Flipped off Parameter { Variable "R" Value "Rload50" Show on } } Component { Type Switch Name "S1" Show on Position [695, 230] Direction down Flipped off Parameter { Variable "s_init" Value "0" Show off } } Component { Type PulseGenerator Name "50% to 100%" Show on Position [640, 230] 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 [695, 290] Direction up Flipped off } Component { Type Ground Name "Ground1" Show off Position [230, 325] Direction up Flipped off } Component { Type Inductor Name "L1" Show off Position [335, 160] Direction up Flipped off Parameter { Variable "L" Value "Lout" Show on } Parameter { Variable "i_init" Value "0" Show off } } Component { Type Diode Name "D1" Show off Position [400, 115] Direction left Flipped on 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 Ammeter Name "Am1" Show on Position [335, 275] Direction up Flipped off } Component { Type Goto Name "Goto1" Show off Position [375, 275] Direction right Flipped off Parameter { Variable "Tag" Value "IL" Show off } Parameter { Variable "Visibility" Value "1" Show off } } Component { Type Resistor Name "R2" Show off Position [485, 160] Direction down Flipped off Parameter { Variable "R" Value "Cout_ESR" Show on } } Component { Type Resistor Name "R3" Show off Position [335, 220] Direction up Flipped off Parameter { Variable "R" Value "Lout_ESR" Show on } } Component { Type Voltmeter Name "Vout" Show on Position [795, 225] Direction down Flipped off } Component { Type From Name "From13" Show off Position [100, 230] Direction right Flipped off Parameter { Variable "Tag" Value "Vo" Show off } Parameter { Variable "Visibility" Value "1" Show off } } Component { Type From Name "From14" Show off Position [100, 210] Direction right Flipped off Parameter { Variable "Tag" Value "IL" Show off } Parameter { Variable "Visibility" Value "1" Show off } } Component { Type Scope Name "Scope" Show on Position [150, 220] 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" "AAZAAAAAEAAABkAAAAlAAAAAsBAAABAAAAAAAAAAAAAAAAZP////8AAACBAAAAAAAAAAMAAABgAAA" "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 } } } Connection { Type Signal SrcComponent "Sum2" SrcTerminal 1 DstComponent "Discrete\nTransfer Fcn Vo" DstTerminal 1 } Connection { Type Signal SrcComponent "Voltage \nSensor Gain" SrcTerminal 2 DstComponent "Sum2" DstTerminal 3 } Connection { Type Signal SrcComponent "Sum3" SrcTerminal 1 DstComponent "Discrete\nTransfer Fcn IL" DstTerminal 1 } Connection { Type Signal SrcComponent "Current\nSensor Gain" SrcTerminal 2 DstComponent "Sum3" DstTerminal 3 } Connection { Type Signal SrcComponent "Zero-Order\nHold Vfb" SrcTerminal 2 DstComponent "Voltage \nSensor Gain" DstTerminal 1 } Connection { Type Signal SrcComponent "Zero-Order\nHold Ifb" SrcTerminal 2 DstComponent "Current\nSensor Gain" DstTerminal 1 } Connection { Type Signal SrcComponent "Delay" SrcTerminal 2 DstComponent "Modulator" DstTerminal 2 } Connection { Type Signal SrcComponent "Discrete\nTransfer Fcn Vo" SrcTerminal 2 DstComponent "Saturation" DstTerminal 1 } Connection { Type Signal SrcComponent "Discrete\nTransfer Fcn IL" SrcTerminal 2 DstComponent "Saturation1" DstTerminal 1 } Connection { Type Signal SrcComponent "Saturation" SrcTerminal 2 DstComponent "Sum3" DstTerminal 2 } Connection { Type Signal SrcComponent "Saturation1" SrcTerminal 2 DstComponent "Delay" DstTerminal 1 } Connection { Type Signal SrcComponent "Voltage \nController\nReference" SrcTerminal 1 DstComponent "Sum2" DstTerminal 2 } Connection { Type Signal SrcComponent "Modulator" SrcTerminal 1 DstComponent "Goto6" DstTerminal 1 } Connection { Type Signal SrcComponent "From" SrcTerminal 1 DstComponent "Zero-Order\nHold Vfb" DstTerminal 1 } Connection { Type Signal SrcComponent "From1" SrcTerminal 1 DstComponent "Zero-Order\nHold Ifb" DstTerminal 1 } Connection { Type Wire SrcComponent "T1" SrcTerminal 1 Points [230, 115] DstComponent "V_dc" DstTerminal 1 } Connection { Type Wire SrcComponent "R" SrcTerminal 2 Points [575, 115] Branch { Points [485, 115] Branch { DstComponent "R2" DstTerminal 2 } Branch { DstComponent "D1" DstTerminal 1 } } Branch { Points [695, 115] Branch { Points [795, 115] DstComponent "Vout" DstTerminal 2 } Branch { DstComponent "R1" DstTerminal 2 } } } Connection { Type Wire SrcComponent "C1" SrcTerminal 2 Points [485, 305] Branch { Points [335, 305] Branch { Points [230, 305] Branch { DstComponent "V_dc" DstTerminal 2 } Branch { DstComponent "Ground1" DstTerminal 1 } } Branch { DstComponent "Am1" DstTerminal 2 } } Branch { Points [575, 305] Branch { DstComponent "R" DstTerminal 1 } Branch { Points [795, 305] DstComponent "Vout" DstTerminal 1 } } } Connection { Type Signal SrcComponent "From2" SrcTerminal 1 DstComponent "T1" DstTerminal 3 } 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 Wire SrcComponent "T1" SrcTerminal 2 Points [335, 115] Branch { DstComponent "D1" DstTerminal 2 } Branch { DstComponent "L1" DstTerminal 1 } } Connection { Type Signal SrcComponent "Am1" SrcTerminal 3 DstComponent "Goto1" DstTerminal 1 } Connection { Type Wire SrcComponent "C1" SrcTerminal 1 DstComponent "R2" DstTerminal 1 } Connection { Type Wire SrcComponent "Am1" SrcTerminal 1 DstComponent "R3" DstTerminal 2 } Connection { Type Wire SrcComponent "R3" SrcTerminal 1 DstComponent "L1" DstTerminal 2 } Connection { Type Signal SrcComponent "Vout" SrcTerminal 3 DstComponent "Goto" DstTerminal 1 } Connection { Type Signal SrcComponent "From14" SrcTerminal 1 Points [115, 210; 115, 215] DstComponent "Scope" DstTerminal 1 } Connection { Type Signal SrcComponent "From13" SrcTerminal 1 Points [115, 230; 115, 225] DstComponent "Scope" DstTerminal 2 } } } DemoSignature "yWNwROhNok8AtlqWGpnkjG0/zq2T39MB7l65Q/HENDU="