📄 c9mbbr4.mdl
字号:
BlockType Gain
Name "Conversion to Radians"
Position [750, 288, 820, 332]
Orientation "left"
ShowName off
FontName "Times New Roman"
FontSize 12
Gain "0.0015"
Multiplication "Element-wise(K.*u)"
SaturateOnIntegerOverflow on
SampleTime "-1"
}
Block {
BlockType TransferFcn
Name "Derivative\nw/ filter"
Position [425, 225, 485, 265]
Orientation "up"
NamePlacement "alternate"
ShowName off
FontName "Times New Roman"
FontSize 12
Numerator "[20 0]"
Denominator "[1 20]"
AbsoluteTolerance "auto"
Realization "auto"
}
Block {
BlockType TransferFcn
Name "Derivative\nw/ filter1"
Position [705, 235, 765, 275]
Orientation "up"
NamePlacement "alternate"
ShowName off
FontName "Times New Roman"
FontSize 12
Numerator "[50 0]"
Denominator "[1 50]"
AbsoluteTolerance "auto"
Realization "auto"
}
Block {
BlockType SubSystem
Name "Encoder Input"
Ports [0, 1]
Position [845, 290, 930, 330]
Orientation "left"
ShowName off
AncestorBlock "qctools/Quanser\nQ4 Series/Encoder Input"
LoadFcn "run(fullfile(qcdevroot,'q4encCallback'));"
StartFcn "set_param(gcb,'MaskEnables',{'off','off','off',"
"'off','off','off','off','off','off','off','off','off','off','off','off','off'"
"});"
StopFcn "q4encCallback"
FontName "Times New Roman"
FontSize 12
Permissions "ReadWrite"
TreatAsAtomicUnit off
RTWSystemCode "Auto"
RTWFcnNameOpts "Auto"
RTWFileNameOpts "Auto"
SimViewingDevice off
MaskType "Q4 Encoder Input"
MaskDescription "Reads from the selected encoder channels of the"
" Q4 Series I/O Boards"
MaskHelp "web(fullfile(qcdocroot, 'Q4', 'EncoderInput.htm"
"l'));"
MaskPromptString "Board number:|Channel(s) to use:|Initial value("
"s):|Do not initialize counts|Sample time (sec):|Quadrature:|Count mode:|Inter"
"rupt flags:|Filter clock prescaling: (1-256)|Filter clock frequency (Hz):|Use"
" 33MHz clock|Binary-coded decimal (BCD)|Enable index|Index polarity (on=posit"
"ive, off=negative)|Reload count on index pulse|Simulation input"
MaskStyleString "edit,edit,edit,checkbox,edit,popup(Non-quadratu"
"re|1X|2X|4X),popup(Normal|Range limit|Non-recycle|Modulo-N),popup(FLG1 is CAR"
"RY and FLG2 is BORROW|FLG1 is COMPARE and FLG2 is BORROW|FLG1 is CARRY/BORROW"
" and FLG2 is UP/DOWN|FLG1 is IDX and FLG2 is E),edit,edit,checkbox,checkbox,c"
"heckbox,checkbox,checkbox,checkbox"
MaskTunableValueString "on,on,on,on,on,on,on,on,on,on,on,on,on,on,on,on"
MaskCallbackString "|||q4encCallback|||||str2num(get_param(gcb,'pre"
"scale'));if ans > 0;if strcmp(get_param(gcb,'use33MHzClock'),'on');set_param("
"gcb,'frequency',num2str(1/30e-9/ans));else set_param(gcb,'frequency',num2str("
"1/60e-9/ans));end;end;||str2num(get_param(gcb,'prescale'));if ans > 0;if strc"
"mp(get_param(gcb,'use33MHzClock'),'on');set_param(gcb,'frequency',num2str(1/3"
"0e-9/ans));else set_param(gcb,'frequency',num2str(1/60e-9/ans));end;end;||q4e"
"ncCallback|||"
MaskEnableString "on,on,on,on,on,on,on,on,on,off,on,on,on,on,on,o"
"n"
MaskVisibilityString "on,on,on,on,on,on,on,on,on,on,on,on,on,on,on,on"
MaskToolTipString "on,on,on,on,on,on,on,on,on,on,on,on,on,on,on,on"
MaskVariables "boardNumber=@1;channels=@2;initial=@3;preserveC"
"ounts=@4;sampleTime=@5;quadratureStr=&6;modeStr=&7;flagString=&8;prescale=@9;"
"frequency=@10;use33MHzClock=@11;bcd=@12;enableIndex=@13;indexPolarity=@14;rel"
"oadOnIndex=@15;simulationInput=@16;"
MaskInitialization "initialValues = expand(initial, length(channels"
"));\n\nswitch lower(quadratureStr)\n case 'non-quadrature'\n quadrature ="
" 0;\n case '1x'\n quadrature = 1;\n case '2x'\n quadrature = 2;\n ca"
"se '4x'\n quadrature = 3;\nend;\n\nswitch lower(modeStr)\n case 'normal'"
"\n mode = 0;\n case 'range limit'\n mode = 1;\n case 'non-recycle'\n "
" mode = 2;\n case 'modulo-n'\n mode = 3;\nend;\n\nswitch flagString\n "
" case 'FLG1 is CARRY and FLG2 is BORROW'\n flags = 0;\n case 'FLG1"
" is COMPARE and FLG2 is BORROW'\n flags = 1;\n case 'FLG1 is CARRY/"
"BORROW and FLG2 is UP/DOWN'\n flags = 2;\n case 'FLG1 is IDX and FL"
"G2 is E'\n flags = 3;\n otherwise\n flags = 3;\nend\n\naddpa"
"th(qcdevroot);\n"
MaskDisplay "disp('Quanser\\nQ4 ENC')"
MaskSelfModifiable on
MaskIconFrame on
MaskIconOpaque on
MaskIconRotate "none"
MaskIconUnits "autoscale"
MaskValueString "0|0|0|off|simget(bdroot,'FixedStep')|4X|Normal|"
"FLG1 is IDX and FLG2 is E|1|16666666.6667|off|off|on|on|off|off"
System {
Name "Encoder Input"
Location [617, 300, 912, 377]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "A4"
PaperUnits "centimeters"
ZoomFactor "100"
Block {
BlockType "S-Function"
Name "Configure I/O"
Ports []
Position [176, 20, 240, 44]
FunctionName "q4cfgencio"
Parameters "boardNumber, channels, flags, reloadOnIndex"
SFunctionModules "''"
PortCounts "[]"
}
Block {
BlockType "S-Function"
Name "Encoder Input"
Ports [0, 1]
Position [35, 18, 75, 42]
FunctionName "q4en"
Parameters "boardNumber, channels, initialValues, sampl"
"eTime, prescale, quadrature, mode, bcd, enableIndex, indexPolarity, preserveC"
"ounts, use33MHzClock, simulationInput"
SFunctionModules "''"
PortCounts "[]"
}
Block {
BlockType Outport
Name "Out1"
Position [110, 23, 140, 37]
Port "1"
OutputWhenDisabled "held"
InitialOutput "[]"
}
Line {
SrcBlock "Encoder Input"
SrcPort 1
DstBlock "Out1"
DstPort 1
}
}
}
Block {
BlockType Integrator
Name "Integrator"
Ports [1, 1]
Position [695, 75, 725, 115]
ShowName off
FontName "Times New Roman"
FontSize 12
ExternalReset "none"
InitialConditionSource "internal"
InitialCondition "0"
LimitOutput off
UpperSaturationLimit "inf"
LowerSaturationLimit "-inf"
ShowSaturationPort off
ShowStatePort off
AbsoluteTolerance "auto"
IgnoreLimit off
}
Block {
BlockType Gain
Name "Kp\n"
Position [650, 129, 695, 161]
ShowName off
FontName "Times New Roman"
FontSize 12
Gain "Kp"
Multiplication "Element-wise(K.*u)"
SaturateOnIntegerOverflow on
SampleTime "-1"
}
Block {
BlockType Gain
Name "Kp\n1"
Position [635, 79, 680, 111]
ShowName off
FontName "Times New Roman"
FontSize 12
Gain "Ki"
Multiplication "Element-wise(K.*u)"
SaturateOnIntegerOverflow on
SampleTime "-1"
}
Block {
BlockType Saturate
Name "Must \nOpertate\nin Linear\nRegion"
Position [550, 130, 580, 160]
ShowName off
FontName "Times New Roman"
FontSize 12
UpperLimit "50*pi/180"
LowerLimit "-50*pi/180"
LinearizeAsGain on
SampleTime "-1"
}
Block {
BlockType Gain
Name "Outer Loop Kd"
Position [418, 170, 492, 210]
Orientation "up"
NamePlacement "alternate"
ShowName off
FontName "Times New Roman"
FontSize 12
Gain "Kv_bb"
Multiplication "Element-wise(K.*u)"
SaturateOnIntegerOverflow on
SampleTime "-1"
}
Block {
BlockType Gain
Name "Outer Loop Kd1"
Position [713, 180, 757, 220]
Orientation "up"
NamePlacement "alternate"
ShowName off
FontName "Times New Roman"
FontSize 12
Gain "Kv"
Multiplication "Element-wise(K.*u)"
SaturateOnIntegerOverflow on
SampleTime "-1"
}
Block {
BlockType Gain
Name "Outer Loop Kp"
Position [365, 119, 430, 171]
ShowName off
FontName "Times New Roman"
FontSize 12
Gain "Kp_bb"
Multiplication "Element-wise(K.*u)"
SaturateOnIntegerOverflow on
SampleTime "-1"
}
Block {
BlockType Saturate
Name "Physical\nLimitation\nof Beam"
Position [275, 130, 305, 160]
ShowName off
FontName "Times New Roman"
FontSize 12
UpperLimit "20"
LowerLimit "-20"
LinearizeAsGain on
SampleTime "-1"
}
Block {
BlockType Scope
Name "Scope"
Ports [1]
Position [215, 239, 245, 271]
Orientation "left"
ShowName off
FontName "Times New Roman"
FontSize 12
Floating off
Location [188, 365, 512, 604]
Open off
NumInputPorts "1"
TickLabels "OneTimeTick"
ZoomMode "on"
List {
ListType AxesTitles
axes1 "%<SignalLabel>"
}
Grid "on"
TimeRange "auto"
YMin "-5"
YMax "5"
SaveToWorkspace off
SaveName "ScopeData"
DataFormat "StructureWithTime"
LimitDataPoints on
MaxDataPoints "5000"
Decimation "1"
SampleInput off
SampleTime "-1"
}
Block {
BlockType Scope
Name "Scope1"
Ports [1]
Position [830, 80, 860, 110]
NamePlacement "alternate"
ShowName off
FontName "Times New Roman"
FontSize 12
Floating off
Location [188, 365, 512, 604]
Open off
NumInputPorts "1"
TickLabels "OneTimeTick"
ZoomMode "on"
List {
ListType AxesTitles
axes1 "%<SignalLabel>"
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -