Model { Name "PID_joint_ideal" Version 6.3 MdlSubVersion 0 GraphicalInterface { NumRootInports 0 NumRootOutports 0 ParameterArgumentNames "" ComputedModelVersion "1.89" NumModelReferences 0 NumTestPointedSignals 0 } SavedCharacterEncoding "windows-1252" SaveDefaultBlockParams on SampleTimeColors off LibraryLinkDisplay "none" WideLines off ShowLineDimensions off ShowPortDataTypes off ShowLoopsOnError on IgnoreBidirectionalLines off ShowStorageClass off ShowTestPointIcons on ShowViewerIcons on SortedOrder off ExecutionContextIcon off ShowLinearizationAnnotations on RecordCoverage off CovPath "/" CovSaveName "covdata" CovMetricSettings "dw" CovNameIncrementing off CovHtmlReporting on covSaveCumulativeToWorkspaceVar on CovSaveSingleToWorkspaceVar on CovCumulativeVarName "covCumulativeData" CovCumulativeReport off CovReportOnPause on ScopeRefreshTime 0.035000 OverrideScopeRefreshTime on DisableAllScopes off DataTypeOverride "UseLocalSettings" MinMaxOverflowLogging "UseLocalSettings" MinMaxOverflowArchiveMode "Overwrite" BlockNameDataTip off BlockParametersDataTip off BlockDescriptionStringDataTip off ToolBar on StatusBar on BrowserShowLibraryLinks off BrowserLookUnderMasks off Created "Wed Jul 30 14:07:26 2008" Creator "pavlict" UpdateHistory "UpdateHistoryNever" ModifiedByFormat "%" LastModifiedBy "tpavlic" ModifiedDateFormat "%" LastModifiedDate "Fri Aug 8 12:20:50 2008" ModelVersionFormat "1.%" ConfigurationManager "None" LinearizationMsg "none" Profile off ParamWorkspaceSource "MATLABWorkspace" AccelSystemTargetFile "accel.tlc" AccelTemplateMakefile "accel_default_tmf" AccelMakeCommand "make_rtw" TryForcingSFcnDF off ExtModeBatchMode off ExtModeEnableFloating on ExtModeTrigType "manual" ExtModeTrigMode "normal" ExtModeTrigPort "1" ExtModeTrigElement "any" ExtModeTrigDuration 1000 ExtModeTrigDurationFloating "auto" ExtModeTrigHoldOff 0 ExtModeTrigDelay 0 ExtModeTrigDirection "rising" ExtModeTrigLevel 0 ExtModeArchiveMode "off" ExtModeAutoIncOneShot off ExtModeIncDirWhenArm off ExtModeAddSuffixToVar off ExtModeWriteAllDataToWs off ExtModeArmWhenConnect on ExtModeSkipDownloadWhenConnect off ExtModeLogAll on ExtModeAutoUpdateStatusClock off BufferReuse off StrictBusMsg "Warning" ProdHWDeviceType "32-bit Generic" ShowModelReferenceBlockVersion off ShowModelReferenceBlockIO off Array { Type "Handle" Dimension 1 Simulink.ConfigSet { $ObjectID 1 Version "1.1.0" Array { Type "Handle" Dimension 7 Simulink.SolverCC { $ObjectID 2 Version "1.1.0" StartTime "0.0" StopTime "3" AbsTol "auto" FixedStep "0.001" InitialStep "auto" MaxNumMinSteps "-1" MaxOrder 5 ExtrapolationOrder 4 NumberNewtonIterations 1 MaxStep "auto" MinStep "auto" RelTol "1e-3" SolverMode "Auto" Solver "ode5" SolverName "ode5" ZeroCrossControl "UseLocalSettings" AlgebraicLoopSolver "TrustRegion" SolverResetMethod "Fast" PositivePriorityOrder off AutoInsertRateTranBlk off SampleTimeConstraint "Unconstrained" RateTranMode "Deterministic" } Simulink.DataIOCC { $ObjectID 3 Version "1.1.0" Decimation "1" ExternalInput "[t, u]" FinalStateName "xFinal" InitialState "xInitial" LimitDataPoints off MaxDataPoints "1000" LoadExternalInput off LoadInitialState off SaveFinalState off SaveFormat "Array" SaveOutput off SaveState off SignalLogging off InspectSignalLogs off SaveTime off StateSaveName "xout" TimeSaveName "tout" OutputSaveName "yout" SignalLoggingName "logsout" OutputOption "RefineOutputTimes" OutputTimes "[]" Refine "1" } Simulink.OptimizationCC { $ObjectID 4 Array { Type "Cell" Dimension 5 Cell "ZeroExternalMemoryAtStartup" Cell "ZeroInternalMemoryAtStartup" Cell "InitFltsAndDblsToZero" Cell "OptimizeModelRefInitCode" Cell "NoFixptDivByZeroProtection" PropName "DisabledProps" } Version "1.1.0" BlockReduction off BooleanDataType off ConditionallyExecuteInputs off InlineParams off InlineInvariantSignals off OptimizeBlockIOStorage off BufferReuse off EnforceIntegerDowncast on ExpressionFolding off FoldNonRolledExpr on LocalBlockOutputs off ParameterPooling on RollThreshold 5 SystemCodeInlineAuto off StateBitsets off DataBitsets off UseTempVars off ZeroExternalMemoryAtStartup on ZeroInternalMemoryAtStartup on InitFltsAndDblsToZero on NoFixptDivByZeroProtection off EfficientFloat2IntCast off OptimizeModelRefInitCode off LifeSpan "inf" BufferReusableBoundary on } Simulink.DebuggingCC { $ObjectID 5 Version "1.1.0" RTPrefix "error" ConsistencyChecking "none" ArrayBoundsChecking "none" SignalInfNanChecking "none" ReadBeforeWriteMsg "UseLocalSettings" WriteAfterWriteMsg "UseLocalSettings" WriteAfterReadMsg "UseLocalSettings" AlgebraicLoopMsg "warning" ArtificialAlgebraicLoopMsg "warning" CheckSSInitialOutputMsg on CheckExecutionContextPreStartOutputMsg off CheckExecutionContextRuntimeOutputMsg off SignalResolutionControl "UseLocalSettings" BlockPriorityViolationMsg "warning" MinStepSizeMsg "warning" SolverPrmCheckMsg "warning" InheritedTsInSrcMsg "warning" DiscreteInheritContinuousMsg "warning" MultiTaskDSMMsg "error" MultiTaskRateTransMsg "error" SingleTaskRateTransMsg "none" TasksWithSamePriorityMsg "warning" SigSpecEnsureSampleTimeMsg "warning" CheckMatrixSingularityMsg "none" IntegerOverflowMsg "warning" Int32ToFloatConvMsg "warning" ParameterDowncastMsg "error" ParameterOverflowMsg "error" ParameterUnderflowMsg "none" ParameterPrecisionLossMsg "warning" UnderSpecifiedDataTypeMsg "none" UnnecessaryDatatypeConvMsg "none" VectorMatrixConversionMsg "none" InvalidFcnCallConnMsg "error" FcnCallInpInsideContextMsg "Use local settings" SignalLabelMismatchMsg "none" UnconnectedInputMsg "warning" UnconnectedOutputMsg "warning" UnconnectedLineMsg "warning" SFcnCompatibilityMsg "none" UniqueDataStoreMsg "none" BusObjectLabelMismatch "warning" RootOutportRequireBusObject "warning" AssertControl "UseLocalSettings" EnableOverflowDetection off ModelReferenceIOMsg "none" ModelReferenceVersionMismatchMessage "none" ModelReferenceIOMismatchMessage "none" ModelReferenceCSMismatchMessage "none" ModelReferenceSimTargetVerbose off UnknownTsInhSupMsg "warning" ModelReferenceDataLoggingMessage "warning" ModelReferenceSymbolNameMessage "warning" ModelReferenceExtraNoncontSigs "error" } Simulink.HardwareCC { $ObjectID 6 Version "1.1.0" ProdBitPerChar 8 ProdBitPerShort 16 ProdBitPerInt 32 ProdBitPerLong 32 ProdIntDivRoundTo "Undefined" ProdEndianess "Unspecified" ProdWordSize 32 ProdShiftRightIntArith on ProdHWDeviceType "32-bit Generic" TargetBitPerChar 8 TargetBitPerShort 16 TargetBitPerInt 32 TargetBitPerLong 32 TargetShiftRightIntArith on TargetIntDivRoundTo "Undefined" TargetEndianess "Unspecified" TargetWordSize 32 TargetTypeEmulationWarnSuppressLevel 0 TargetPreprocMaxBitsSint 32 TargetPreprocMaxBitsUint 32 TargetHWDeviceType "Specified" TargetUnknown off ProdEqTarget on } Simulink.ModelReferenceCC { $ObjectID 7 Version "1.1.0" UpdateModelReferenceTargets "IfOutOfDateOrStructuralChange" CheckModelReferenceTargetMessage "error" ModelReferenceNumInstancesAllowed "Multi" ModelReferencePassRootInputsByReference on ModelReferenceMinAlgLoopOccurrences off } Simulink.RTWCC { $BackupClass "Simulink.RTWCC" $ObjectID 8 Array { Type "Cell" Dimension 1 Cell "IncludeHyperlinkInReport" PropName "DisabledProps" } Version "1.1.0" SystemTargetFile "grt.tlc" GenCodeOnly off MakeCommand "make_rtw" TemplateMakefile "grt_default_tmf" GenerateReport off SaveLog off RTWVerbose on RetainRTWFile off ProfileTLC off TLCDebug off TLCCoverage off TLCAssert off ProcessScriptMode "Default" ConfigurationMode "Optimized" ConfigAtBuild off IncludeHyperlinkInReport off LaunchReport off TargetLang "C" Array { Type "Handle" Dimension 2 Simulink.CodeAppCC { $ObjectID 9 Array { Type "Cell" Dimension 16 Cell "IgnoreCustomStorageClasses" Cell "InsertBlockDesc" Cell "SFDataObjDesc" Cell "SimulinkDataObjDesc" Cell "DefineNamingRule" Cell "SignalNamingRule" Cell "ParamNamingRule" Cell "InlinedPrmAccess" Cell "CustomSymbolStr" Cell "CustomSymbolStrGlobalVar" Cell "CustomSymbolStrType" Cell "CustomSymbolStrField" Cell "CustomSymbolStrFcn" Cell "CustomSymbolStrBlkIO" Cell "CustomSymbolStrTmpVar" Cell "CustomSymbolStrMacro" PropName "DisabledProps" } Version "1.1.0" ForceParamTrailComments off GenerateComments on IgnoreCustomStorageClasses on IncHierarchyInIds off MaxIdLength 31 PreserveName off PreserveNameWithParent off ShowEliminatedStatement off IncAutoGenComments off SimulinkDataObjDesc off SFDataObjDesc off IncDataTypeInIds off PrefixModelToSubsysFcnNames on CustomSymbolStr "$R$N$M" MangleLength 1 DefineNamingRule "None" ParamNamingRule "None" SignalNamingRule "None" InsertBlockDesc off SimulinkBlockComments on EnableCustomComments off InlinedPrmAccess "Literals" ReqsInCode off } Simulink.GRTTargetCC { $BackupClass "Simulink.TargetCC" $ObjectID 10 Array { Type "Cell" Dimension 15 Cell "IncludeMdlTerminateFcn" Cell "CombineOutputUpdateFcns" Cell "SuppressErrorStatus" Cell "ERTCustomFileBanners" Cell "GenerateSampleERTMain" Cell "GenerateTestInterfaces" Cell "ModelStepFunctionPrototypeControlComp" "liant" Cell "MultiInstanceERTCode" Cell "PurelyIntegerCode" Cell "SupportNonFinite" Cell "SupportComplex" Cell "SupportAbsoluteTime" Cell "SupportContinuousTime" Cell "SupportNonInlinedSFcns" Cell "PortableWordSizes" PropName "DisabledProps" } Version "1.1.0" TargetFcnLib "ansi_tfl_tmw.mat" TargetLibSuffix "" TargetPreCompLibLocation "" GenFloatMathFcnCalls "ANSI_C" UtilityFuncGeneration "Auto" GenerateFullHeader on GenerateSampleERTMain off IsPILTarget off ModelReferenceCompliant on IncludeMdlTerminateFcn on CombineOutputUpdateFcns off SuppressErrorStatus off IncludeFileDelimiter "Auto" ERTCustomFileBanners off SupportAbsoluteTime on LogVarNameModifier "rt_" MatFileLogging on MultiInstanceERTCode off SupportNonFinite on SupportComplex on PurelyIntegerCode off SupportContinuousTime on SupportNonInlinedSFcns on ExtMode off ExtModeStaticAlloc off ExtModeTesting off ExtModeStaticAllocSize 1000000 ExtModeTransport 0 ExtModeMexFile "ext_comm" RTWCAPISignals off RTWCAPIParams off RTWCAPIStates off GenerateASAP2 off } PropName "Components" } } PropName "Components" } Name "Configuration" SimulationMode "normal" CurrentDlgPage "Solver" } PropName "ConfigurationSets" } Simulink.ConfigSet { $PropName "ActiveConfigurationSet" $ObjectID 1 } BlockDefaults { Orientation "right" ForegroundColor "black" BackgroundColor "white" DropShadow off NamePlacement "normal" FontName "Arial" FontSize 10 FontWeight "normal" FontAngle "normal" ShowName on } BlockParameterDefaults { Block { BlockType Clock DisplayTime off } Block { BlockType Derivative LinearizePole "inf" } Block { BlockType Gain Gain "1" Multiplication "Element-wise(K.*u)" ParameterDataTypeMode "Same as input" ParameterDataType "sfix(16)" ParameterScalingMode "Best Precision: Matrix-wise" ParameterScaling "2^0" OutDataTypeMode "Same as input" OutDataType "sfix(16)" OutScaling "2^0" LockScale off RndMeth "Floor" SaturateOnIntegerOverflow on SampleTime "-1" } Block { BlockType Inport Port "1" UseBusObject off BusObject "BusObject" BusOutputAsStruct off PortDimensions "-1" SampleTime "-1" DataType "auto" OutDataType "sfix(16)" OutScaling "2^0" SignalType "auto" SamplingMode "auto" LatchByDelayingOutsideSignal off LatchByCopyingInsideSignal off Interpolate on } Block { BlockType Outport Port "1" UseBusObject off BusObject "BusObject" BusOutputAsStruct off PortDimensions "-1" SampleTime "-1" DataType "auto" OutDataType "sfix(16)" OutScaling "2^0" SignalType "auto" SamplingMode "auto" OutputWhenDisabled "held" InitialOutput "[]" } Block { BlockType Scope ModelBased off TickLabels "OneTimeTick" ZoomMode "on" Grid "on" TimeRange "auto" YMin "-5" YMax "5" SaveToWorkspace off SaveName "ScopeData" LimitDataPoints on MaxDataPoints "5000" Decimation "1" SampleInput off SampleTime "-1" } Block { BlockType Step Time "1" Before "0" After "1" SampleTime "-1" VectorParams1D on ZeroCross on } Block { BlockType SubSystem ShowPortLabels on Permissions "ReadWrite" PermitHierarchicalResolution "All" SystemSampleTime "-1" RTWFcnNameOpts "Auto" RTWFileNameOpts "Auto" SimViewingDevice off DataTypeOverride "UseLocalSettings" MinMaxOverflowLogging "UseLocalSettings" } Block { BlockType Sum IconShape "rectangular" Inputs "++" InputSameDT on OutDataTypeMode "Same as first input" OutDataType "sfix(16)" OutScaling "2^0" LockScale off RndMeth "Floor" SaturateOnIntegerOverflow on SampleTime "-1" } Block { BlockType ToWorkspace VariableName "simulink_output" MaxDataPoints "1000" Decimation "1" SampleTime "0" FixptAsFi off } Block { BlockType TransferFcn Numerator "[1]" Denominator "[1 2 1]" AbsoluteTolerance "auto" Realization "auto" } } AnnotationDefaults { HorizontalAlignment "center" VerticalAlignment "middle" ForegroundColor "black" BackgroundColor "white" DropShadow off FontName "Arial" FontSize 10 FontWeight "normal" FontAngle "normal" } LineDefaults { FontName "Arial" FontSize 9 FontWeight "normal" FontAngle "normal" } System { Name "PID_joint_ideal" Location [1815, 49, 2671, 850] Open on ModelBrowserVisibility off ModelBrowserWidth 212 ScreenColor "white" PaperOrientation "landscape" PaperPositionMode "auto" PaperType "usletter" PaperUnits "inches" ZoomFactor "100" ReportName "simulink-default.rpt" Block { BlockType Clock Name "Clock" Position [25, 530, 45, 550] Orientation "down" NamePlacement "alternate" ShowName off Decimation "10" } Block { BlockType Reference Name "PD Controller\n(Ki=0)" Ports [1, 1] Position [260, 450, 290, 480] SourceBlock "simulink_extras/Additional\nLinear/PID Controll" "er" SourceType "PID Controller" ShowPortLabels on P "Kp" I "Ki" D "Kd" Port { PortNumber 1 Name "u" RTWStorageClass "Auto" DataLoggingNameMode "SignalName" } } Block { BlockType Step Name "Step" Position [20, 450, 50, 480] Time "0" SampleTime "0" Port { PortNumber 1 Name "r" RTWStorageClass "Auto" DataLoggingNameMode "SignalName" } } Block { BlockType Sum Name "Sum1" Ports [2, 1] Position [80, 455, 100, 475] ShowName off IconShape "round" Inputs "|+-" InputSameDT off OutDataTypeMode "Inherit via internal rule" SaturateOnIntegerOverflow off Port { PortNumber 1 Name "e" RTWStorageClass "Auto" DataLoggingNameMode "SignalName" } } Block { BlockType ToWorkspace Name "To Workspace1" Position [16, 570, 54, 605] Orientation "down" NamePlacement "alternate" ShowName off FontSize 14 VariableName "t" MaxDataPoints "inf" SampleTime "-1" SaveFormat "Array" } Block { BlockType ToWorkspace Name "To Workspace10" Position [135, 365, 155, 385] ShowName off FontSize 14 VariableName "e" MaxDataPoints "inf" SampleTime "-1" SaveFormat "Array" } Block { BlockType ToWorkspace Name "To Workspace2" Position [579, 565, 631, 590] Orientation "down" NamePlacement "alternate" ShowName off FontSize 14 VariableName "alpha" MaxDataPoints "inf" SampleTime "-1" SaveFormat "Array" } Block { BlockType ToWorkspace Name "To Workspace4" Position [445, 360, 465, 380] ShowName off FontSize 14 VariableName "u" MaxDataPoints "inf" SampleTime "-1" SaveFormat "Array" } Block { BlockType ToWorkspace Name "To Workspace5" Position [730, 411, 805, 439] ShowName off FontSize 14 VariableName "total" MaxDataPoints "inf" SampleTime "-1" SaveFormat "Array" } Block { BlockType Scope Name "alpha" Ports [1] Position [634, 560, 666, 590] Orientation "down" Floating off Location [17, 91, 341, 330] Open off NumInputPorts "1" List { ListType AxesTitles axes1 "%" } YMin "-0.4" YMax "0.4" DataFormat "StructureWithTime" LimitDataPoints off SampleTime "0" } Block { BlockType Scope Name "e" Ports [1] Position [130, 389, 160, 421] Floating off Location [184, 340, 516, 633] Open off NumInputPorts "1" List { ListType AxesTitles axes1 "%" } YMin "-0.4" YMax "1" SaveName "ScopeData9" DataFormat "StructureWithTime" LimitDataPoints off SampleTime "0" } Block { BlockType Scope Name "total" Ports [1] Position [730, 449, 760, 481] Floating off Location [17, 91, 341, 330] Open off NumInputPorts "1" List { ListType AxesTitles axes1 "%" } YMin "0" YMax "1.4" SaveName "ScopeData4" DataFormat "StructureWithTime" LimitDataPoints off SampleTime "0" } Block { BlockType Scope Name "u" Ports [1] Position [440, 389, 470, 421] Floating off Location [184, 340, 516, 633] Open off NumInputPorts "1" List { ListType AxesTitles axes1 "%" } YMin "-2" SaveName "ScopeData3" DataFormat "StructureWithTime" LimitDataPoints off SampleTime "0" } Block { BlockType TransferFcn Name "vin to (theta+alpha)" Position [475, 446, 570, 484] Numerator "ThetaPlusAlpha" Denominator "Vin" Port { PortNumber 1 Name "total" RTWStorageClass "Auto" DataLoggingNameMode "SignalName" } } Block { BlockType TransferFcn Name "vin to alpha" Position [475, 516, 570, 554] Numerator "Alpha" Denominator "Vin" Port { PortNumber 1 Name "alpha" RTWStorageClass "Auto" DataLoggingNameMode "SignalName" } } Line { SrcBlock "Clock" SrcPort 1 DstBlock "To Workspace1" DstPort 1 } Line { Name "r" Labels [0, 0] SrcBlock "Step" SrcPort 1 DstBlock "Sum1" DstPort 1 } Line { Name "total" Labels [1, 0] SrcBlock "vin to (theta+alpha)" SrcPort 1 Points [135, 0] Branch { DstBlock "total" DstPort 1 } Branch { Points [0, -40] DstBlock "To Workspace5" DstPort 1 } Branch { Labels [1, 0; 2, 0] Points [0, 140; -620, 0] DstBlock "Sum1" DstPort 2 } } Line { Name "e" Labels [0, 0] SrcBlock "Sum1" SrcPort 1 Points [0, 0; 5, 0] Branch { Points [0, -60] Branch { DstBlock "e" DstPort 1 } Branch { Points [0, -30] DstBlock "To Workspace10" DstPort 1 } } Branch { DstBlock "PD Controller\n(Ki=0)" DstPort 1 } } Line { Name "u" Labels [2, 1] SrcBlock "PD Controller\n(Ki=0)" SrcPort 1 Points [0, 0; 130, 0] Branch { Points [0, -60] Branch { DstBlock "u" DstPort 1 } Branch { Points [0, -35] DstBlock "To Workspace4" DstPort 1 } } Branch { Labels [-1, 0] DstBlock "vin to (theta+alpha)" DstPort 1 } Branch { Labels [-1, 1] Points [0, 70] DstBlock "vin to alpha" DstPort 1 } } Line { Name "alpha" Labels [0, 0] SrcBlock "vin to alpha" SrcPort 1 Points [30, 0] Branch { DstBlock "To Workspace2" DstPort 1 } Branch { Points [45, 0] DstBlock "alpha" DstPort 1 } } Annotation { Name "Try right-clicking on either \nPID block and se" "lecting \n'Look Under Mask' \nto see how it works." Position [279, 411] BackgroundColor "yellow" DropShadow on UseDisplayTextAsClickCallback off } Annotation { Name "THIS MODEL ASSUMES YOUR TRANSFER FUNCTIONS ALL " "HAVE\nTHE SAME DENOMINATOR POLYNOMIALS! \n\n(note: if you want, you can modif" "y the model, but all of your transfer functions \n*should* have the same pole" "s)\n\nBefore running this model, set these variables in your base workspace:" "\n\n Vin = [ vector of s-domain denominator coefficients ]\n Alpha = [ " "vector of s-domain numerator coefficients for Alpha/Vin ]\n ThetaPlusAlpha" " = [ vector of s-domain numerator coefficients for (Theta+Alpha)/Vin ] \n\n " " Kp = Proportional/Potential PID coefficient\n Ki = Integral PID coeffic" "ient (initially zero)\n Kd = Derivative/Damping PID coefficient (initially" " VERY low)\n\nAfter setting these in your base workspace, run the model and p" "lot the results." Position [53, 159] HorizontalAlignment "left" BackgroundColor "lightBlue" DropShadow on UseDisplayTextAsClickCallback off FontSize 16 } Annotation { Name "Copyright (c) 2008 by Theodore P. Pavlic\n\nThi" "s work is licensed under the Creative Commons Attribution-Noncommercial 3.0 U" "nited States License.\nTo view a copy of this license, visit http://creativec" "ommons.org/licenses/by-nc/3.0/us/ or send a\nletter to Creative Commons, 171 " "Second Street, Suite 300, San Francisco, California, 94105, USA." Position [367, 700] BackgroundColor "gray" DropShadow on UseDisplayTextAsClickCallback off } Annotation { Name "The output is the total deflection: \nMotor def" "lection angle (theta) + Arm deflection angle (alpha)" Position [670, 386] ForegroundColor "cyan" BackgroundColor "black" DropShadow on UseDisplayTextAsClickCallback off FontSize 12 } } }