Model { Name "InvertedPendulum_vN4D" Version 3.00 SimParamPage "Solver" SampleTimeColors off InvariantConstants off WideVectorLines off ShowLineWidths off ShowPortDataTypes off StartTime "0" StopTime "10000" SolverMode "SingleTasking" Solver "ode4" RelTol "1e-3" AbsTol "1e-6" Refine "1" MaxStep "0.01" InitialStep "auto" FixedStep ".01" MaxOrder 5 OutputOption "RefineOutputTimes" OutputTimes "[]" LoadExternalInput off ExternalInput "[]" SaveTime off TimeSaveName "tout" SaveState off StateSaveName "xout" SaveOutput off OutputSaveName "yout" LoadInitialState off InitialState "[]" SaveFinalState off FinalStateName "xFinal" SaveFormat "Matrix" LimitMaxRows off MaxRows "1000" Decimation "1" AlgebraicLoopMsg "warning" MinStepSizeMsg "warning" UnconnectedInputMsg "warning" UnconnectedOutputMsg "warning" UnconnectedLineMsg "warning" InheritedTsInSrcMsg "warning" IntegerOverflowMsg "warning" UnnecessaryDatatypeConvMsg "none" Int32ToFloatConvMsg "warning" SignalLabelMismatchMsg "none" ConsistencyChecking "off" ZeroCross on SimulationMode "normal" BlockDataTips on BlockParametersDataTip off BlockAttributesDataTip off BlockPortWidthsDataTip off BlockDescriptionStringDataTip off BlockMaskParametersDataTip off ToolBar on StatusBar on BrowserShowLibraryLinks off BrowserLookUnderMasks off OptimizeBlockIOStorage on BufferReuse on BooleanDataType off RTWSystemTargetFile "grt.tlc" RTWInlineParameters off RTWRetainRTWFile off RTWTemplateMakefile "grt_default_tmf" RTWMakeCommand "make_rtw" RTWGenerateCodeOnly off ExtModeMexFile "ext_comm" ExtModeBatchMode off ExtModeTrigType "manual" ExtModeTrigMode "normal" 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 Created "Wed Jun 13 12:49:45 2001" UpdateHistory "UpdateHistoryNever" ModifiedByFormat "%" LastModifiedBy "manning" ModifiedDateFormat "%" LastModifiedDate "Thu Jun 14 21:07:50 2001" ModelVersionFormat "1.%" ConfigurationManager "none" 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 "InvertedPendulum_vN4D" Location [151, 448, 1019, 901] Open on ModelBrowserVisibility off ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "landscape" PaperPositionMode "auto" PaperType "usletter" PaperUnits "inches" ZoomFactor "100" AutoZoom on ReportName "simulink-default.rpt" Block { BlockType SubSystem Name "Animation" Ports [1, 0, 0, 0, 0] Position [735, 50, 790, 100] ShowPortLabels on MaskType "Pendulum plot" MaskDescription "Pendulum plot" MaskHelp "Pendulum animation function using Handle graphi" "cs." MaskPromptString "DC reference signal block name:" MaskStyleString "edit" MaskTunableValueString "on" MaskEnableString "on" MaskVisibilityString "on" MaskInitialization "RefBlock=&1;\n" MaskDisplay "plot([-10 10],[0 0],[-2 -2 2 2],[0 1 1 0],[0 3]" ",[1 5])" MaskIconFrame on MaskIconOpaque on MaskIconRotate "none" MaskIconUnits "autoscale" MaskValueString "Reference" System { Name "Animation" Location [636, 545, 877, 643] Open off ModelBrowserVisibility off ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "landscape" PaperPositionMode "auto" PaperType "usletter" PaperUnits "inches" ZoomFactor "100" AutoZoom on Block { BlockType Inport Name "in_1" Position [40, 25, 60, 45] Port "1" PortWidth "-1" SampleTime "-1" DataType "auto" SignalType "auto" Interpolate on } Block { BlockType "S-Function" Name "S-function" Ports [1, 0, 0, 0, 0] Position [95, 23, 150, 47] DeleteFcn "pendan([],[],[],'DeleteBlock');" FunctionName "pendan" Parameters "RefBlock" PortCounts "[]" SFunctionModules "''" } Line { SrcBlock "in_1" SrcPort 1 DstBlock "S-function" DstPort 1 } } } Block { BlockType Clock Name "Clock" Position [685, 170, 705, 190] ShowName off DisplayTime off Decimation "10" } Block { BlockType Demux Name "Demux" Ports [1, 2, 0, 0, 0] Position [570, 146, 575, 184] BackgroundColor "black" ShowName off Outputs "2" } Block { BlockType SubSystem Name "Discrete State Estimator" Ports [2, 1, 0, 0, 0] Position [470, 222, 515, 273] Orientation "left" ShowPortLabels on MaskType "Pendulum Discrete state estimator" MaskDescription "Pendulum discrete state estimator" MaskHelp "The states of the pendulum and cart system are " "the pendulum angle and angular velocity and cart position and velocity. Sinc" "e the sensors output the pendulum angle and cart position, this state estimat" "or just does a one step difference calculation to get the velocities." MaskPromptString "Sample time" MaskStyleString "edit" MaskTunableValueString "on" MaskEnableString "on" MaskVisibilityString "on" MaskInitialization "Ts = @1;" MaskIconFrame on MaskIconOpaque on MaskIconRotate "none" MaskIconUnits "autoscale" MaskValueString "0.01" System { Name "Discrete State Estimator" Location [261, 265, 572, 421] Open off ModelBrowserVisibility off ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "landscape" PaperPositionMode "auto" PaperType "usletter" PaperUnits "inches" ZoomFactor "100" AutoZoom on Block { BlockType Inport Name "Cart" Position [15, 45, 35, 65] Port "1" PortWidth "-1" SampleTime "-1" DataType "auto" SignalType "auto" Interpolate on } Block { BlockType Inport Name "Pendulum" Position [15, 100, 35, 120] Port "2" PortWidth "-1" SampleTime "-1" DataType "auto" SignalType "auto" Interpolate on } Block { BlockType DiscreteStateSpace Name "Dis. State-space" Position [115, 65, 235, 105] A "zeros(2)" B "-eye(2)/Ts" C "[0 0; 1 0; 0 0; 0 1]" D "[1 0; 1/Ts 0; 0 1; 0 1/Ts]" X0 "0" SampleTime "Ts" } Block { BlockType Mux Name "Mux2" Ports [2, 1, 0, 0, 0] Position [55, 56, 80, 109] ShowName off Inputs "2" DisplayOption "none" } Block { BlockType Outport Name "X" Position [260, 75, 280, 95] Port "1" OutputWhenDisabled "held" InitialOutput "0" } Line { SrcBlock "Pendulum" SrcPort 1 DstBlock "Mux2" DstPort 2 } Line { SrcBlock "Dis. State-space" SrcPort 1 DstBlock "X" DstPort 1 } Line { SrcBlock "Cart" SrcPort 1 DstBlock "Mux2" DstPort 1 } Line { SrcBlock "Mux2" SrcPort 1 DstBlock "Dis. State-space" DstPort 1 } } } Block { BlockType TransferFcn Name "Feedforward Gain" Position [245, 212, 300, 248] Numerator "[7.12 0]" Denominator "[1 2]" } Block { BlockType Gain Name "Integral\nGain" Position [245, 143, 280, 177] Gain "0.06" SaturateOnIntegerOverflow on } Block { BlockType Reference Name "InvertedPendulum_vN4D" Description "\".\\InvertedPendulum_vN4d.wm3\"||\"State Measu" "rements.theta\"|4.89642e-012|\"State Measurements.y\"|0||\"Force\"|-10||" Ports [1, 1, 0, 0, 0] Position [475, 150, 535, 180] SourceBlock "vNPlantBlock/vNPlant" SourceType "" } Block { BlockType Integrator Name "Limited\nIntegrator" Ports [1, 1, 0, 0, 0] Position [300, 143, 335, 177] ExternalReset "none" InitialConditionSource "internal" InitialCondition "0" LimitOutput on UpperSaturationLimit "5" LowerSaturationLimit "-5" ShowSaturationPort off ShowStatePort off AbsoluteTolerance "auto" } Block { BlockType StateSpace Name "Matrix gain." Position [390, 236, 445, 264] Orientation "left" ShowName off A "[]" B "[]" C "[]" D "K" X0 "0" MaskType "Matrix gain" MaskDescription "Matrix Gain:" MaskHelp "Multiplies input vector by entered matrix to pr" "oduce output vector." MaskPromptString "Gain matrix:" MaskStyleString "edit" MaskTunableValueString "on" MaskEnableString "on" MaskVisibilityString "on" MaskInitialization "K = @1;" MaskDisplay "disp('LQR')" MaskIconFrame on MaskIconOpaque on MaskIconRotate "none" MaskIconUnits "autoscale" MaskValueString "[0 -18 -166.5 -15.2]" } Block { BlockType SubSystem Name "More Info" Ports [0, 0, 0, 0, 0] Position [375, 300, 402, 325] DropShadow on ShowName off ShowPortLabels on MaskDisplay "disp('?')" MaskIconFrame on MaskIconOpaque on MaskIconRotate "none" MaskIconUnits "autoscale" System { Name "More Info" Location [127, 169, 475, 352] Open off ModelBrowserVisibility off ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "landscape" PaperPositionMode "auto" PaperType "usletter" PaperUnits "inches" ZoomFactor "100" AutoZoom on Annotation { Position [162, 22] Text "This system simulates a cart carrying an in" "verted\npendulum and displays an animation." } Annotation { Position [162, 67] Text "The animation is created using MATLAB's \nH" "andle Graphics. The animation block is \njust a masked S-function." } Annotation { Position [162, 122] Text "For more information on what the S-function" " \ndoes, look at the functions pendan.m, pend0.m, \nand pendsets.m." } } } Block { BlockType SubSystem Name "More Info2" Ports [0, 0, 0, 0, 0] Position [440, 300, 542, 351] DropShadow on ShowName off OpenFcn "simcad(bdroot)" ShowPortLabels on MaskDisplay "disp('Double click\\nhere for\\nSimulink Help')" MaskIconFrame on MaskIconOpaque on MaskIconRotate "none" MaskIconUnits "autoscale" System { Name "More Info2" Location [128, 280, 487, 453] Open off ModelBrowserVisibility off ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "landscape" PaperPositionMode "auto" PaperType "usletter" PaperUnits "inches" ZoomFactor "100" AutoZoom on } } Block { BlockType Mux Name "Mux" Ports [3, 1, 0, 0, 0] Position [665, 59, 695, 91] ShowName off Inputs "3" DisplayOption "none" } Block { BlockType Gain Name "Proportional Gain" Position [260, 86, 295, 124] Gain "-9.4" SaturateOnIntegerOverflow on } Block { BlockType Constant Name "Reference" Position [55, 210, 105, 230] Value "1.116" } Block { BlockType Saturate Name "Saturation" Position [425, 155, 450, 175] ShowName off UpperLimit "10" LowerLimit "-10" } Block { BlockType SignalGenerator Name "Signal Gen." Position [55, 143, 100, 177] ShowName off WaveForm "square" Amplitude "0.000000" Frequency "0.400000" Units "rad/sec" } Block { BlockType Sum Name "Sum" Ports [4, 1, 0, 0, 0] Position [385, 142, 405, 188] ShowName off IconShape "rectangular" Inputs "+++-" SaturateOnIntegerOverflow on } Block { BlockType Sum Name "Sum2" Ports [2, 1, 0, 0, 0] Position [185, 150, 205, 170] ShowName off IconShape "rectangular" Inputs "-+" SaturateOnIntegerOverflow on } Block { BlockType Sum Name "Sum3" Ports [2, 1, 0, 0, 0] Position [130, 155, 150, 175] ShowName off IconShape "rectangular" Inputs "++" SaturateOnIntegerOverflow on } Block { BlockType ToWorkspace Name "To Workspace" Position [745, 126, 780, 144] ShowName off VariableName "y" Buffer "1000" Decimation "1" SampleTime "0.1" SaveFormat "Matrix" } Block { BlockType ToWorkspace Name "To Workspace1" Position [745, 171, 780, 189] ShowName off VariableName "t" Buffer "1000" Decimation "1" SampleTime "0.1" SaveFormat "Matrix" } Line { SrcBlock "Sum2" SrcPort 1 Points [10, 0] Branch { Points [0, -55] DstBlock "Proportional Gain" DstPort 1 } Branch { DstBlock "Integral\nGain" DstPort 1 } } Line { SrcBlock "Discrete State Estimator" SrcPort 1 DstBlock "Matrix gain." DstPort 1 } Line { SrcBlock "Mux" SrcPort 1 Points [0, 0; 10, 0] Branch { Points [0, 60] DstBlock "To Workspace" DstPort 1 } Branch { DstBlock "Animation" DstPort 1 } } Line { SrcBlock "Demux" SrcPort 1 Points [60, 0] Branch { Points [0, -70] DstBlock "Mux" DstPort 3 } Branch { Points [0, 105] DstBlock "Discrete State Estimator" DstPort 2 } } Line { SrcBlock "Sum3" SrcPort 1 Points [0, 0] Branch { Points [0, -100] DstBlock "Mux" DstPort 1 } Branch { Points [0, 0] Branch { Points [0, 65] DstBlock "Feedforward Gain" DstPort 1 } Branch { DstBlock "Sum2" DstPort 2 } } } Line { SrcBlock "Integral\nGain" SrcPort 1 DstBlock "Limited\nIntegrator" DstPort 1 } Line { SrcBlock "Sum" SrcPort 1 DstBlock "Saturation" DstPort 1 } Line { SrcBlock "Proportional Gain" SrcPort 1 Points [50, 0; 0, 45] DstBlock "Sum" DstPort 1 } Line { SrcBlock "Feedforward Gain" SrcPort 1 Points [45, 0; 0, -60] DstBlock "Sum" DstPort 3 } Line { SrcBlock "Reference" SrcPort 1 Points [0, -50] DstBlock "Sum3" DstPort 2 } Line { SrcBlock "Signal Gen." SrcPort 1 DstBlock "Sum3" DstPort 1 } Line { SrcBlock "Matrix gain." SrcPort 1 Points [-25, 0; 0, -70] DstBlock "Sum" DstPort 4 } Line { SrcBlock "Limited\nIntegrator" SrcPort 1 DstBlock "Sum" DstPort 2 } Line { SrcBlock "Demux" SrcPort 2 Points [45, 0] Branch { Points [0, -100] Branch { Points [-455, 0] DstBlock "Sum2" DstPort 1 } Branch { DstBlock "Mux" DstPort 2 } } Branch { Points [0, 60] DstBlock "Discrete State Estimator" DstPort 1 } } Line { SrcBlock "Saturation" SrcPort 1 DstBlock "InvertedPendulum_vN4D" DstPort 1 } Line { SrcBlock "Clock" SrcPort 1 DstBlock "To Workspace1" DstPort 1 } Line { SrcBlock "InvertedPendulum_vN4D" SrcPort 1 DstBlock "Demux" DstPort 1 } Annotation { Position [223, 302] Text "Inverted pendulum on cart with Animation\n(Doub" "le click on the \"?\" for more info)" } Annotation { Position [226, 347] Text "To start and stop the simulation, use the \"Sta" "rt/Stop\"\nselection in the \"Simulation\" pull-down menu" } Annotation { Position [598, 192] Text "position\nof hand" } Annotation { Position [598, 142] Text "angle\nof bat" } Annotation { Position [428, 27] Text "Inverted Pendulm Demo using MSC.visualNastran 4" "D for the plant modeling and visualization." FontSize 14 FontWeight "bold" } Annotation { Position [706, 328] Text "This model was adapted from an \nexisting Simul" "ink demo file. " } Annotation { Position [604, 410] Text "See the original Simulink model\nR11: MATLAB De" "mos > Simulink > Complex models > Inverted pendulum animation\nR12: MATLAB De" "mos > Simulink > General > Inverted pendulum animation\n" } } }