Model {
  Name			  "Model210_DT_openloop"
  Version		  5.1
  SaveDefaultBlockParams  on
  SampleTimeColors	  off
  LibraryLinkDisplay	  "none"
  WideLines		  off
  ShowLineDimensions	  on
  ShowPortDataTypes	  off
  ShowLoopsOnError	  on
  IgnoreBidirectionalLines off
  ShowStorageClass	  off
  SortedOrder		  off
  RecordCoverage	  off
  CovPath		  "/"
  CovSaveName		  "covdata"
  CovMetricSettings	  "dw"
  CovNameIncrementing	  off
  CovHtmlReporting	  on
  covSaveCumulativeToWorkspaceVar on
  CovSaveSingleToWorkspaceVar on
  CovCumulativeVarName	  "covCumulativeData"
  CovCumulativeReport	  off
  DataTypeOverride	  "UseLocalSettings"
  MinMaxOverflowLogging	  "UseLocalSettings"
  MinMaxOverflowArchiveMode "Overwrite"
  BlockNameDataTip	  off
  BlockParametersDataTip  off
  BlockDescriptionStringDataTip	off
  ToolBar		  on
  StatusBar		  on
  BrowserShowLibraryLinks off
  BrowserLookUnderMasks	  off
  Created		  "Mon Jul 31 20:59:39 2000"
  UpdateHistory		  "UpdateHistoryNever"
  ModifiedByFormat	  "%<Auto>"
  LastModifiedBy	  "student"
  ModifiedDateFormat	  "%<Auto>"
  LastModifiedDate	  "Wed Nov 30 10:20:59 2005"
  ModelVersionFormat	  "1.%<AutoIncrement:138>"
  ConfigurationManager	  "None"
  SimParamPage		  "Solver"
  LinearizationMsg	  "none"
  Profile		  off
  ParamWorkspaceSource	  "MATLABWorkspace"
  AccelSystemTargetFile	  "accel.tlc"
  AccelTemplateMakefile	  "accel_default_tmf"
  AccelMakeCommand	  "make_rtw"
  TryForcingSFcnDF	  off
  ExtModeMexFile	  "rtwinext"
  ExtModeBatchMode	  off
  ExtModeTrigType	  "manual"
  ExtModeTrigMode	  "normal"
  ExtModeTrigPort	  "1"
  ExtModeTrigElement	  "any"
  ExtModeTrigDuration	  10000
  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 on
  BufferReuse		  on
  RTWExpressionDepthLimit 5
  SimulationMode	  "normal"
  Solver		  "FixedStepDiscrete"
  SolverMode		  "Auto"
  StartTime		  "0.0"
  StopTime		  "Tf"
  MaxOrder		  5
  MaxStep		  "auto"
  MinStep		  "auto"
  MaxNumMinSteps	  "-1"
  InitialStep		  "auto"
  FixedStep		  "Ts"
  RelTol		  "1e-3"
  AbsTol		  "auto"
  OutputOption		  "RefineOutputTimes"
  OutputTimes		  "[]"
  Refine		  "1"
  LoadExternalInput	  off
  ExternalInput		  "[t, u]"
  LoadInitialState	  off
  InitialState		  "xInitial"
  SaveTime		  on
  TimeSaveName		  "tout"
  SaveState		  off
  StateSaveName		  "xout"
  SaveOutput		  on
  OutputSaveName	  "yout"
  SaveFinalState	  off
  FinalStateName	  "xFinal"
  SaveFormat		  "Array"
  Decimation		  "1"
  LimitDataPoints	  on
  MaxDataPoints		  "10000"
  SignalLoggingName	  "sigsOut"
  ConsistencyChecking	  "none"
  ArrayBoundsChecking	  "none"
  AlgebraicLoopMsg	  "warning"
  BlockPriorityViolationMsg "warning"
  MinStepSizeMsg	  "warning"
  InheritedTsInSrcMsg	  "warning"
  DiscreteInheritContinuousMsg "warning"
  MultiTaskRateTransMsg	  "error"
  SingleTaskRateTransMsg  "none"
  CheckForMatrixSingularity "none"
  IntegerOverflowMsg	  "warning"
  Int32ToFloatConvMsg	  "warning"
  ParameterDowncastMsg	  "error"
  ParameterOverflowMsg	  "error"
  ParameterPrecisionLossMsg "warning"
  UnderSpecifiedDataTypeMsg "none"
  UnnecessaryDatatypeConvMsg "none"
  VectorMatrixConversionMsg "none"
  InvalidFcnCallConnMsg	  "error"
  SignalLabelMismatchMsg  "none"
  UnconnectedInputMsg	  "warning"
  UnconnectedOutputMsg	  "warning"
  UnconnectedLineMsg	  "warning"
  SfunCompatibilityCheckMsg "none"
  RTWInlineParameters	  off
  BlockReductionOpt	  on
  BooleanDataType	  on
  ConditionallyExecuteInputs on
  ParameterPooling	  on
  OptimizeBlockIOStorage  on
  ZeroCross		  on
  AssertionControl	  "UseLocalSettings"
  ProdHWDeviceType	  "Microprocessor"
  ProdHWWordLengths	  "8,16,32,32"
  RTWSystemTargetFile	  "rtwin.tlc"
  RTWTemplateMakefile	  "rtwintmf"
  RTWMakeCommand	  "make_rtw"
  RTWGenerateCodeOnly	  off
  RTWRetainRTWFile	  off
  TLCProfiler		  off
  TLCDebug		  off
  TLCCoverage		  off
  TLCAssertion		  off
  RTWOptions		  " -aCCOptimize=1 -aEnforceIntegerDowncast=1 -aExtMod"
"e=1 -aFoldNonRolledExpr=1 -aForceParamTrailComments=0 -aGenerateComments=1 -a"
"GenerateReport=0 -aIncDataTypeInIds=0 -aIncHierarchyInIds=0 -aInlineInvariant"
"Signals=0 -aInlineParameters=0 -aInlinedPrmAccess=\"Literals\" -aLocalBlockOu"
"tputs=1 -aMaxRTWIdLen=31 -aPrefixModelToSubsysFcnNames=1 -aRTWVerbose=1 -aReb"
"uildAll=0 -aRollThreshold=5 -aShowEliminatedStatements=0"
  BlockDefaults {
    Orientation		    "right"
    ForegroundColor	    "black"
    BackgroundColor	    "white"
    DropShadow		    off
    NamePlacement	    "normal"
    FontName		    "Helvetica"
    FontSize		    10
    FontWeight		    "normal"
    FontAngle		    "normal"
    ShowName		    on
  }
  BlockParameterDefaults {
    Block {
      BlockType		      Constant
      Value		      "1"
      VectorParams1D	      on
      ShowAdditionalParam     off
      OutDataTypeMode	      "Inherit from 'Constant value'"
      OutDataType	      "sfix(16)"
      ConRadixGroup	      "Use specified scaling"
      OutScaling	      "2^0"
    }
    Block {
      BlockType		      Derivative
    }
    Block {
      BlockType		      DigitalClock
    }
    Block {
      BlockType		      Gain
      Gain		      "1"
      Multiplication	      "Element-wise(K.*u)"
      ShowAdditionalParam     off
      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
    }
    Block {
      BlockType		      Inport
      Port		      "1"
      PortDimensions	      "-1"
      ShowAdditionalParam     off
      LatchInput	      off
      DataType		      "auto"
      OutDataType	      "sfix(16)"
      OutScaling	      "2^0"
      SignalType	      "auto"
      SamplingMode	      "auto"
      Interpolate	      on
    }
    Block {
      BlockType		      Mux
      Inputs		      "4"
      DisplayOption	      "none"
    }
    Block {
      BlockType		      Outport
      Port		      "1"
      OutputWhenDisabled      "held"
      InitialOutput	      "[]"
    }
    Block {
      BlockType		      Saturate
      UpperLimit	      "0.5"
      LowerLimit	      "-0.5"
      LinearizeAsGain	      on
      ZeroCross		      on
    }
    Block {
      BlockType		      "S-Function"
      FunctionName	      "system"
      PortCounts	      "[]"
      SFunctionModules	      "''"
    }
    Block {
      BlockType		      Step
      Time		      "1"
      Before		      "0"
      After		      "1"
      VectorParams1D	      on
      ZeroCross		      on
    }
    Block {
      BlockType		      SubSystem
      ShowPortLabels	      on
      Permissions	      "ReadWrite"
      RTWSystemCode	      "Auto"
      RTWFcnNameOpts	      "Auto"
      RTWFileNameOpts	      "Auto"
      SimViewingDevice	      off
      DataTypeOverride	      "UseLocalSettings"
      MinMaxOverflowLogging   "UseLocalSettings"
    }
    Block {
      BlockType		      ToWorkspace
      VariableName	      "simulink_output"
      MaxDataPoints	      "1000"
      Decimation	      "1"
    }
    Block {
      BlockType		      UnitDelay
      X0		      "0"
      RTWStateStorageClass    "Auto"
    }
  }
  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		    "Model210_DT_openloop"
    Location		    [159, 144, 653, 413]
    Open		    on
    ModelBrowserVisibility  off
    ModelBrowserWidth	    200
    ScreenColor		    "white"
    PaperOrientation	    "landscape"
    PaperPositionMode	    "auto"
    PaperType		    "usletter"
    PaperUnits		    "inches"
    ZoomFactor		    "100"
    ReportName		    "simulink-default.rpt"
    Block {
      BlockType		      DigitalClock
      Name		      "Digital Clock1"
      Position		      [25, 178, 90, 202]
      SampleTime	      "0.05"
    }
    Block {
      BlockType		      SubSystem
      Name		      "ECP Model 210\nDiscrete-Time\n"
      Ports		      [1, 1]
      Position		      [135, 74, 235, 116]
      BackgroundColor	      "yellow"
      TreatAsAtomicUnit	      off
      System {
	Name			"ECP Model 210\nDiscrete-Time\n"
	Location		[53, 269, 808, 733]
	Open			off
	ModelBrowserVisibility	off
	ModelBrowserWidth	200
	ScreenColor		"white"
	PaperOrientation	"landscape"
	PaperPositionMode	"auto"
	PaperType		"usletter"
	PaperUnits		"inches"
	ZoomFactor		"100"
	Block {
	  BlockType		  Inport
	  Name			  "u"
	  Position		  [60, 213, 90, 227]
	}
	Block {
	  BlockType		  Constant
	  Name			  "Dac2 Value"
	  Position		  [180, 260, 210, 290]
	  BackgroundColor	  "cyan"
	  DropShadow		  on
	  Value			  "0"
	}
	Block {
	  BlockType		  SubSystem
	  Name			  "ECPDSP Driver"
	  Ports			  [1, 1]
	  Position		  [285, 199, 420, 291]
	  BackgroundColor	  "lightBlue"
	  TreatAsAtomicUnit	  off
	  MaskPromptString	  "Base I/O Address|Sample Time (Sec)|Timeout "
"Period (500 ~ 2000)|Hardware Access"
	  MaskStyleString	  "edit,edit,edit,checkbox"
	  MaskTunableValueString  "on,on,on,on"
	  MaskCallbackString	  "|||"
	  MaskEnableString	  "on,on,on,on"
	  MaskVisibilityString	  "on,on,on,on"
	  MaskToolTipString	  "on,on,on,on"
	  MaskVarAliasString	  ",,,"
	  MaskVariables		  "BaseAddr=@1;STime=@2;TimeOutPer=@3;HWAccess"
"=@4;"
	  MaskDisplay		  "color('black');disp('ECPDSP Driver\\n upto"
"\\n 4 Encs(ADC Channels)\\n and 2 Dacs')\n\n"
	  MaskIconFrame		  on
	  MaskIconOpaque	  on
	  MaskIconRotate	  "none"
	  MaskIconUnits		  "autoscale"
	  MaskValueString	  "'0xDE00'|Ts|500|on"
	  System {
	    Name		    "ECPDSP Driver"
	    Location		    [414, 408, 789, 552]
	    Open		    off
	    ModelBrowserVisibility  off
	    ModelBrowserWidth	    200
	    ScreenColor		    "white"
	    PaperOrientation	    "landscape"
	    PaperPositionMode	    "auto"
	    PaperType		    "usletter"
	    PaperUnits		    "inches"
	    ZoomFactor		    "100"
	    Block {
	      BlockType		      Inport
	      Name		      "In1"
	      Position		      [320, 43, 350, 57]
	      Orientation	      "left"
	    }
	    Block {
	      BlockType		      "S-Function"
	      Name		      "S-Function"
	      Ports		      [1, 1]
	      Position		      [140, 30, 225, 70]
	      Orientation	      "left"
	      FunctionName	      "ECPDSPDriver"
	      Parameters	      "BaseAddr,STime,TimeOutPer,HWAccess"
	      MaskIconFrame	      on
	      MaskIconOpaque	      on
	      MaskIconRotate	      "none"
	      MaskIconUnits	      "autoscale"
	    }
	    Block {
	      BlockType		      Outport
	      Name		      "Out1"
	      Position		      [15, 43, 45, 57]
	      Orientation	      "left"
	    }
	    Line {
	      SrcBlock		      "In1"
	      SrcPort		      1
	      DstBlock		      "S-Function"
	      DstPort		      1
	    }
	    Line {
	      SrcBlock		      "S-Function"
	      SrcPort		      1
	      DstBlock		      "Out1"
	      DstPort		      1
	    }
	  }
	}
	Block {
	  BlockType		  SubSystem
	  Name			  "Manipulate Data"
	  Ports			  [1, 1]
	  Position		  [450, 224, 550, 266]
	  ForegroundColor	  "red"
	  BackgroundColor	  "green"
	  TreatAsAtomicUnit	  off
	  System {
	    Name		    "Manipulate Data"
	    Location		    [458, 517, 1123, 774]
	    Open		    off
	    ModelBrowserVisibility  off
	    ModelBrowserWidth	    200
	    ScreenColor		    "white"
	    PaperOrientation	    "landscape"
	    PaperPositionMode	    "auto"
	    PaperType		    "usletter"
	    PaperUnits		    "inches"
	    ZoomFactor		    "100"
	    Block {
	      BlockType		      Inport
	      Name		      "In1"
	      Position		      [15, 103, 45, 117]
	    }
	    Block {
	      BlockType		      Derivative
	      Name		      "Derivative"
	      Position		      [280, 70, 310, 100]
	    }
	    Block {
	      BlockType		      Derivative
	      Name		      "Derivative2"
	      Position		      [320, 180, 350, 210]
	    }
	    Block {
	      BlockType		      Mux
	      Name		      "Mux1"
	      Ports		      [4, 1]
	      Position		      [425, 96, 430, 134]
	      ShowName		      off
	      Inputs		      "[3 3 1 1]"
	      DisplayOption	      "bar"
	    }
	    Block {
	      BlockType		      Gain
	      Name		      "get \ndesired\nstates"
	      Position		      [535, 100, 565, 130]
	      Gain		      "get_desired_states"
	      Multiplication	      "Matrix(K*u)"
	    }
	    Block {
	      BlockType		      Gain
	      Name		      "get all \nstates"
	      Position		      [475, 100, 505, 130]
	      Gain		      "get_all_states"
	      Multiplication	      "Matrix(K*u)"
	    }
	    Block {
	      BlockType		      Gain
	      Name		      "get angles"
	      Position		      [145, 140, 175, 170]
	      Gain		      "get_angles"
	      Multiplication	      "Matrix(K*u)"
	    }
	    Block {
	      BlockType		      Gain
	      Name		      "get positions"
	      Position		      [100, 35, 130, 65]
	      Gain		      "get_positions"
	      Multiplication	      "Matrix(K*u)"
	    }
	    Block {
	      BlockType		      Gain
	      Name		      "scale1"
	      Position		      [160, 35, 190, 65]
	      Gain		      "1/(32*2196)"
	    }
	    Block {
	      BlockType		      Gain
	      Name		      "scale2"
	      Position		      [205, 140, 235, 170]
	      Gain		      "1/(32*2608)"
	    }
	    Block {
	      BlockType		      Outport
	      Name		      "Out1"
	      Position		      [610, 108, 640, 122]
	    }
	    Line {
	      SrcBlock		      "get positions"
	      SrcPort		      1
	      DstBlock		      "scale1"
	      DstPort		      1
	    }
	    Line {
	      SrcBlock		      "get angles"
	      SrcPort		      1
	      DstBlock		      "scale2"
	      DstPort		      1
	    }
	    Line {
	      SrcBlock		      "scale2"
	      SrcPort		      1
	      Points		      [0, 0; 25, 0]
	      Branch {
		Points			[0, 40]
		DstBlock		"Derivative2"
		DstPort			1
	      }
	      Branch {
		Points			[70, 0; 0, -35]
		DstBlock		"Mux1"
		DstPort			3
	      }
	    }
	    Line {
	      SrcBlock		      "Mux1"
	      SrcPort		      1
	      DstBlock		      "get all \nstates"
	      DstPort		      1
	    }
	    Line {
	      SrcBlock		      "get all \nstates"
	      SrcPort		      1
	      DstBlock		      "get \ndesired\nstates"
	      DstPort		      1
	    }
	    Line {
	      SrcBlock		      "get \ndesired\nstates"
	      SrcPort		      1
	      DstBlock		      "Out1"
	      DstPort		      1
	    }
	    Line {
	      SrcBlock		      "In1"
	      SrcPort		      1
	      Points		      [0, 0; 25, 0]
	      Branch {
		Points			[0, -60]
		DstBlock		"get positions"
		DstPort			1
	      }
	      Branch {
		Points			[0, 45]
		DstBlock		"get angles"
		DstPort			1
	      }
	    }
	    Line {
	      SrcBlock		      "scale1"
	      SrcPort		      1
	      Points		      [0, 0; 45, 0]
	      Branch {
		Points			[0, 35]
		DstBlock		"Derivative"
		DstPort			1
	      }
	      Branch {
		Points			[135, 0; 0, 50]
		DstBlock		"Mux1"
		DstPort			1
	      }
	    }
	    Line {
	      SrcBlock		      "Derivative"
	      SrcPort		      1
	      Points		      [15, 0; 0, 25]
	      DstBlock		      "Mux1"
	      DstPort		      2
	    }
	    Line {
	      SrcBlock		      "Derivative2"
	      SrcPort		      1
	      Points		      [25, 0; 0, -65]
	      DstBlock		      "Mux1"
	      DstPort		      4
	    }
	  }
	}
	Block {
	  BlockType		  Mux
	  Name			  "Mux"
	  Ports			  [2, 1]
	  Position		  [255, 226, 260, 264]
	  ShowName		  off
	  Inputs		  "2"
	  DisplayOption		  "bar"
	}
	Block {
	  BlockType		  Mux
	  Name			  "Mux1"
	  Ports			  [2, 1]
	  Position		  [595, 236, 600, 274]
	  ShowName		  off
	  Inputs		  "2"
	  DisplayOption		  "bar"
	}
	Block {
	  BlockType		  Saturate
	  Name			  "Saturation"
	  Position		  [180, 205, 210, 235]
	  UpperLimit		  "32000"
	  LowerLimit		  "-32000"
	}
	Block {
	  BlockType		  UnitDelay
	  Name			  "Unit Delay"
	  Position		  [405, 325, 440, 365]
	  SampleTime		  "Ts"
	}
	Block {
	  BlockType		  Gain
	  Name			  "scale"
	  Position		  [130, 205, 160, 235]
	  Gain			  "32*2196"
	}
	Block {
	  BlockType		  Outport
	  Name			  "states\n"
	  Position		  [680, 250, 710, 260]
	}
	Line {
	  SrcBlock		  "Saturation"
	  SrcPort		  1
	  Points		  [0, 10; 25, 0]
	  DstBlock		  "Mux"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "Mux"
	  SrcPort		  1
	  DstBlock		  "ECPDSP Driver"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "Dac2 Value"
	  SrcPort		  1
	  Points		  [15, 0; 0, -20]
	  DstBlock		  "Mux"
	  DstPort		  2
	}
	Line {
	  SrcBlock		  "scale"
	  SrcPort		  1
	  DstBlock		  "Saturation"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "ECPDSP Driver"
	  SrcPort		  1
	  DstBlock		  "Manipulate Data"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "u"
	  SrcPort		  1
	  Points		  [10, 0]
	  Branch {
	    DstBlock		    "scale"
	    DstPort		    1
	  }
	  Branch {
	    Points		    [0, 125]
	    DstBlock		    "Unit Delay"
	    DstPort		    1
	  }
	}
	Line {
	  SrcBlock		  "Manipulate Data"
	  SrcPort		  1
	  DstBlock		  "Mux1"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "Mux1"
	  SrcPort		  1
	  DstBlock		  "states\n"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "Unit Delay"
	  SrcPort		  1
	  Points		  [135, 0]
	  DstBlock		  "Mux1"
	  DstPort		  2
	}
      }
    }
    Block {
      BlockType		      Step
      Name		      "Input"
      Position		      [15, 80, 45, 110]
      Time		      "0"
      After		      "Amp"
      SampleTime	      "Ts"
    }
    Block {
      BlockType		      ToWorkspace
      Name		      "To Workspace2"
      Position		      [80, 20, 140, 50]
      VariableName	      "u"
      MaxDataPoints	      "inf"
      SampleTime	      "-1"
      SaveFormat	      "Array"
    }
    Block {
      BlockType		      ToWorkspace
      Name		      "To Workspace3"
      Position		      [120, 175, 180, 205]
      VariableName	      "time"
      MaxDataPoints	      "inf"
      SampleTime	      "-1"
      SaveFormat	      "Array"
    }
    Block {
      BlockType		      ToWorkspace
      Name		      "To Workspace4"
      Position		      [310, 80, 370, 110]
      VariableName	      "y"
      MaxDataPoints	      "inf"
      SampleTime	      "-1"
      SaveFormat	      "Array"
    }
    Line {
      SrcBlock		      "Digital Clock1"
      SrcPort		      1
      DstBlock		      "To Workspace3"
      DstPort		      1
    }
    Line {
      SrcBlock		      "Input"
      SrcPort		      1
      Points		      [0, 0; 10, 0]
      Branch {
	Points			[5, 0]
	DstBlock		"To Workspace2"
	DstPort			1
      }
      Branch {
	DstBlock		"ECP Model 210\nDiscrete-Time\n"
	DstPort			1
      }
    }
    Line {
      SrcBlock		      "ECP Model 210\nDiscrete-Time\n"
      SrcPort		      1
      DstBlock		      "To Workspace4"
      DstPort		      1
    }
  }
}
