📄 block89.mdl
字号:
Model { Name "block89" Version 2.00 SimParamPage Solver SampleTimeColors off WideVectorLines off PaperOrientation landscape StartTime "0.0" StopTime "80" Solver ode45 RelTol "1e-3" AbsTol "1e-6" Refine "1" MaxStep "auto" 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" LimitMaxRows off MaxRows "1000" Decimation "1" AlgebraicLoopMsg warning MinStepSizeMsg warning UnconnectedInputMsg warning UnconnectedOutputMsg warning UnconnectedLineMsg warning ConsistencyChecking off ZeroCross on 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 } System { Name "block89" Location [121, 160, 621, 347] Open on ScreenColor white Block { BlockType Integrator Name "Integrator" Position [370, 80, 390, 100] ShowName off ExternalReset none InitialConditionSource internal InitialCondition "0" LimitOutput off UpperSaturationLimit "inf" LowerSaturationLimit "-inf" ShowSaturationPort off ShowStatePort off AbsoluteTolerance "auto" } Block { BlockType SubSystem Name "PID" Position [200, 72, 245, 108] ShowPortLabels off MaskType "Anti windup PID" MaskDescription "Setpoint PID with anti-windup: e=(ysp-y)\nP=K*(b" "*ysp-y) D=(KTds/(1+Td/Ns)\ndI/dt=(K/Ti)*e+1/Tt(" "v-u) v=sat(P+I+D)" MaskHelp "Unmask this block to see how it works. Attach " "the set point to input 1, the system output " "to input 2, and the output of the block to " "the system's input." MaskPromptString "Gain K|Setpoint b|Integral Ti|Antiwindup " "gain Tt|Antiwindup saturation [low,high]|Derivat" "ive gain and divisor [Td,N]" MaskStyleString "edit,edit,edit,edit,edit,edit" MaskInitialization "K=@1 ; b =@2 ; Ti=@3 ; Tt=@4 ; ulow=@5(1); " "uhigh=@5(2); Td=@6(1); N=@6(2);" MaskDisplay "plot(-3,-0.3,4,1.3,[0,1,2,3],[0,0,1,1]);disp(' " " PID ')" MaskIconFrame on MaskIconOpaque on MaskIconRotate off MaskIconUnits autoscale MaskValueString "1|1|1|0.1|[ulow,uhigh]|[0,1000]" System { Name "PID" Location [3, 80, 847, 716] Open off ScreenColor white Block { BlockType Inport Name "Set point" Position [70, 175, 90, 195] Port "1" PortWidth "-1" SampleTime "-1" } Block { BlockType Inport Name "System Output" Position [70, 225, 90, 245] Port "2" PortWidth "-1" SampleTime "-1" } Block { BlockType Gain Name "Anti Windup Gain" Position [260, 114, 310, 146] Gain "1/Tt" } Block { BlockType TransferFcn Name "Derivative" Position [355, 377, 450, 423] Numerator "[-Td, 0]" Denominator "[Td/N 1]" } Block { BlockType TransferFcn Name "Integrator" Position [425, 168, 485, 202] Numerator "[1]" Denominator "[Ti 0]" } Block { BlockType Sum Name "P+I+D" Position [550, 327, 570, 363] Inputs "+++" } Block { BlockType Gain Name "Proportional" Position [600, 329, 650, 361] Gain "K" } Block { BlockType Saturate Name "Saturation" Position [155, 130, 180, 150] UpperLimit "uhigh" LowerLimit "ulow" } Block { BlockType Sum Name "Sum" Position [415, 305, 435, 325] Inputs "+-" } Block { BlockType Sum Name "Sum3" Position [215, 112, 235, 148] ShowName off Inputs "+-" } Block { BlockType Sum Name "error" Position [365, 167, 385, 203] Inputs "-+-" } Block { BlockType Gain Name "set point weighting" Position [275, 230, 320, 260] Gain "b" } Block { BlockType Outport Name "Input to system" Position [710, 335, 730, 355] Port "1" OutputWhenDisabled held InitialOutput "0" } Line { SrcBlock "set point weighting" SrcPort 1 Points [45, 0; 0, 65] DstBlock "Sum" DstPort 1 } Line { SrcBlock "Proportional" SrcPort 1 Points [10, 0] Branch { Points [0, -254; -540, 0; 0, 29] Branch { DstBlock "Sum3" DstPort 1 } Branch { Points [0, 20] DstBlock "Saturation" DstPort 1 } } Branch { DstBlock "Input to system" DstPort 1 } } Line { SrcBlock "System Output" SrcPort 1 Points [45, 0] Branch { Points [0, 85] Branch { Points [0, 80] DstBlock "Derivative" DstPort 1 } Branch { DstBlock "Sum" DstPort 2 } } Branch { Points [110, 0; 0, -40] DstBlock "error" DstPort 3 } } Line { SrcBlock "Anti Windup Gain" SrcPort 1 Points [20, 0; 0, 45] DstBlock "error" DstPort 1 } Line { SrcBlock "Sum3" SrcPort 1 DstBlock "Anti Windup Gain" DstPort 1 } Line { SrcBlock "Saturation" SrcPort 1 DstBlock "Sum3" DstPort 2 } Line { SrcBlock "error" SrcPort 1 DstBlock "Integrator" DstPort 1 } Line { SrcBlock "Set point" SrcPort 1 Points [85, 0] Branch { Points [0, 60] DstBlock "set point weighting" DstPort 1 } Branch { DstBlock "error" DstPort 2 } } Line { SrcBlock "Sum" SrcPort 1 Points [45, 0; 0, 30] DstBlock "P+I+D" DstPort 2 } Line { SrcBlock "Derivative" SrcPort 1 Points [30, 0; 0, -45] DstBlock "P+I+D" DstPort 3 } Line { SrcBlock "P+I+D" SrcPort 1 DstBlock "Proportional" DstPort 1 } Line { SrcBlock "Integrator" SrcPort 1 Points [30, 0; 0, 150] DstBlock "P+I+D" DstPort 1 } Annotation { Position [207, 178] VerticalAlignment top Text "ysp" } Annotation { Position [147, 218] VerticalAlignment top Text "y" } Annotation { Position [412, 48] VerticalAlignment top Text "PID controller with set point weighting " "and anti-windup." } } } Block { BlockType Saturate Name "Saturation" Position [275, 78, 305, 102] UpperLimit "0.1" LowerLimit "-0.1" } Block { BlockType Step Name "Step Input" Position [105, 70, 125, 90] ShowName off Time "0" Before "0" After "1" } Block { BlockType Outport Name "u" Position [340, 35, 360, 55] Port "1" OutputWhenDisabled held InitialOutput "0" } Block { BlockType Outport Name "y" Position [430, 80, 450, 100] Port "2" OutputWhenDisabled held InitialOutput "0" } Block { BlockType Outport Name "uc" Position [155, 25, 175, 45] Port "3" OutputWhenDisabled held InitialOutput "0" } Line { SrcBlock "Step Input" SrcPort 1 Points [0, 0] Branch { Points [5, 0; 0, -45] DstBlock "uc" DstPort 1 } Branch { DstBlock "PID" DstPort 1 } } Line { SrcBlock "Saturation" SrcPort 1 Points [0, 0] Branch { DstBlock "Integrator" DstPort 1 } Branch { Points [10, 0; 0, -45] DstBlock "u" DstPort 1 } } Line { SrcBlock "PID" SrcPort 1 DstBlock "Saturation" DstPort 1 } Line { SrcBlock "Integrator" SrcPort 1 Points [0, 0] Branch { DstBlock "y" DstPort 1 } Branch { Points [0, 55; -215, 0; 0, -45] DstBlock "PID" DstPort 2 } } }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -