Plecs { Name "state_machine_example" Version "4.4" CircuitModel "ContStateSpace" StartTime "0.0" StopTime "0.1" 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 "" 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 [327, 127; 870, 362] ZoomFactor 1 SliderPosition [0, 0] ShowBrowser off BrowserWidth 100 Component { Type Integrator Name "Angle" Show on Position [300, 75] Direction right Flipped off Parameter { Variable "ExternalReset" Value "2" Show off } Parameter { Variable "InitialConditionSource" Value "1" Show off } Parameter { Variable "x0" Value "0" Show off } Parameter { Variable "ShowStatePort" Value "1" Show off } Parameter { Variable "UpperLimit" Value "inf" Show off } Parameter { Variable "LowerLimit" Value "-inf" Show off } } Component { Type TriangleGenerator Name "Speed" Show on Position [110, 145] Direction right Flipped off Parameter { Variable "Min" Value "0" Show off } Parameter { Variable "Max" Value "100" Show off } Parameter { Variable "f" Value "100" Show off } Parameter { Variable "DutyCycle" Value "0.5" Show off } Parameter { Variable "Delay" Value "0" Show off } } Component { Type Scope Name "Scope" Show on Position [425, 150] Direction up Flipped off Location [882, 126; 1506, 580] State "AAAA/wAAAAD9AAAAAgAAAAEAAAC0AAABdPwCAAAAA/sAAAAQAFoAbwBvA" "G0AQQByAGUAYQAAAAAA/////wAAAIQA////+wAAABQAUwBhAHYAZQBkAFYAaQBlAHcAcwAAAAAA//" "///wAAAGYA////+wAAAAwAVAByAGEAYwBlAHMAAAAAHAAAAXQAAABmAP///wAAAAMAAAJwAAAAkPw" "BAAAAAfsAAAAUAEQAYQB0AGEAVwBpAGQAZwBlAHQAAAAAAAAAAnAAAABCAP///wAAAnAAAAGqAAAA" "BAAAAAQAAAAIAAAACPwAAAABAAAAAgAAAAEAAAAOAFQAbwBvAGwAQgBhAHIBAAAAAP////8AAAAAA" "AAAAA==" SavedViews "AAAAAgAAAAA=" HeaderState "AAAA/wAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAL/gMAAAAJAAAAC" "QAAAGQAAAAIAAAAZAAAAAcAAABkAAAABgAAAGQAAAAFAAAAZAAAAAQAAABkAAAAAwAAAGQAAAACAA" "AAZAAAAAEAAABkAAAAggAAAAsBAAABAAAAAAAAAAAAAAAAZP////8AAACBAAAAAAAAAAsAAABvAAA" "AAQAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAQAAAAAAAAAA" "AAAAAQAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAQAAAAAAA" "AATAAAAAQAAAAAAAAPoAAAAABM=" PlotPalettes "AAAAAQAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAA" "AEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" "==" Axes "3" TimeRange "0" ScrollingMode "1" SingleTimeAxis "1" Open "0" Ts "-1" SampleLimit "0" XAxisLabel "" ShowLegend "1" Axis { Name "Speed" AutoScale 1 MinValue 0 MaxValue 1 Signals {"speed", "min"} SignalTypes [ ] Untangle 0 KeepBaseline off BaselineValue 0 } Axis { Name "Reset signal" AutoScale 1 MinValue 0 MaxValue 1 Signals {"Reset"} SignalTypes [ 2 ] Untangle 0 KeepBaseline off BaselineValue 0 } Axis { Name "Angle" AutoScale 1 MinValue 0 MaxValue 1 Signals {} SignalTypes [ 1 ] Untangle 0 KeepBaseline off BaselineValue 0 } Fourier { SingleXAxis on AxisLabel "Frequency" Scaling 0 PhaseDisplay 0 ShowFourierLegend off Axis { Name "" AutoScale 1 MinValue 0 MaxValue 1 Signals {"speed", "min"} Untangle 0 KeepBaseline off BaselineValue 0 } Axis { Name "" AutoScale 1 MinValue 0 MaxValue 1 Signals {"Reset"} Untangle 0 KeepBaseline off BaselineValue 0 } Axis { Name "" AutoScale 1 MinValue 0 MaxValue 1 Signals {} Untangle 0 KeepBaseline off BaselineValue 0 } } } Component { Type FsmBlock Name "State Machine" Show on Position [210, 150] Direction up Flipped off Frame [-45, -15; 45, 15] LabelPosition [0, 18] LabelAlign up Parameter { Variable "InputVariables" Value "speed,min" Show off } Parameter { Variable "InputTypes" Value "1,1" Show off } Parameter { Variable "InternalConstants" Value "" Show off } Parameter { Variable "InternalConstantValues" Value "" Show off } Parameter { Variable "InternalVariables" Value "" Show off } Parameter { Variable "InternalVariableValues" Value "" Show off } Parameter { Variable "OutputVariables" Value "reset" Show off } Parameter { Variable "Declarations" Value "" Show off } Parameter { Variable "TransitionOrder" Value "2" Show off } Parameter { Variable "SampleTime" Value "0" Show off } Parameter { Variable "Animate" Value "1" Show off } FSM { Location [358, 386; 904, 723] ZoomFactor 1 SliderPosition [0, 67] FsmState { Name ".PointState" Position [170, 40] } FsmState { Name "On" Position [240, 275] Frame [-60, -40; 60, 40] Parameter { Name "EnterAction" Value "reset=1;" } Parameter { Name "DuringAction" Value "" } Parameter { Name "ExitAction" Value "" } } FsmState { Name ".Junction" Position [230, 80] } FsmState { Name "ReadyForMin" Position [375, 165] Frame [-60, -40; 60, 40] Parameter { Name "EnterAction" Value "" } Parameter { Name "DuringAction" Value "" } Parameter { Name "ExitAction" Value "" } } FsmTransition { FsmSrcInfo { StatePath ".PointState" TerminalLoc bottom TerminalCoord 0.5 External on } FsmDstInfo { StatePath ".Junction" TerminalLoc top TerminalCoord 0.5 External on } SegmentLengths [] LabelPosition 0.5 Parameter { Name "Trigger" Value "" } Parameter { Name "Condition" Value "" } Parameter { Name "Action" Value "" } Parameter { Name "Priority" Value "1" } } FsmTransition { FsmSrcInfo { StatePath ".Junction" TerminalLoc bottom TerminalCoord 0.5 External on } FsmDstInfo { StatePath "On" TerminalLoc top TerminalCoord 0.403846 External on } SegmentLengths [] LabelPosition 0.5 Parameter { Name "Trigger" Value "" } Parameter { Name "Condition" Value "speed>min" } Parameter { Name "Action" Value "" } Parameter { Name "Priority" Value "1" } } FsmTransition { FsmSrcInfo { StatePath "On" TerminalLoc left TerminalCoord 0.46875 External on } FsmDstInfo { StatePath ".Junction" TerminalLoc left TerminalCoord 0.5 External on } SegmentLengths [-47] LabelPosition 0.5 Parameter { Name "Trigger" Value "" } Parameter { Name "Condition" Value "" } Parameter { Name "Action" Value "reset=0;" } Parameter { Name "Priority" Value "1" } } FsmTransition { FsmSrcInfo { StatePath ".Junction" TerminalLoc right TerminalCoord 0.5 External on } FsmDstInfo { StatePath "ReadyForMin" TerminalLoc top TerminalCoord 0.451923 External on } SegmentLengths [] LabelPosition 0.5 Parameter { Name "Trigger" Value "" } Parameter { Name "Condition" Value "" } Parameter { Name "Action" Value "" } Parameter { Name "Priority" Value "2" } } FsmTransition { FsmSrcInfo { StatePath "ReadyForMin" TerminalLoc bottom TerminalCoord 0.5 External on } FsmDstInfo { StatePath "On" TerminalLoc right TerminalCoord 0.515625 External on } SegmentLengths [] LabelPosition 0.5 Parameter { Name "Trigger" Value "speed>min" } Parameter { Name "Condition" Value "" } Parameter { Name "Action" Value "" } Parameter { Name "Priority" Value "1" } } } } Component { Type Constant Name "Constant" Show off Position [210, 70] Direction right Flipped off Frame [-10, -10; 10, 10] LabelPosition [0, 13] LabelAlign up Parameter { Variable "Value" Value "1" Show off } Parameter { Variable "DataType" Value "10" Show off } } Component { Type Constant Name "min" Show on Position [110, 190] Direction right Flipped off Frame [-20, -10; 20, 10] LabelPosition [0, 13] LabelAlign up Parameter { Variable "Value" Value "30" Show off } Parameter { Variable "DataType" Value "10" Show off } } Component { Type PlecsProbe Name "Probe" Show off Position [360, 130] Direction right Flipped off } Connection { Type Signal SrcComponent "Constant" SrcTerminal 1 DstComponent "Angle" DstTerminal 1 } Connection { Type Signal SrcComponent "Angle" SrcTerminal 2 Points [335, 75; 335, 160] DstComponent "Scope" DstTerminal 3 } Connection { Type Signal SrcComponent "State Machine" SrcTerminal 1 Points [270, 150] Branch { DstComponent "Angle" DstTerminal 3 } Branch { DstComponent "Scope" DstTerminal 2 } } Connection { Type Signal SrcComponent "min" SrcTerminal 1 Points [150, 190] DstComponent "State Machine" DstTerminal 3 } Connection { Type Signal SrcComponent "Speed" SrcTerminal 1 DstComponent "State Machine" DstTerminal 2 } Connection { Type Signal SrcComponent "Probe" SrcTerminal 1 Points [385, 140] DstComponent "Scope" DstTerminal 1 } } ProbeBlock { Tag "state_machine_example/Probe" Probe { Component "Speed" Path "" Signals {"Output"} } Probe { Component "min" Path "" Signals {"Constant"} } } } DemoSignature "73WjyFao5EHaiVhBDhG+5n9sLEI3u79d+6UHShlRoFw="