Plecs { Name "imperix_template" Version "4.4" CircuitModel "ContStateSpace" StartTime "0.0" StopTime "1.0" Timeout "" Solver "dopri" MaxStep "1e-3" InitStep "-1" FixedStep "1e-3" Refine "1" ZCStepSize "1e-9" RelTol "1e-3" AbsTol "-1" TurnOnThreshold "0" SyncFixedStepTasks "2" UseSingleCommonBaseRate "2" LossVariableLimitExceededMsg "3" NegativeSwitchLossMsg "3" DivisionByZeroMsg "3" StiffnessDetectionMsg "2" MaxConsecutiveZCs "1000" AlgebraicLoopWithStateMachineMsg "3" AssertionAction "1" InitializationCommands "% That variable is used in the configuration block\n" "% to define the frequency of Clock 0.\n% By default, it corresponds to the in" "terrupt\n% and sampling frequencies. \nf_clk0 = 20e3;" InitialState "1" SystemState "" TaskingMode "1" TaskConfigurations "" CodeGenParameterInlining "2" CodeGenFloatingPointFormat "2" CodeGenAbsTimeUsageMsg "3" CodeGenBaseName "" CodeGenOutputDir "" CodeGenExtraOpts "" CodeGenTarget "Generic" CodeGenTargetSettings "" ExtendedMatrixPrecision "1" MatrixSignificanceCheck "2" EnableStateSpaceSplitting "2" DisplayStateSpaceSplitting "1" DiscretizationMethod "2" ExternalModeSettings "" AlgebraicLoopMethod "1" AlgebraicLoopTolerance "1e-6" ScriptsDialogGeometry "" ScriptsDialogSplitterPos "0" Schematic { Location [6, 38; 467, 286] ZoomFactor 1 SliderPosition [0, 0] ShowBrowser off BrowserWidth 100 Component { Type Subsystem Name "Imperix controller" Show on Position [120, 135] Direction up Flipped off Frame [-60, -35; 60, 35] LabelPosition [0, 38] LabelAlign up TreatAsAtomicUnit on SampleTime "-1" TaskingMode "1" CodeGenEnable on CodeGenSampleTime "1/f_clk0" CodeGenDiscretizationMethod "2" CodeGenTarget "Imperix Controllers" CodeGenTargetSettings "AAAAfwAAAAAlUU1hcDxRU3RyaW5nLFFNYXA8UVN0cmluZyxRU" "3RyaW5nPiA+AAAAAAEAAAAmAEkAbQBwAGUAcgBpAHgAIABDAG8AbgB0AHIAbwBsAGwAZQByAHMAAA" "ABAAAAGgBjAGEAbgBfAGIAYQB1AGQAXwByAGEAdABlAAAADgAxADAAMAAwADAAMAAw" MaskDisplayLang "2" MaskIconFrame on MaskIconOpaque off MaskIconRotates on Terminal { Type Input Position [-60, 0] Direction left Index "1" } Terminal { Type Output Position [64, 0] Direction right Index "1" } Schematic { Location [470, 38; 968, 286] ZoomFactor 1 SliderPosition [0, 0] ShowBrowser off BrowserWidth 100 Component { Type Reference SrcComponent "Imperix_Control/Configuration" Name "Configuration" Show on Position [55, 85] Direction up Flipped off Frame [-30, -30; 30, 30] LabelPosition [0, 33] LabelAlign up Parameter { Variable "clock_freq" Value "f_clk0" Show off } Parameter { Variable "phase" Value "0.5" Show off } Parameter { Variable "postscaler" Value "0" Show off } Parameter { Variable "oversampling_conf" Value "1" Show off } Parameter { Variable "oversampling_phases" Value "[0.2 0.8]" Show off } Parameter { Variable "nbr_of_oversamples" Value "3" Show off } Parameter { Variable "adc_acq_delay" Value "1" Show off } Parameter { Variable "cycle_delay" Value "5e-6" Show off } Parameter { Variable "TargetPortIndices" Value "" Show off } Terminal { Type EventOutput Position [34, -15] Direction right } Terminal { Type EventOutput Position [34, 5] Direction right } Terminal { Type EventOutput Position [34, -5] Direction right } } Component { Type ControlTaskTrigger Name "Control Task Trigger" Show on Position [155, 70] Direction left Flipped on Parameter { Variable "CodeFcn" Value "if (Target.Family ~= \"Imperix Controllers\") then" "\n return 'This block is not compatible with the selected target family (\"%" "s\")' % {Target.Family}\nend\nlocal Require = ResourceList:new()\n\nRequire:a" "dd(Target.Coder.GetCtrlTaskTrigResource(0))\n\nreturn {\n\tRequire = Require" "\n}" Show off } } Component { Type Reference SrcComponent "Imperix_Control/ADC" Name "ADC" Show on Position [170, 145] Direction up Flipped off Frame [-30, -25; 30, 25] LabelPosition [0, 28] LabelAlign up Parameter { Variable "device" Value "0" Show off } Parameter { Variable "channel" Value "0" Show off } Parameter { Variable "adc_hist" Value "1" Show off } Parameter { Variable "adc_hist_depth" Value "2" Show off } Parameter { Variable "sensor" Value "1" Show off } Parameter { Variable "sensor_gain" Value "1" Show off } Parameter { Variable "sensor_offset" Value "0.0" Show off } Parameter { Variable "analog_gain" Value "1" Show off } Parameter { Variable "TargetPortIndices" Value "1" Show off } Terminal { Type Output Position [34, 0] Direction right } Terminal { Type EventInput Position [-30, 15] Direction left } } Component { Type Reference SrcComponent "Imperix_Control/CB_PWM" Name "PWM" Show on Position [440, 155] Direction up Flipped off Frame [-30, -30; 30, 30] LabelPosition [0, 33] LabelAlign up Parameter { Variable "nb_bbx" Value "0" Show off } Parameter { Variable "out_conf" Value "2" Show off } Parameter { Variable "pwm_out_single" Value "0" Show off } Parameter { Variable "pwm_out_dual" Value "0" Show off } Parameter { Variable "carrier" Value "1" Show off } Parameter { Variable "block_input_duty" Value "2" Show off } Parameter { Variable "block_input_phase" Value "1" Show off } Parameter { Variable "block_input_activate" Value "1" Show off } Parameter { Variable "rate" Value "2" Show off } Parameter { Variable "duty" Value "0.5" Show off } Parameter { Variable "phase" Value "0" Show off } Parameter { Variable "block_input_clock" Value "2" Show off } Parameter { Variable "dead_time" Value "1e-6" Show off } Parameter { Variable "sim_dead_time" Value "1" Show off } Parameter { Variable "TargetPortIndices" Value "2" Show off } Terminal { Type Input Position [-30, -10] Direction left } Terminal { Type Input Position [-30, 0] Direction left } Terminal { Type Input Position [-30, 5] Direction left } Terminal { Type EventInput Position [-30, 20] Direction left } } Connection { Type Event SrcComponent "Configuration" SrcTerminal 1 DstComponent "Control Task Trigger" DstTerminal 1 } Connection { Type Event SrcComponent "Configuration" SrcTerminal 2 Points [120, 90; 120, 160] DstComponent "ADC" DstTerminal 2 } Connection { Type Event SrcComponent "Configuration" SrcTerminal 3 Points [395, 80] DstComponent "PWM" DstTerminal 4 } Connection { Type Signal SrcComponent "ADC" SrcTerminal 1 Points [230, 145] } Connection { Type Signal Points [375, 145] DstComponent "PWM" DstTerminal 1 } Annotation { Name "Your control algorithm\ngoes here ..." Position [300, 145] } } } Component { Type Subsystem Name "Plant" Show on Position [325, 135] Direction up Flipped off Frame [-60, -35; 60, 35] LabelPosition [0, 38] LabelAlign up TreatAsAtomicUnit on SampleTime "-1" CodeGenDiscretizationMethod "2" CodeGenTarget "Generic" MaskDisplayLang "2" MaskIconFrame on MaskIconOpaque off MaskIconRotates on Terminal { Type Input Position [-60, 0] Direction left Index "1" } Terminal { Type Output Position [64, 0] Direction right Index "1" } Schematic { Location [6, 368; 467, 554] ZoomFactor 1 SliderPosition [0, 0] ShowBrowser off BrowserWidth 100 Component { Type Input Name "Simulation\ninput" Show on Position [85, 85] Direction right Flipped off Parameter { Variable "Index" Value "1" Show on } Parameter { Variable "DataType" Value "10" Show off } Parameter { Variable "Width" Value "-1" Show off } } Component { Type Output Name "Simulation\noutput" Show on Position [345, 85] Direction right Flipped off Parameter { Variable "Index" Value "2" Show on } Parameter { Variable "Width" Value "-1" Show off } } Annotation { Name "The simulation model of your\nconverter goes here ..." Position [210, 85] } } } Connection { Type Signal SrcComponent "Imperix controller" SrcTerminal 2 DstComponent "Plant" DstTerminal 1 } Connection { Type Signal SrcComponent "Plant" SrcTerminal 2 Points [410, 135; 410, 205; 40, 205; 40, 135] DstComponent "Imperix controller" DstTerminal 1 } Annotation { Name "Contains the simulation model of\nthe controlled system." Position [325, 60] } Annotation { Name "Contains the control implementation\nthat can be simulate" "d or executed\non an imperix target\n(B-Box RCP or B-Board PRO)" Position [120, 60] } } } DemoSignature "jz/X1tJrzRRP1qT1qf37jmJNtQGiIFZzjFHMgMWgf/Q="