Model { Name "slcp1" Version 4.00 SampleTimeColors off LibraryLinkDisplay "none" WideLines off ShowLineDimensions off ShowPortDataTypes off ShowStorageClass off RecordCoverage off CovPath "/" CovSaveName "covdata" CovMetricSettings "d" CovNameIncrementing off CovHtmlReporting on BlockNameDataTip off BlockParametersDataTip on BlockDescriptionStringDataTip off ToolBar on StatusBar on BrowserShowLibraryLinks off BrowserLookUnderMasks off PreLoadFcn "initcp1" CloseFcn "AnimFigTitle = [winName, ': Cart & Pole Animation']" "; AnimFigH = findobj(0,'Name',AnimFigTitle); close(AnimFigH)" Created "Fri Jun 02 16:49:52 2000" Creator "pascal" UpdateHistory "UpdateHistoryNever" ModifiedByFormat "%" LastModifiedBy "nhickey" ModifiedDateFormat "%" LastModifiedDate "Fri Mar 30 15:08:32 2001" ModelVersionFormat "1.%" ConfigurationManager "none" SimParamPage "Solver" StartTime "0.0" StopTime "1000" SolverMode "SingleTasking" Solver "ode45" RelTol "1e-3" AbsTol "1e-6" Refine "1" MaxStep "0.1" MinStep "auto" MaxNumMinSteps "-1" InitialStep "auto" FixedStep "auto" MaxOrder 5 OutputOption "RefineOutputTimes" OutputTimes "[]" LoadExternalInput off ExternalInput "[t, u]" SaveTime off TimeSaveName "tout" SaveState off StateSaveName "xout" SaveOutput off OutputSaveName "yout" LoadInitialState off InitialState "xInitial" SaveFinalState off FinalStateName "xFinal" SaveFormat "Array" LimitDataPoints off MaxDataPoints "1000" Decimation "1" AlgebraicLoopMsg "warning" MinStepSizeMsg "warning" UnconnectedInputMsg "warning" UnconnectedOutputMsg "warning" UnconnectedLineMsg "warning" InheritedTsInSrcMsg "warning" SingleTaskRateTransMsg "none" MultiTaskRateTransMsg "error" IntegerOverflowMsg "warning" CheckForMatrixSingularity "none" UnnecessaryDatatypeConvMsg "none" Int32ToFloatConvMsg "warning" SignalLabelMismatchMsg "none" LinearizationMsg "none" VectorMatrixConversionMsg "none" SfunCompatibilityCheckMsg "none" BlockPriorityViolationMsg "warning" ArrayBoundsChecking "none" ConsistencyChecking "none" ZeroCross on Profile off SimulationMode "normal" RTWSystemTargetFile "grt.tlc" RTWInlineParameters off RTWRetainRTWFile off RTWTemplateMakefile "grt_unix.tmf" RTWMakeCommand "make_rtw" RTWGenerateCodeOnly off TLCProfiler off TLCDebug off TLCCoverage off AccelSystemTargetFile "accel.tlc" AccelTemplateMakefile "accel_default_tmf" AccelMakeCommand "make_rtw" TryForceingSFcnDF off ExtModeMexFile "ext_comm" ExtModeBatchMode off ExtModeTrigType "manual" ExtModeTrigMode "oneshot" ExtModeTrigPort "1" ExtModeTrigElement "any" ExtModeTrigDuration 1000 ExtModeTrigHoldOff 0 ExtModeTrigDelay 0 ExtModeTrigDirection "rising" ExtModeTrigLevel 0 ExtModeArchiveMode "off" ExtModeAutoIncOneShot off ExtModeIncDirWhenArm off ExtModeAddSuffixToVar off ExtModeWriteAllDataToWs off ExtModeArmWhenConnect on ExtModeLogAll on ExtModeAutoUpdateStatusClock on OptimizeBlockIOStorage on BufferReuse on ParameterPooling on BlockReductionOpt off RTWExpressionDepthLimit 5 BooleanDataType off BlockDefaults { Orientation "right" ForegroundColor "black" BackgroundColor "white" DropShadow off NamePlacement "normal" FontName "Helvetica" FontSize 10 FontWeight "normal" FontAngle "normal" ShowName on } AnnotationDefaults { HorizontalAlignment "center" VerticalAlignment "middle" ForegroundColor "black" BackgroundColor "white" DropShadow off FontName "Helvetica" FontSize 10 FontWeight "normal" FontAngle "normal" } LineDefaults { FontName "Helvetica" FontSize 9 FontWeight "normal" FontAngle "normal" } System { Name "slcp1" Location [363, 127, 894, 577] Open on ModelBrowserVisibility off ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "landscape" PaperPositionMode "auto" PaperType "usletter" PaperUnits "inches" ZoomFactor "100" ReportName "simulink-default.rpt" Block { BlockType "S-Function" Name "Animation" Ports [1] Position [410, 34, 465, 66] FunctionName "animcp1" PortCounts "[]" SFunctionModules "''" } Block { BlockType SubSystem Name "Cart & Pole\nDynamics" Ports [2, 4] Position [265, 185, 315, 240] ShowPortLabels off TreatAsAtomicUnit off RTWSystemCode "Auto" RTWFcnNameOpts "Auto" RTWFileNameOpts "Auto" MaskType "Cart & Pole" MaskDescription "Inverted Pendulum (cart & pole)" MaskHelp "Inverted Pendulum" MaskPromptString "Initial Conditions (angle, angular velocity, ca" "rt position and cart velocity):|Physical Specifications (cart mass and g):" MaskStyleString "edit,edit" MaskTunableValueString "on,on" MaskCallbackString "|" MaskEnableString "on,on" MaskVisibilityString "on,on" MaskToolTipString "on,on" MaskInitialization "init_cond = @1; spec = @2;mc=spec(1);g=spec(2);" MaskDisplay "plot(-4,-1,4,6,[0 3 2.8 -0.2 0],[1 5 5.15 1.15 " "1],[-1 -1 1 1 -1],[1 0 0 1 1],[-3.5 3.5],[0 0])" MaskIconFrame on MaskIconOpaque on MaskIconRotate "none" MaskIconUnits "autoscale" MaskValueString "[0, 0, 0, 0]|[1.0, 9.8]" MaskVariableAliases "," System { Name "Cart & Pole\nDynamics" Location [261, 554, 1061, 859] Open off ModelBrowserVisibility off ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "landscape" PaperPositionMode "auto" PaperType "usletter" PaperUnits "inches" ZoomFactor "100" Block { BlockType Inport Name "in_1" Position [60, 50, 80, 70] Port "1" Interpolate on } Block { BlockType Inport Name "in_2" Position [55, 210, 75, 230] Port "2" Interpolate on } Block { BlockType Fcn Name "Fcn2" Position [515, 220, 555, 240] ShowName off Expr "(u(1)+u(7)*u(6)*(u(4)*u(4)*u(2)-u(5)*u(3)))" "/(mc+u(7))" } Block { BlockType Fcn Name "Fcn3" Position [425, 85, 465, 105] ShowName off Expr "(g*u(2)+u(3)*((-u(1)-u(6)*u(5)*u(4)*u(4)*u(" "2))/(mc+u(6))))/(u(5)*(4/3-(u(6)*u(3)*u(3))/(mc+u(6))))" } Block { BlockType Fcn Name "Fcn4" Position [145, 69, 200, 91] ShowName off Expr "sin(u[1])" } Block { BlockType Fcn Name "Fcn5" Position [145, 98, 200, 122] ShowName off Expr "cos(u[1])" } Block { BlockType Gain Name "Gain" Position [110, 230, 145, 260] Gain "0.1" Multiplication "Element-wise(K.*u)" SaturateOnIntegerOverflow on } Block { BlockType Gain Name "Gain1" Position [155, 205, 190, 235] Gain "0.5" Multiplication "Element-wise(K.*u)" SaturateOnIntegerOverflow on } Block { BlockType Mux Name "Mux1" Ports [4, 1] Position [280, 54, 315, 111] ShowName off Inputs "4" DisplayOption "none" BusCreatorMode off } Block { BlockType Mux Name "Mux2" Ports [3, 1] Position [465, 208, 495, 252] ShowName off Inputs "[4,1,2]" DisplayOption "none" BusCreatorMode off } Block { BlockType Mux Name "Mux3" Ports [2, 1] Position [375, 73, 405, 117] ShowName off Inputs "[4,2]" DisplayOption "none" BusCreatorMode off } Block { BlockType Mux Name "Mux5" Ports [2, 1] Position [270, 207, 300, 258] ShowName off Inputs "2" DisplayOption "none" BusCreatorMode off } Block { BlockType Integrator Name "theta" Ports [1, 1] Position [570, 85, 590, 105] ExternalReset "none" InitialConditionSource "internal" InitialCondition "init_cond(1)" LimitOutput off UpperSaturationLimit "inf" LowerSaturationLimit "-inf" ShowSaturationPort off ShowStatePort off AbsoluteTolerance "auto" } Block { BlockType Integrator Name "theta dot" Ports [1, 1] Position [500, 85, 520, 105] ExternalReset "none" InitialConditionSource "internal" InitialCondition "init_cond(2)" LimitOutput off UpperSaturationLimit "inf" LowerSaturationLimit "-inf" ShowSaturationPort off ShowStatePort off AbsoluteTolerance "auto" } Block { BlockType Integrator Name "x" Ports [1, 1] Position [635, 220, 655, 240] ExternalReset "none" InitialConditionSource "internal" InitialCondition "init_cond(3)" LimitOutput off UpperSaturationLimit "inf" LowerSaturationLimit "-inf" ShowSaturationPort off ShowStatePort off AbsoluteTolerance "auto" } Block { BlockType Integrator Name "x dot" Ports [1, 1] Position [575, 220, 595, 240] ExternalReset "none" InitialConditionSource "internal" InitialCondition "init_cond(4)" LimitOutput off UpperSaturationLimit "inf" LowerSaturationLimit "-inf" ShowSaturationPort off ShowStatePort off AbsoluteTolerance "auto" } Block { BlockType Outport Name "out_1" Position [735, 85, 755, 105] Port "1" OutputWhenDisabled "held" InitialOutput "0" } Block { BlockType Outport Name "out_2" Position [740, 125, 760, 145] Port "2" OutputWhenDisabled "held" InitialOutput "0" } Block { BlockType Outport Name "out_3" Position [740, 165, 760, 185] Port "3" OutputWhenDisabled "held" InitialOutput "0" } Block { BlockType Outport Name "out_4" Position [740, 205, 760, 225] Port "4" OutputWhenDisabled "held" InitialOutput "0" } Line { SrcBlock "theta" SrcPort 1 Points [0, 0] Branch { DstBlock "out_1" DstPort 1 } Branch { Points [-25, 0; 0, -65; -445, 0; 0, 70] Branch { Points [0, 10] DstBlock "Fcn5" DstPort 1 } Branch { DstBlock "Fcn4" DstPort 1 } } } Line { SrcBlock "Fcn5" SrcPort 1 Points [20, 0; 0, -20] DstBlock "Mux1" DstPort 3 } Line { SrcBlock "Fcn4" SrcPort 1 Points [10, 0; 0, -5] DstBlock "Mux1" DstPort 2 } Line { SrcBlock "theta dot" SrcPort 1 Points [15, 0] Branch { DstBlock "theta" DstPort 1 } Branch { Points [0, 40] Branch { DstBlock "out_2" DstPort 1 } Branch { Points [-305, 0; 0, -30] DstBlock "Mux1" DstPort 4 } } } Line { SrcBlock "Fcn3" SrcPort 1 Points [10, 0] Branch { DstBlock "theta dot" DstPort 1 } Branch { Points [0, 30; -45, 0; 0, 105] DstBlock "Mux2" DstPort 2 } } Line { SrcBlock "Fcn2" SrcPort 1 DstBlock "x dot" DstPort 1 } Line { SrcBlock "Mux2" SrcPort 1 DstBlock "Fcn2" DstPort 1 } Line { SrcBlock "x dot" SrcPort 1 Points [0, 0] Branch { DstBlock "x" DstPort 1 } Branch { Points [15, 0; 0, -15] DstBlock "out_4" DstPort 1 } } Line { SrcBlock "x" SrcPort 1 Points [25, 0; 0, -55] DstBlock "out_3" DstPort 1 } Line { SrcBlock "in_1" SrcPort 1 DstBlock "Mux1" DstPort 1 } Line { SrcBlock "Mux3" SrcPort 1 DstBlock "Fcn3" DstPort 1 } Line { SrcBlock "Mux1" SrcPort 1 Points [10, 0] Branch { Points [0, 130] DstBlock "Mux2" DstPort 1 } Branch { DstBlock "Mux3" DstPort 1 } } Line { SrcBlock "Gain" SrcPort 1 DstBlock "Mux5" DstPort 2 } Line { SrcBlock "Mux5" SrcPort 1 Points [15, 0] Branch { Points [0, -130] DstBlock "Mux3" DstPort 2 } Branch { Points [130, 0] DstBlock "Mux2" DstPort 3 } } Line { SrcBlock "in_2" SrcPort 1 Points [15, 0] Branch { DstBlock "Gain" DstPort 1 } Branch { DstBlock "Gain1" DstPort 1 } } Line { SrcBlock "Gain1" SrcPort 1 DstBlock "Mux5" DstPort 1 } Annotation { Position [224, 199] VerticalAlignment "top" Text "half pole length" } Annotation { Position [222, 257] VerticalAlignment "top" Text "pole mass" } } } Block { BlockType Constant Name "Constant" Position [121, 155, 139, 175] Orientation "up" NamePlacement "alternate" Value "1" VectorParams1D on MaskIconFrame on MaskIconOpaque on MaskIconRotate "none" MaskIconUnits "autoscale" } Block { BlockType Constant Name "Constant1" Position [80, 70, 100, 90] NamePlacement "alternate" ShowName off Value "1" VectorParams1D on } Block { BlockType SubSystem Name "Double click\non this for demo.5" Ports [] Position [30, 362, 171, 395] DropShadow on ShowName off OpenFcn "initcp" ShowPortLabels off TreatAsAtomicUnit off RTWSystemCode "Auto" RTWFcnNameOpts "Auto" RTWFileNameOpts "Auto" MaskDisplay "disp('Variable Initialization')" MaskIconFrame on MaskIconOpaque on MaskIconRotate "none" MaskIconUnits "autoscale" System { Name "Double click\non this for demo.5" Location [-10, 380, 117, 533] Open off ModelBrowserVisibility off ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "landscape" PaperPositionMode "auto" PaperType "usletter" PaperUnits "inches" ZoomFactor "100" } } Block { BlockType Reference Name "Fuzzy Logic\nController" Ports [1, 1] Position [230, 345, 290, 395] Orientation "left" FontName "Arial" SourceBlock "fuzblock/Fuzzy Logic \nController" SourceType "FIS" fis "fismat" } Block { BlockType Mux Name "Mux" Ports [5, 1] Position [335, 70, 375, 105] Orientation "up" ShowName off Inputs "5" DisplayOption "none" BusCreatorMode off MaskIconFrame on MaskIconOpaque on MaskIconRotate "none" MaskIconUnits "autoscale" } Block { BlockType Mux Name "Mux1" Ports [5, 1] Position [320, 342, 360, 398] Orientation "left" ShowName off Inputs "5" DisplayOption "none" BusCreatorMode off MaskIconFrame on MaskIconOpaque on MaskIconRotate "none" MaskIconUnits "autoscale" } Block { BlockType Mux Name "Mux2" Ports [2, 1] Position [450, 124, 480, 151] ShowName off Inputs "2" DisplayOption "none" BusCreatorMode off } Block { BlockType Scope Name "Scope" Ports [1] Position [500, 127, 520, 153] ShowName off Floating off Location [229, 513, 509, 733] Open off NumInputPorts "1" TickLabels "on" ZoomMode "on" List { ListType AxesTitles axes1 "%" } Grid "on" TimeRange "10.000000" YMin "-2.000000" YMax "2.000000" SaveToWorkspace off SaveName "ScopeData" DataFormat "Array" LimitDataPoints on MaxDataPoints "5000" Decimation "1" SampleInput off SampleTime "0" } Block { BlockType Sum Name "Sum" Ports [2, 1] Position [405, 255, 425, 275] Orientation "down" ShowName off IconShape "rectangular" Inputs "+-" SaturateOnIntegerOverflow on MaskIconFrame on MaskIconOpaque on MaskIconRotate "none" MaskIconUnits "autoscale" } Block { BlockType Sum Name "Sum1" Ports [2, 1] Position [160, 65, 180, 85] ShowName off IconShape "rectangular" Inputs "++" SaturateOnIntegerOverflow on } Block { BlockType Switch Name "Switch" Position [175, 114, 200, 146] Threshold "0" } Block { BlockType SignalGenerator Name "Target Position" Position [55, 103, 100, 137] WaveForm "sawtooth" Amplitude "1.500000" Frequency "0.628320" Units "rad/sec" VectorParams1D on } Block { BlockType Constant Name "Target Position\n(Mouse-Driven)" Position [137, 185, 163, 205] Orientation "up" NamePlacement "alternate" Value "-1.3651" VectorParams1D on MaskIconFrame on MaskIconOpaque on MaskIconRotate "none" MaskIconUnits "autoscale" } Block { BlockType SignalGenerator Name "Target Position1" Position [65, 28, 110, 62] ShowName off WaveForm "sine" Amplitude "0.500000" Frequency "6.000000" Units "rad/sec" VectorParams1D on } Line { SrcBlock "Mux1" SrcPort 1 DstBlock "Fuzzy Logic\nController" DstPort 1 } Line { SrcBlock "Sum" SrcPort 1 Points [0, 90] DstBlock "Mux1" DstPort 3 } Line { SrcBlock "Cart & Pole\nDynamics" SrcPort 2 Points [110, 0; 0, 155] DstBlock "Mux1" DstPort 2 } Line { SrcBlock "Cart & Pole\nDynamics" SrcPort 1 Points [15, 0] Branch { Points [105, 0; 0, 160] DstBlock "Mux1" DstPort 1 } Branch { DstBlock "Mux" DstPort 1 } } Line { SrcBlock "Cart & Pole\nDynamics" SrcPort 3 Points [25, 0] Branch { DstBlock "Mux" DstPort 2 } Branch { Points [65, 0] Branch { DstBlock "Sum" DstPort 1 } Branch { Points [0, -75] DstBlock "Mux2" DstPort 2 } } } Line { SrcBlock "Fuzzy Logic\nController" SrcPort 1 Points [-15, 0; 0, -170; 25, 0] Branch { DstBlock "Cart & Pole\nDynamics" DstPort 1 } Branch { Points [0, -80] DstBlock "Mux" DstPort 3 } } Line { SrcBlock "Switch" SrcPort 1 Points [160, 0] Branch { DstBlock "Mux" DstPort 4 } Branch { Points [55, 0] Branch { DstBlock "Sum" DstPort 2 } Branch { DstBlock "Mux2" DstPort 1 } } } Line { SrcBlock "Cart & Pole\nDynamics" SrcPort 4 Points [80, 0; 0, 145] DstBlock "Mux1" DstPort 4 } Line { SrcBlock "Mux" SrcPort 1 Points [0, -15] DstBlock "Animation" DstPort 1 } Line { SrcBlock "Mux2" SrcPort 1 DstBlock "Scope" DstPort 1 } Line { SrcBlock "Target Position\n(Mouse-Driven)" SrcPort 1 Points [0, -40] DstBlock "Switch" DstPort 3 } Line { SrcBlock "Constant" SrcPort 1 Points [0, -20] DstBlock "Switch" DstPort 2 } Line { SrcBlock "Target Position" SrcPort 1 DstBlock "Switch" DstPort 1 } Line { SrcBlock "Sum1" SrcPort 1 Points [60, 0; 0, 65] Branch { Points [0, 85] DstBlock "Cart & Pole\nDynamics" DstPort 2 } Branch { Points [130, 0] Branch { DstBlock "Mux" DstPort 5 } Branch { Points [15, 0; 0, 250] DstBlock "Mux1" DstPort 5 } } } Line { SrcBlock "Target Position1" SrcPort 1 Points [10, 0; 0, 25] DstBlock "Sum1" DstPort 1 } Line { SrcBlock "Constant1" SrcPort 1 DstBlock "Sum1" DstPort 2 } Annotation { Position [202, 52] VerticalAlignment "top" Text "pole\nlength" } } }