Model { Name "ecan2essai" Version 7.0 MdlSubVersion 0 GraphicalInterface { NumRootInports 0 NumRootOutports 0 ParameterArgumentNames "" ComputedModelVersion "1.103" 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 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 Aug 12 13:31:09 2009" Creator "Administrator" UpdateHistory "UpdateHistoryNever" ModifiedByFormat "%" LastModifiedBy "Administrator" ModifiedDateFormat "%" LastModifiedDate "Thu Sep 10 15:02:41 2009" RTWModifiedTimeStamp 0 ModelVersionFormat "1.%" ConfigurationManager "None" SimulationMode "normal" LinearizationMsg "none" Profile off ParamWorkspaceSource "MATLABWorkspace" AccelSystemTargetFile "accel.tlc" AccelTemplateMakefile "accel_default_tmf" AccelMakeCommand "make_rtw" TryForcingSFcnDF off RecordCoverage off CovPath "/" CovSaveName "covdata" CovMetricSettings "dw" CovNameIncrementing off CovHtmlReporting on covSaveCumulativeToWorkspaceVar on CovSaveSingleToWorkspaceVar on CovCumulativeVarName "covCumulativeData" CovCumulativeReport off CovReportOnPause on 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 on BufferReuse on ShowModelReferenceBlockVersion off ShowModelReferenceBlockIO off Array { Type "Handle" Dimension 1 Simulink.ConfigSet { $ObjectID 1 Version "1.3.0" Array { Type "Handle" Dimension 7 Simulink.SolverCC { $ObjectID 2 Version "1.3.0" StartTime "0.0" StopTime "10.0" AbsTol "auto" FixedStep "0.001" InitialStep "auto" MaxNumMinSteps "-1" MaxOrder 5 ConsecutiveZCsStepRelTol "10*128*eps" MaxConsecutiveZCs "1000" ExtrapolationOrder 4 NumberNewtonIterations 1 MaxStep "auto" MinStep "auto" MaxConsecutiveMinStep "1" RelTol "1e-3" SolverMode "Auto" Solver "FixedStepDiscrete" SolverName "FixedStepDiscrete" ZeroCrossControl "UseLocalSettings" AlgebraicLoopSolver "TrustRegion" SolverResetMethod "Fast" PositivePriorityOrder off AutoInsertRateTranBlk off SampleTimeConstraint "Unconstrained" RateTranMode "Deterministic" } Simulink.DataIOCC { $ObjectID 3 Version "1.3.0" Decimation "1" ExternalInput "[t, u]" FinalStateName "xFinal" InitialState "xInitial" LimitDataPoints on MaxDataPoints "1000" LoadExternalInput off LoadInitialState off SaveFinalState off SaveFormat "Array" SaveOutput on SaveState off SignalLogging on InspectSignalLogs off SaveTime on StateSaveName "xout" TimeSaveName "tout" OutputSaveName "yout" SignalLoggingName "logsout" OutputOption "RefineOutputTimes" OutputTimes "[]" Refine "1" } Simulink.OptimizationCC { $ObjectID 4 Version "1.3.0" BlockReduction on BooleanDataType on ConditionallyExecuteInputs on InlineParams off InlineInvariantSignals off OptimizeBlockIOStorage on BufferReuse on EnforceIntegerDowncast on ExpressionFolding on ExpressionDepthLimit 2147483647 FoldNonRolledExpr on LocalBlockOutputs on RollThreshold 5 SystemCodeInlineAuto off StateBitsets off DataBitsets off UseTempVars off ZeroExternalMemoryAtStartup on ZeroInternalMemoryAtStartup on InitFltsAndDblsToZero on NoFixptDivByZeroProtection off EfficientFloat2IntCast off OptimizeModelRefInitCode on LifeSpan "1" BufferReusableBoundary on SimCompilerOptimization "Off" AccelVerboseBuild off } Simulink.DebuggingCC { $ObjectID 5 Version "1.3.0" RTPrefix "error" ConsistencyChecking "none" ArrayBoundsChecking "none" SignalInfNanChecking "none" SignalRangeChecking "none" ReadBeforeWriteMsg "UseLocalSettings" WriteAfterWriteMsg "UseLocalSettings" WriteAfterReadMsg "UseLocalSettings" AlgebraicLoopMsg "warning" ArtificialAlgebraicLoopMsg "warning" SaveWithDisabledLinksMsg "warning" SaveWithParameterizedLinksMsg "warning" CheckSSInitialOutputMsg on CheckExecutionContextPreStartOutputMsg off CheckExecutionContextRuntimeOutputMsg off SignalResolutionControl "TryResolveAllWithWarning" BlockPriorityViolationMsg "warning" MinStepSizeMsg "warning" TimeAdjustmentMsg "none" MaxConsecutiveZCsMsg "error" SolverPrmCheckMsg "warning" InheritedTsInSrcMsg "warning" DiscreteInheritContinuousMsg "warning" MultiTaskDSMMsg "error" MultiTaskCondExecSysMsg "error" MultiTaskRateTransMsg "error" SingleTaskRateTransMsg "none" TasksWithSamePriorityMsg "warning" SigSpecEnsureSampleTimeMsg "warning" CheckMatrixSingularityMsg "none" IntegerOverflowMsg "warning" Int32ToFloatConvMsg "warning" ParameterDowncastMsg "error" ParameterOverflowMsg "error" ParameterUnderflowMsg "none" ParameterPrecisionLossMsg "warning" ParameterTunabilityLossMsg "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" StateNameClashWarn "warning" StrictBusMsg "Warning" LoggingUnavailableSignals "error" } Simulink.HardwareCC { $ObjectID 6 Array { Type "Cell" Dimension 2 Cell "ProdHWDeviceType" Cell "ProdEqTarget" PropName "DisabledProps" } Version "1.3.0" ProdBitPerChar 8 ProdBitPerShort 16 ProdBitPerInt 16 ProdBitPerLong 32 ProdIntDivRoundTo "Undefined" ProdEndianess "LittleEndian" ProdWordSize 16 ProdShiftRightIntArith on ProdHWDeviceType "16-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 "32-bit Generic" TargetUnknown off ProdEqTarget on } Simulink.ModelReferenceCC { $ObjectID 7 Version "1.3.0" UpdateModelReferenceTargets "IfOutOfDateOrStructuralChange" CheckModelReferenceTargetMessage "error" ModelReferenceNumInstancesAllowed "Multi" ModelReferencePassRootInputsByReference on ModelReferenceMinAlgLoopOccurrences off } Simulink.RTWCC { $BackupClass "Simulink.RTWCC" $ObjectID 8 Array { Type "Cell" Dimension 1 Cell "TargetLang" PropName "DisabledProps" } Version "1.3.0" SystemTargetFile "dspic.tlc" GenCodeOnly off MakeCommand "make_rtw" GenerateMakefile on TemplateMakefile "dspic_pic30_gcc.tmf" PostCodeGenCommand "dsPIC_Compile()" Description "Embedded Target for Microchip dsPIC (real-time)" GenerateReport on SaveLog off RTWVerbose on RetainRTWFile off ProfileTLC off TLCDebug off TLCCoverage off TLCAssert off ProcessScriptMode "Default" ConfigurationMode "Optimized" ProcessScript "dspic_make_rtw_hook" ConfigAtBuild off CustomSource "ecan.c\necan2simulink.c\nQEI_Functions.c" IncludeHyperlinkInReport on LaunchReport on TargetLang "C" IncludeBusHierarchyInRTWFileBlockHierarchyMap off IncludeERTFirstTime off GenerateTraceInfo off RTWCompilerOptimization "Off" Array { Type "Handle" Dimension 2 Simulink.CodeAppCC { $ObjectID 9 Version "1.3.0" ForceParamTrailComments off GenerateComments on IgnoreCustomStorageClasses off IncHierarchyInIds off MaxIdLength 31 PreserveName off PreserveNameWithParent off ShowEliminatedStatement off IncAutoGenComments off SimulinkDataObjDesc off SFDataObjDesc off IncDataTypeInIds off MangleLength 1 CustomSymbolStrGlobalVar "$R$N$M" CustomSymbolStrType "$N$R$M" CustomSymbolStrField "$N$M" CustomSymbolStrFcn "$R$N$M$F" CustomSymbolStrBlkIO "rtb_$N$M" CustomSymbolStrTmpVar "$N$M" CustomSymbolStrMacro "$R$N$M" DefineNamingRule "None" ParamNamingRule "None" SignalNamingRule "None" InsertBlockDesc off SimulinkBlockComments on EnableCustomComments off InlinedPrmAccess "Literals" ReqsInCode off } Simulink.STFCustomTargetCC { $BackupClass "Simulink.TargetCC" $ObjectID 10 Array { Type "Cell" Dimension 5 Cell "GenerateSampleERTMain" Cell "MatFileLogging" Cell "SupportNonInlinedSFcns" Cell "UtilityFuncGeneration" Cell "IncludeMdlTerminateFcn" PropName "DisabledProps" } Version "1.3.0" TargetFcnLib "ansi_tfl_table_tmw.mat" TargetLibSuffix "" TargetPreCompLibLocation "" GenFloatMathFcnCalls "ANSI_C" UtilityFuncGeneration "Auto" GenerateFullHeader on GenerateSampleERTMain off GenerateTestInterfaces off IsPILTarget off ModelReferenceCompliant off CompOptLevelCompliant off IncludeMdlTerminateFcn off CombineOutputUpdateFcns on SuppressErrorStatus on IncludeFileDelimiter "Auto" ERTCustomFileBanners on SupportAbsoluteTime on LogVarNameModifier "rt_" MatFileLogging off MultiInstanceERTCode off SupportNonFinite on SupportComplex on PurelyIntegerCode off SupportContinuousTime off SupportNonInlinedSFcns off EnableShiftOperators on ParenthesesLevel "Nominal" PortableWordSizes off ModelStepFunctionPrototypeControlCompliant off SystemTargetFile "dspic.tlc" DialogCategory 0 Array { Type "Handle" Dimension 1 Simulink.ERTTargetCC { $BackupClass "Simulink.TargetCC" $ObjectID 11 Array { Type "Cell" Dimension 8 Cell "GenerateSampleERTMain" Cell "GenerateErtSFunction" Cell "MatFileLogging" Cell "GRTInterface" Cell "ERTCustomFileTemplate" Cell "SupportNonInlinedSFcns" Cell "UtilityFuncGeneration" Cell "IncludeMdlTerminateFcn" PropName "DisabledProps" } Version "1.3.0" TargetFcnLib "ansi_tfl_table_tmw.mat" TargetLibSuffix "" TargetPreCompLibLocation "" GenFloatMathFcnCalls "ANSI_C" UtilityFuncGeneration "Auto" GenerateFullHeader on GenerateSampleERTMain off GenerateTestInterfaces off IsPILTarget off ModelReferenceCompliant off CompOptLevelCompliant off IncludeMdlTerminateFcn off CombineOutputUpdateFcns on SuppressErrorStatus on IncludeFileDelimiter "Auto" ERTCustomFileBanners on SupportAbsoluteTime on LogVarNameModifier "rt_" MatFileLogging off MultiInstanceERTCode off SupportNonFinite on SupportComplex on PurelyIntegerCode off SupportContinuousTime off SupportNonInlinedSFcns off EnableShiftOperators on ParenthesesLevel "Nominal" PortableWordSizes off ModelStepFunctionPrototypeControlCompliant off GenerateErtSFunction off GenerateASAP2 off ExtMode off ExtModeTransport 0 ExtModeStaticAlloc off ExtModeStaticAllocSize 1000000 ExtModeTesting off ExtModeMexFile "noextcomm" ExtModeIntrfLevel "Level1" InlinedParameterPlacement "NonHierarchical" TargetOS "BareBoardExample" MultiInstanceErrorCode "Error" RateGroupingCode on RootIOFormat "Individual arguments" RTWCAPISignals off RTWCAPIParams off RTWCAPIStates off ERTSrcFileBannerTemplate "dsPIC_code_template.cgt" ERTHdrFileBannerTemplate "dsPIC_code_template.cgt" ERTDataSrcFileTemplate "dsPIC_code_template.cgt" ERTDataHdrFileTemplate "dsPIC_code_template.cgt" ERTCustomFileTemplate "dsPIC_main.tlc" ModuleNamingRule "SameAsModel" SignalDisplayLevel 10 ParamTuneLevel 10 GlobalDataDefinition "Auto" DataDefinitionFile "global.c" GlobalDataReference "Auto" DataReferenceFile "global.h" GRTInterface off PreserveExpressionOrder off PreserveIfCondition off EnableUserReplacementTypes on Array { Type "Struct" Dimension 1 MATStruct { double "" single "" int32 "" int16 "" int8 "" uint32 "" uint16 "" uint8 "" boolean "" int "" uint "" char "" } PropName "ReplacementTypes" } MemSecPackage "--- None ---" MemSecDataConstants "Default" MemSecDataIO "Default" MemSecDataInternal "Default" MemSecDataParameters "Default" MemSecFuncInitTerm "Default" MemSecFuncExecute "Default" } PropName "Components" } CustomProperty { DataType "string" Name "GMAKE_PLACE" Value "C:\\PROGRA~1\\MATLAB\\R2007b\\bin\\win32\\gmake" } CustomProperty { DataType "string" Name "OPTIM_GCC" Value "-mcpu=33fJ256MC710 -O3 -fschedule-insns -fschedule-insns2" } CustomProperty { DataType "string" Name "LDFLAGS" Value "-t --report-mem -Map ../untitled.map --heap 0 -cref" } CustomProperty { DataType "string" Name "LDPICTYPE" Value "-T C:\\PROGRA~1\\MICROC~1\\MPLABC~1\\support\\dsPIC33F\\gld\\p33fJ256MC710.gld" } CustomProperty { DataType "string" Name "LDLIBPIC" Value "C:\\PROGRA~1\\MICROC~1\\MPLABC~2\\lib\\libpic30-coff.a C:\\PROGRA~1\\MICROC~1\\MPLABC~2\\lib\\dsPIC33F\\libp33fJ256MC710-coff.a C:\\PROGRA~1\\MICROC~1\\MPLABC~1\\lib\\libc-coff.a C:\\PROGRA~1\\MICROC~1\\MPLABC~1\\lib\\libm-coff.a" } CustomProperty { DataType "string" Name "PIC_INCLUDES" Value "-I C:\\PROGRA~1\\MICROC~1\\MPLABC~1\\include" } CustomProperty { DataType "string" Name "PIC_REF" Value "33fJ256MC710" } CustomProperty { DataType "string" Name "GCCPATH" Value "''" } } PropName "Components" } } PropName "Components" } Name "Configuration" ExtraOptions "-aGenerateTraceInfo=0 " CurrentDlgPage "Real-Time Workshop/DsPIC options" } 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 ArithShift nBitShiftRight "0" nBinPtShiftRight "0" } Block { BlockType DataStoreMemory ReadBeforeWriteMsg "none" WriteAfterWriteMsg "none" WriteAfterReadMsg "none" InitialValue "0" StateMustResolveToSignalObject off ShowAdditionalParam off OutMin "[]" OutMax "[]" DataType "auto" OutDataType "fixdt(1,16,0)" OutScaling "[]" SignalType "auto" } Block { BlockType DataTypeConversion OutMin "[]" OutMax "[]" OutDataTypeMode "Inherit via back propagation" OutDataType "fixdt(1,16,0)" OutScaling "[]" LockScale off ConvertRealWorld "Real World Value (RWV)" RndMeth "Zero" SaturateOnIntegerOverflow on SampleTime "-1" } Block { BlockType Demux Outputs "4" DisplayOption "none" BusSelectionMode off } Block { BlockType Gain Gain "1" Multiplication "Element-wise(K.*u)" ParamMin "[]" ParamMax "[]" ParameterDataTypeMode "Same as input" ParameterDataType "fixdt(1,16,0)" ParameterScalingMode "Best Precision: Matrix-wise" ParameterScaling "[]" OutMin "[]" OutMax "[]" OutDataTypeMode "Same as input" OutDataType "fixdt(1,16,0)" OutScaling "[]" LockScale off RndMeth "Floor" SaturateOnIntegerOverflow on SampleTime "-1" } Block { BlockType Ground } Block { BlockType Inport Port "1" UseBusObject off BusObject "BusObject" BusOutputAsStruct off PortDimensions "-1" SampleTime "-1" OutMin "[]" OutMax "[]" DataType "auto" OutDataType "fixdt(1,16,0)" OutScaling "[]" 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" OutMin "[]" OutMax "[]" DataType "auto" OutDataType "fixdt(1,16,0)" OutScaling "[]" 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 "S-Function" FunctionName "system" SFunctionModules "''" PortCounts "[]" } Block { BlockType SubSystem ShowPortLabels "FromPortIcon" Permissions "ReadWrite" PermitHierarchicalResolution "All" TreatAsAtomicUnit off SystemSampleTime "-1" RTWFcnNameOpts "Auto" RTWFileNameOpts "Auto" RTWMemSecFuncInitTerm "Inherit from model" RTWMemSecFuncExecute "Inherit from model" RTWMemSecDataConstants "Inherit from model" RTWMemSecDataInternal "Inherit from model" RTWMemSecDataParameters "Inherit from model" SimViewingDevice off DataTypeOverride "UseLocalSettings" MinMaxOverflowLogging "UseLocalSettings" } Block { BlockType Sum IconShape "rectangular" Inputs "++" CollapseMode "All dimensions" CollapseDim "1" InputSameDT on OutMin "[]" OutMax "[]" OutDataTypeMode "Same as first input" OutDataType "fixdt(1,16,0)" OutScaling "[]" LockScale off RndMeth "Floor" SaturateOnIntegerOverflow on SampleTime "-1" } Block { BlockType Terminator } Block { BlockType TriggerPort TriggerType "rising" StatesWhenEnabling "inherit" ShowOutputPort off OutputDataType "auto" SampleTimeType "triggered" SampleTime "1" ZeroCross on } Block { BlockType Constant Value "1" VectorParams1D on SamplingMode "Sample based" OutMin "[]" OutMax "[]" OutDataTypeMode "Inherit from 'Constant value'" OutDataType "fixdt(1,16,0)" ConRadixGroup "Use specified scaling" OutScaling "[]" SampleTime "inf" FramePeriod "inf" } Block { BlockType Saturate UpperLimit "0.5" LowerLimit "-0.5" LinearizeAsGain on ZeroCross on SampleTime "-1" OutMin "[]" OutMax "[]" OutDataTypeMode "Same as input" OutDataType "fixdt(1,16,0)" OutScaling "[]" LockScale off RndMeth "Floor" } } AnnotationDefaults { HorizontalAlignment "center" VerticalAlignment "middle" ForegroundColor "black" BackgroundColor "white" DropShadow off FontName "Arial" FontSize 10 FontWeight "normal" FontAngle "normal" UseDisplayTextAsClickCallback off } LineDefaults { FontName "Arial" FontSize 9 FontWeight "normal" FontAngle "normal" } System { Name "ecan2essai" Location [8, 74, 1555, 1103] Open on ModelBrowserVisibility off ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "landscape" PaperPositionMode "auto" PaperType "usletter" PaperUnits "inches" TiledPaperMargins [0.500000, 0.500000, 0.500000, 0.500000] TiledPageScale 1 ShowPageBoundaries off ZoomFactor "100" ReportName "simulink-default.rpt" Block { BlockType Constant Name "Constant3" Position [345, 555, 375, 585] Value "2.5" OutDataType "sfix(16)" OutScaling "2^0" } Block { BlockType Constant Name "Constant4" Position [655, 680, 685, 710] Value "2.5" OutDataType "sfix(16)" OutScaling "2^0" } Block { BlockType DataTypeConversion Name "Data Type Conversion1" Position [1145, 588, 1220, 622] NamePlacement "alternate" OutMin "[0]" OutMax "[255]" OutDataTypeMode "uint8" OutDataType "sfix(16)" OutScaling "2^0" ConvertRealWorld "Stored Integer (SI)" SaturateOnIntegerOverflow off } Block { BlockType DataTypeConversion Name "Data Type Conversion2" Position [1170, 683, 1245, 717] NamePlacement "alternate" OutMin "[0]" OutMax "[255]" OutDataTypeMode "uint8" OutDataType "sfix(16)" OutScaling "2^0" ConvertRealWorld "Stored Integer (SI)" SaturateOnIntegerOverflow off } Block { BlockType DataTypeConversion Name "Data Type Conversion3" Position [925, 603, 995, 637] OutMin "[0]" OutMax "[4095]" OutDataTypeMode "uint16" OutDataType "sfix(16)" OutScaling "2^0" SaturateOnIntegerOverflow off } Block { BlockType DataTypeConversion Name "Data Type Conversion5" Position [455, 648, 500, 682] OutMin "[0]" OutMax "[4095]" OutDataTypeMode "double" OutDataType "sfix(16)" OutScaling "2^0" SaturateOnIntegerOverflow off } Block { BlockType DataTypeConversion Name "Data Type Conversion6" Position [345, 378, 415, 412] OutMin "[0]" OutMax "[4095]" OutDataTypeMode "uint16" OutDataType "sfix(16)" OutScaling "2^0" SaturateOnIntegerOverflow off } Block { BlockType Constant Name "Data2" Position [500, 121, 565, 139] ShowName off Value "2047" OutDataTypeMode "uint32" OutDataType "sfix(16)" OutScaling "2^0" } Block { BlockType SubSystem Name "Embedded\nMATLAB Function" Ports [1, 2] Position [1050, 594, 1120, 641] PermitHierarchicalResolution "ExplicitOnly" MinAlgLoopOccurrences off RTWSystemCode "Auto" FunctionWithSeparateData off MaskType "Stateflow" MaskDescription "Embedded MATLAB block" MaskDisplay "disp('fcn');" MaskSelfModifiable on MaskIconFrame on MaskIconOpaque off MaskIconRotate "none" MaskIconUnits "autoscale" System { Name "Embedded\nMATLAB Function" Location [257, 457, 812, 717] Open off ModelBrowserVisibility off ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "landscape" PaperPositionMode "auto" PaperType "usletter" PaperUnits "inches" TiledPaperMargins [0.500000, 0.500000, 0.500000, 0.500000] TiledPageScale 1 ShowPageBoundaries off ZoomFactor "100" Block { BlockType Inport Name "u" Position [20, 101, 40, 119] IconDisplay "Port number" OutDataType "sfix(16)" OutScaling "2^0" } Block { BlockType Demux Name " Demux " Ports [1, 1] Position [270, 180, 320, 220] Outputs "1" } Block { BlockType "S-Function" Name " SFunction " Tag "Stateflow S-Function ecan2essai 2" Ports [1, 3] Position [180, 100, 230, 180] FunctionName "sf_sfun" PortCounts "[1 3]" EnableBusSupport on Port { PortNumber 2 Name "w1" RTWStorageClass "Auto" DataLoggingNameMode "SignalName" } Port { PortNumber 3 Name "w2" RTWStorageClass "Auto" DataLoggingNameMode "SignalName" } } Block { BlockType Terminator Name " Terminator " Position [460, 191, 480, 209] } Block { BlockType Outport Name "w1" Position [460, 101, 480, 119] IconDisplay "Port number" OutDataType "sfix(16)" OutScaling "2^0" } Block { BlockType Outport Name "w2" Position [460, 136, 480, 154] Port "2" IconDisplay "Port number" } Line { SrcBlock " SFunction " SrcPort 1 Points [0, 85] DstBlock " Demux " DstPort 1 } Line { SrcBlock " Demux " SrcPort 1 DstBlock " Terminator " DstPort 1 } Line { SrcBlock "u" SrcPort 1 DstBlock " SFunction " DstPort 1 } Line { Name "w1" Labels [0, 0] SrcBlock " SFunction " SrcPort 2 DstBlock "w1" DstPort 1 } Line { Name "w2" Labels [0, 0] SrcBlock " SFunction " SrcPort 3 DstBlock "w2" DstPort 1 } } } Block { BlockType SubSystem Name "Extract data" Ports [1, 3] Position [155, 389, 255, 431] MinAlgLoopOccurrences off RTWSystemCode "Auto" FunctionWithSeparateData off System { Name "Extract data" Location [437, 453, 1093, 874] Open off ModelBrowserVisibility off ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "landscape" PaperPositionMode "auto" PaperType "usletter" PaperUnits "inches" TiledPaperMargins [0.500000, 0.500000, 0.500000, 0.500000] TiledPageScale 1 ShowPageBoundaries off ZoomFactor "100" Block { BlockType Inport Name "In1" Position [110, 133, 140, 147] IconDisplay "Port number" OutDataType "sfix(16)" OutScaling "2^0" } Block { BlockType DataTypeConversion Name "Data Type Conversion1" Position [345, 188, 415, 222] OutMin "[0]" OutMax "[255]" OutDataTypeMode "uint8" OutDataType "sfix(16)" OutScaling "2^0" SaturateOnIntegerOverflow off } Block { BlockType DataTypeConversion Name "Data Type Conversion2" Position [345, 253, 415, 287] OutMin "[0]" OutMax "[1024]" OutDataTypeMode "uint16" OutDataType "sfix(16)" OutScaling "2^0" SaturateOnIntegerOverflow off } Block { BlockType DataTypeConversion Name "Data Type Conversion3" Position [345, 123, 415, 157] OutMin "[0]" OutMax "[1024]" OutDataTypeMode "uint16" OutDataType "sfix(16)" OutScaling "2^0" SaturateOnIntegerOverflow off } Block { BlockType Reference Name "Extract Bits" Ports [1, 1] Position [220, 120, 300, 160] SourceBlock "simulink/Logic and Bit\nOperations/Extract Bits" SourceType "Extract Bits" ShowPortLabels "FromPortIcon" SystemSampleTime "-1" FunctionWithSeparateData off RTWMemSecFuncInitTerm "Inherit from model" RTWMemSecFuncExecute "Inherit from model" RTWMemSecDataConstants "Inherit from model" RTWMemSecDataInternal "Inherit from model" RTWMemSecDataParameters "Inherit from model" bitsToExtract "Upper half" numBits "8" bitIdxRange "[0 7]" outScalingMode "Treat bit field as an integer" } Block { BlockType Reference Name "Extract Bits1" Ports [1, 1] Position [220, 185, 300, 225] SourceBlock "simulink/Logic and Bit\nOperations/Extract Bits" SourceType "Extract Bits" ShowPortLabels "FromPortIcon" SystemSampleTime "-1" FunctionWithSeparateData off RTWMemSecFuncInitTerm "Inherit from model" RTWMemSecFuncExecute "Inherit from model" RTWMemSecDataConstants "Inherit from model" RTWMemSecDataInternal "Inherit from model" RTWMemSecDataParameters "Inherit from model" bitsToExtract "Range of bits" numBits "8" bitIdxRange "[12 15]" outScalingMode "Treat bit field as an integer" } Block { BlockType Reference Name "Extract Bits2" Ports [1, 1] Position [220, 250, 300, 290] SourceBlock "simulink/Logic and Bit\nOperations/Extract Bits" SourceType "Extract Bits" ShowPortLabels "FromPortIcon" SystemSampleTime "-1" FunctionWithSeparateData off RTWMemSecFuncInitTerm "Inherit from model" RTWMemSecFuncExecute "Inherit from model" RTWMemSecDataConstants "Inherit from model" RTWMemSecDataInternal "Inherit from model" RTWMemSecDataParameters "Inherit from model" bitsToExtract "Range of bits" numBits "8" bitIdxRange "[0 11]" outScalingMode "Treat bit field as an integer" } Block { BlockType Outport Name "Data" Position [460, 133, 490, 147] IconDisplay "Port number" OutDataType "sfix(16)" OutScaling "2^0" } Block { BlockType Outport Name "Type" Position [460, 198, 490, 212] Port "2" IconDisplay "Port number" OutDataType "sfix(16)" OutScaling "2^0" } Block { BlockType Outport Name "ID" Position [460, 261, 490, 279] Port "3" IconDisplay "Port number" OutDataType "sfix(16)" OutScaling "2^0" } Line { SrcBlock "In1" SrcPort 1 Points [20, 0] Branch { DstBlock "Extract Bits" DstPort 1 } Branch { Points [0, 0] Branch { Points [0, 65] DstBlock "Extract Bits1" DstPort 1 } Branch { Points [0, 130] DstBlock "Extract Bits2" DstPort 1 } } } Line { SrcBlock "Extract Bits" SrcPort 1 DstBlock "Data Type Conversion3" DstPort 1 } Line { SrcBlock "Extract Bits1" SrcPort 1 DstBlock "Data Type Conversion1" DstPort 1 } Line { SrcBlock "Extract Bits2" SrcPort 1 DstBlock "Data Type Conversion2" DstPort 1 } Line { SrcBlock "Data Type Conversion2" SrcPort 1 DstBlock "ID" DstPort 1 } Line { SrcBlock "Data Type Conversion1" SrcPort 1 DstBlock "Type" DstPort 1 } Line { SrcBlock "Data Type Conversion3" SrcPort 1 DstBlock "Data" DstPort 1 } } } Block { BlockType Constant Name "Filter1" Position [500, 86, 565, 104] Value "294" OutDataTypeMode "uint32" OutDataType "sfix(16)" OutScaling "2^0" } Block { BlockType Constant Name "Filter2" Position [500, 166, 565, 184] Value "294" OutDataTypeMode "uint32" OutDataType "sfix(16)" OutScaling "2^0" } Block { BlockType Constant Name "Filter3" Position [500, 246, 565, 264] Value "2047" OutDataTypeMode "uint32" OutDataType "sfix(16)" OutScaling "2^0" } Block { BlockType Gain Name "Gain" Position [740, 597, 810, 643] Gain "4095/5" ParameterDataTypeMode "Inherit via internal rule" ParameterDataType "sfix(16)" ParameterScaling "2^0" OutDataTypeMode "Inherit via internal rule" OutDataType "sfix(16)" OutScaling "2^0" SaturateOnIntegerOverflow off } Block { BlockType Gain Name "Gain1" Position [325, 472, 395, 518] Gain "5/(2^16-1)" ParameterDataTypeMode "Inherit via internal rule" ParameterDataType "sfix(16)" ParameterScaling "2^0" OutDataTypeMode "Inherit via internal rule" OutDataType "sfix(16)" OutScaling "2^0" SaturateOnIntegerOverflow off } Block { BlockType Reference Name "I2C Bus Master / Initialization " Tag "dsPIC_I2C_Master" Ports [] Position [25, 196, 150, 254] List { ListType RTWdata NbrInput8Data "0" NbrOutput8Data "0" LengthListeCmdI2C "6" NumI2C "1" Enable "1" Adress10Bits "0" I2CBusFreq " 363" SlewRate "0" Disable "0" WaitAfterEnable "3" SMBUSThreshold "0" OutputErrorFlag "0" Initialisation "1" } SourceBlock "dsPICdrivers/BUS I2C/I2C Bus Master" SourceType "I2C Master" NumI2C "1" Sequence "'S A024 W056 W000 W001 P' " InitializeOnceOnly "When PIC is initialized (only once)" Enable on WaitAfterEnable "3" Disable off AdressNbrBits "7 bits" I2CBusFreq " 363" SlewRate off SMBUSThreshold off OutputErrorFlag off SampleTime "-1" OrderingInOutPopup "None" Info "Fscl = 100 KHz" } Block { BlockType Reference Name "I2C Bus Master1" Tag "dsPIC_I2C_Master" Ports [2] Position [1305, 591, 1430, 649] List { ListType RTWdata NbrInput8Data "2" NbrOutput8Data "0" LengthListeCmdI2C "6" NumI2C "1" Enable "1" Adress10Bits "0" I2CBusFreq " 363" SlewRate "0" Disable "0" WaitAfterEnable "3" SMBUSThreshold "0" OutputErrorFlag "0" Initialisation "2" } SourceBlock "dsPICdrivers/BUS I2C/I2C Bus Master" SourceType "I2C Master" NumI2C "1" Sequence "'S A024 W016 W W P' " InitializeOnceOnly "When I2C bus is enable (if Enable I2C is checked)" Enable on WaitAfterEnable "3" Disable off AdressNbrBits "7 bits" I2CBusFreq " 363" SlewRate off SMBUSThreshold off OutputErrorFlag off SampleTime "-1" OrderingInOutPopup "None" Info "Fscl = 100 KHz" } Block { BlockType Reference Name "I2C Bus Master2" Tag "dsPIC_I2C_Master" Ports [] Position [20, 676, 145, 734] List { ListType RTWdata NbrInput8Data "0" NbrOutput8Data "0" LengthListeCmdI2C "6" NumI2C "1" Enable "1" Adress10Bits "0" I2CBusFreq " 363" SlewRate "0" Disable "0" WaitAfterEnable "3" SMBUSThreshold "0" OutputErrorFlag "0" Initialisation "1" } SourceBlock "dsPICdrivers/BUS I2C/I2C Bus Master" SourceType "I2C Master" NumI2C "1" Sequence "'S A024 W048 W000 W003P' " InitializeOnceOnly "When PIC is initialized (only once)" Enable on WaitAfterEnable "3" Disable off AdressNbrBits "7 bits" I2CBusFreq " 363" SlewRate off SMBUSThreshold off OutputErrorFlag off SampleTime "-1" OrderingInOutPopup "None" Info "Fscl = 100 KHz" } Block { BlockType Reference Name "Initialization" Tag "dsPIC_dsPIC_CFunctionCall" Ports [] Position [380, 93, 475, 127] BackgroundColor "lightBlue" List { ListType RTWdata FctDeclaration "extern void Initialization();" FctCall "Initialization();" fctName "Initialization" INPUT_SIZE "1" OUTPUT_SIZE "1" NBR_INPUT "0" NBR_OUTPUT "0" } SourceBlock "dsPICdrivers/OTHERS/C Function Call" SourceType "C Function Call" fctName "'Initialization'" INPUT_SIZE "1" INPUT1 "--" INPUT2 "--" INPUT3 "--" OUTPUT_SIZE "1" OUTPUT1 "--" SampleTime "inf" InputType "[ ]" OutputType "[ ]" FctDeclaration "extern void Initialization();" FctCall "Initialization();" OrderingInOutPopup "None" } Block { BlockType Reference Name "Mask/Filter configuration" Tag "dsPIC_dsPIC_CFunctionCall" Ports [3] Position [745, 67, 845, 303] BackgroundColor "lightBlue" List { ListType RTWdata FctDeclaration "extern void Configuration(uint32_T u1, uint32_T u2, uint32_T u3);" FctCall "Configuration(%u1, %u2, %u3);" fctName "Configuration" INPUT_SIZE "1" OUTPUT_SIZE "1" NBR_INPUT "3" NBR_OUTPUT "0" } SourceBlock "dsPICdrivers/OTHERS/C Function Call" SourceType "C Function Call" fctName "'Configuration'" INPUT_SIZE "1" INPUT1 "uint32" INPUT2 "uint32" INPUT3 "uint32" OUTPUT_SIZE "1" OUTPUT1 "--" SampleTime "inf" InputType "[ 6 6 6 ]" OutputType "[ ]" FctDeclaration "extern void Configuration(uint32_T u1, uint32_T u2, uint32_T u3);" FctCall "Configuration(%u1, %u2, %u3);" OrderingInOutPopup "None" } Block { BlockType Constant Name "Mask2" Position [500, 201, 565, 219] Value "2047" OutDataTypeMode "uint32" OutDataType "sfix(16)" OutScaling "2^0" } Block { BlockType Constant Name "Mask3" Position [500, 281, 565, 299] Value "2047" OutDataTypeMode "uint32" OutDataType "sfix(16)" OutScaling "2^0" } Block { BlockType Reference Name "Master" Tag "dsPIC_MASTER" Ports [] Position [20, 87, 129, 138] BackgroundColor "lightBlue" Priority "1" List { ListType RTWdata NumBusyPort "-1" } SourceBlock "dsPICdrivers/Master" SourceType "Master" TimeStepType "Timer1" picType "33fJ256MC710" fcy "40000000" Quartz_33f "8e6" PLLActive_33f on fcyDesired_33f "40000000" tmr1 "[1 39999 0]" tmr1Info "Time Step : 0.001 ; Error : 0% PR1=39999" tmr2345 "[0 0 0 0 0 0 0 0]" tmr2345cfg "[-1 -1 -1 -1 -1 -1 -1 -1]" IOautoConf on typePort "[ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4 5 0 0 0 0 0 0 0 0 0 0 0 0 20 20 0 0 0 0 0 0 0 0 0 0 0 0 ]" TRIS "[ 65535 65535 65535 65535 65535 65535 65535 ]" ADPCFG "0" MasterBusyPort "None" MasterOverloadPort "None" FOSC "Quartz (XT - HS)" ClockSwitchMonitor "Both disabled" TempProtection_33f "TEMP_ON" FPBOR "" PWRT "disable" MCLR "" PowerSave off OverrideFcy off NewFcy "1e6" PR2345 "[65535 65535 65535 65535 65535 65535 65535 65535]" } Block { BlockType SubSystem Name "Motor\n Quadrature Incremental Encoder\n to screw \nvalue ROLL" Ports [0, 1] Position [300, 640, 370, 690] BackgroundColor "[0.501961, 0.501961, 1.000000]" MinAlgLoopOccurrences off RTWSystemCode "Auto" FunctionWithSeparateData off System { Name "Motor\n Quadrature Incremental Encoder\n to screw \nvalue ROLL" Location [2, 80, 1422, 871] Open off ModelBrowserVisibility off ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "landscape" PaperPositionMode "auto" PaperType "usletter" PaperUnits "inches" TiledPaperMargins [0.500000, 0.500000, 0.500000, 0.500000] TiledPageScale 1 ShowPageBoundaries off ZoomFactor "100" Block { BlockType Gain Name "Convert Encoder to Revs" Position [495, 242, 620, 278] Gain "1/(360*2)" ParameterDataTypeMode "Inherit via internal rule" ParameterDataType "sfix(16)" ParameterScaling "2^0" OutDataTypeMode "Inherit via internal rule" OutDataType "sfix(16)" OutScaling "2^0" SaturateOnIntegerOverflow off } Block { BlockType Reference Name "Encoder Count" Tag "dsPIC_dsPIC_CFunctionCall" Ports [0, 1] Position [225, 240, 350, 280] List { ListType RTWdata FctDeclaration "extern real32_T GetQEI();" FctCall "%y1 = GetQEI();" fctName "GetQEI" INPUT_SIZE "1" OUTPUT_SIZE "1" NBR_INPUT "0" NBR_OUTPUT "1" } SourceBlock "dsPICdrivers/OTHERS/C Function Call" SourceType "C Function Call" fctName "'GetQEI'" INPUT_SIZE "1" INPUT1 "--" INPUT2 "--" INPUT3 "--" OUTPUT_SIZE "1" OUTPUT1 "real32" SampleTime ".001" InputType "[ ]" OutputType "[ 7 ]" FctDeclaration "extern real32_T GetQEI();" FctCall "%y1 = GetQEI();" OrderingInOutPopup "None" } Block { BlockType Gain Name "Gain" Position [695, 245, 725, 275] Gain "-1" ParameterDataTypeMode "Inherit via internal rule" ParameterDataType "sfix(16)" ParameterScaling "2^0" OutDataTypeMode "Inherit via internal rule" OutDataType "sfix(16)" OutScaling "2^0" SaturateOnIntegerOverflow off } Block { BlockType Outport Name "ROLL" Position [935, 253, 965, 267] IconDisplay "Port number" OutDataType "sfix(16)" OutScaling "2^0" } Line { SrcBlock "Encoder Count" SrcPort 1 DstBlock "Convert Encoder to Revs" DstPort 1 } Line { SrcBlock "Convert Encoder to Revs" SrcPort 1 DstBlock "Gain" DstPort 1 } Line { SrcBlock "Gain" SrcPort 1 DstBlock "ROLL" DstPort 1 } Annotation { Position [147, 38] } Annotation { Position [133, 31] } } } Block { BlockType Gain Name "PD just Gain1" Position [610, 596, 680, 644] Gain "1.5" ParameterDataTypeMode "Inherit via internal rule" ParameterDataType "sfix(16)" ParameterScaling "2^0" OutDataTypeMode "Inherit via internal rule" OutDataType "sfix(16)" OutScaling "2^0" SaturateOnIntegerOverflow off } Block { BlockType Reference Name "Quadrature Encoder Initialization" Tag "dsPIC_dsPIC_CFunctionCall" Ports [] Position [875, 75, 1000, 115] BackgroundColor "[0.501961, 0.501961, 1.000000]" List { ListType RTWdata FctDeclaration "extern void QEIInit();" FctCall "QEIInit();" fctName "QEIInit" INPUT_SIZE "1" OUTPUT_SIZE "1" NBR_INPUT "0" NBR_OUTPUT "0" } SourceBlock "dsPICdrivers/OTHERS/C Function Call" SourceType "C Function Call" fctName "'QEIInit'" INPUT_SIZE "1" INPUT1 "--" INPUT2 "--" INPUT3 "--" OUTPUT_SIZE "1" OUTPUT1 "--" SampleTime "inf" InputType "[ ]" OutputType "[ ]" FctDeclaration "extern void QEIInit();" FctCall "QEIInit();" OrderingInOutPopup "None" } Block { BlockType Reference Name "Reception" Tag "dsPIC_dsPIC_CFunctionCall" Ports [0, 1] Position [20, 393, 115, 427] BackgroundColor "lightBlue" List { ListType RTWdata FctDeclaration "extern uint32_T Reception();" FctCall "%y1 = Reception();" fctName "Reception" INPUT_SIZE "1" OUTPUT_SIZE "1" NBR_INPUT "0" NBR_OUTPUT "1" } SourceBlock "dsPICdrivers/OTHERS/C Function Call" SourceType "C Function Call" fctName "'Reception'" INPUT_SIZE "1" INPUT1 "--" INPUT2 "--" INPUT3 "--" OUTPUT_SIZE "1" OUTPUT1 "uint32" SampleTime "0.001" InputType "[ ]" OutputType "[ 6 ]" FctDeclaration "extern uint32_T Reception();" FctCall "%y1 = Reception();" OrderingInOutPopup "None" } Block { BlockType Saturate Name "Saturation" Position [850, 605, 880, 635] UpperLimit "4095" LowerLimit "0" OutDataType "sfix(16)" OutScaling "2^0" } Block { BlockType Scope Name "Scope1" Ports [2] Position [1290, 501, 1320, 534] Floating off Location [520, 282, 1356, 827] Open off NumInputPorts "2" ZoomMode "xonly" List { ListType AxesTitles axes1 "%" axes2 "%" } YMin "-5~-5" YMax "5~5" DataFormat "StructureWithTime" MaxDataPoints "50000" SampleInput on } Block { BlockType SubSystem Name "Subsystem1" Ports [2, 1] Position [620, 83, 675, 127] MinAlgLoopOccurrences off RTWSystemCode "Auto" FunctionWithSeparateData off System { Name "Subsystem1" Location [433, 403, 931, 703] Open off ModelBrowserVisibility off ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "landscape" PaperPositionMode "auto" PaperType "usletter" PaperUnits "inches" TiledPaperMargins [0.500000, 0.500000, 0.500000, 0.500000] TiledPageScale 1 ShowPageBoundaries off ZoomFactor "100" Block { BlockType Inport Name "Filter" Position [55, 173, 85, 187] IconDisplay "Port number" OutDataType "sfix(16)" OutScaling "2^0" } Block { BlockType Inport Name "Mask" Position [55, 228, 85, 242] Port "2" IconDisplay "Port number" OutDataType "sfix(16)" OutScaling "2^0" } Block { BlockType Reference Name "Shift\nArithmetic1" Ports [1, 1] Position [155, 160, 235, 200] FontSize 8 SourceBlock "simulink/Logic and Bit\nOperations/Shift\nArithmetic" SourceType "Shift Arithmetic" ShowPortLabels "FromPortIcon" SystemSampleTime "-1" FunctionWithSeparateData off RTWMemSecFuncInitTerm "Inherit from model" RTWMemSecFuncExecute "Inherit from model" RTWMemSecDataConstants "Inherit from model" RTWMemSecDataInternal "Inherit from model" RTWMemSecDataParameters "Inherit from model" nBitShiftRight "-16" nBinPtShiftRight "0" } Block { BlockType Sum Name "Sum1" Ports [2, 1] Position [300, 170, 320, 190] ShowName off IconShape "round" Inputs "|++" CollapseMode "All dimensions" InputSameDT off OutDataTypeMode "Inherit via internal rule" OutDataType "sfix(16)" OutScaling "2^0" SaturateOnIntegerOverflow off } Block { BlockType Outport Name "Out1" Position [365, 173, 395, 187] IconDisplay "Port number" OutDataType "sfix(16)" OutScaling "2^0" } Line { SrcBlock "Sum1" SrcPort 1 DstBlock "Out1" DstPort 1 } Line { SrcBlock "Mask" SrcPort 1 Points [220, 0] DstBlock "Sum1" DstPort 2 } Line { SrcBlock "Filter" SrcPort 1 DstBlock "Shift\nArithmetic1" DstPort 1 } Line { SrcBlock "Shift\nArithmetic1" SrcPort 1 DstBlock "Sum1" DstPort 1 } } } Block { BlockType SubSystem Name "Subsystem2" Ports [2, 1] Position [620, 164, 675, 206] MinAlgLoopOccurrences off RTWSystemCode "Auto" FunctionWithSeparateData off System { Name "Subsystem2" Location [433, 403, 931, 703] Open off ModelBrowserVisibility off ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "landscape" PaperPositionMode "auto" PaperType "usletter" PaperUnits "inches" TiledPaperMargins [0.500000, 0.500000, 0.500000, 0.500000] TiledPageScale 1 ShowPageBoundaries off ZoomFactor "100" Block { BlockType Inport Name "Filter" Position [55, 173, 85, 187] IconDisplay "Port number" OutDataType "sfix(16)" OutScaling "2^0" } Block { BlockType Inport Name "Mask" Position [55, 228, 85, 242] Port "2" IconDisplay "Port number" OutDataType "sfix(16)" OutScaling "2^0" } Block { BlockType Reference Name "Shift\nArithmetic1" Ports [1, 1] Position [155, 160, 235, 200] FontSize 8 SourceBlock "simulink/Logic and Bit\nOperations/Shift\nArithmetic" SourceType "Shift Arithmetic" ShowPortLabels "FromPortIcon" SystemSampleTime "-1" FunctionWithSeparateData off RTWMemSecFuncInitTerm "Inherit from model" RTWMemSecFuncExecute "Inherit from model" RTWMemSecDataConstants "Inherit from model" RTWMemSecDataInternal "Inherit from model" RTWMemSecDataParameters "Inherit from model" nBitShiftRight "-16" nBinPtShiftRight "0" } Block { BlockType Sum Name "Sum1" Ports [2, 1] Position [300, 170, 320, 190] ShowName off IconShape "round" Inputs "|++" CollapseMode "All dimensions" InputSameDT off OutDataTypeMode "Inherit via internal rule" OutDataType "sfix(16)" OutScaling "2^0" SaturateOnIntegerOverflow off } Block { BlockType Outport Name "Out1" Position [365, 173, 395, 187] IconDisplay "Port number" OutDataType "sfix(16)" OutScaling "2^0" } Line { SrcBlock "Shift\nArithmetic1" SrcPort 1 DstBlock "Sum1" DstPort 1 } Line { SrcBlock "Filter" SrcPort 1 DstBlock "Shift\nArithmetic1" DstPort 1 } Line { SrcBlock "Mask" SrcPort 1 Points [220, 0] DstBlock "Sum1" DstPort 2 } Line { SrcBlock "Sum1" SrcPort 1 DstBlock "Out1" DstPort 1 } } } Block { BlockType SubSystem Name "Subsystem3" Ports [2, 1] Position [620, 243, 675, 287] MinAlgLoopOccurrences off RTWSystemCode "Auto" FunctionWithSeparateData off System { Name "Subsystem3" Location [433, 403, 931, 703] Open off ModelBrowserVisibility off ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "landscape" PaperPositionMode "auto" PaperType "usletter" PaperUnits "inches" TiledPaperMargins [0.500000, 0.500000, 0.500000, 0.500000] TiledPageScale 1 ShowPageBoundaries off ZoomFactor "100" Block { BlockType Inport Name "Filter" Position [55, 173, 85, 187] IconDisplay "Port number" OutDataType "sfix(16)" OutScaling "2^0" } Block { BlockType Inport Name "Mask" Position [55, 228, 85, 242] Port "2" IconDisplay "Port number" OutDataType "sfix(16)" OutScaling "2^0" } Block { BlockType Reference Name "Shift\nArithmetic1" Ports [1, 1] Position [155, 160, 235, 200] FontSize 8 SourceBlock "simulink/Logic and Bit\nOperations/Shift\nArithmetic" SourceType "Shift Arithmetic" ShowPortLabels "FromPortIcon" SystemSampleTime "-1" FunctionWithSeparateData off RTWMemSecFuncInitTerm "Inherit from model" RTWMemSecFuncExecute "Inherit from model" RTWMemSecDataConstants "Inherit from model" RTWMemSecDataInternal "Inherit from model" RTWMemSecDataParameters "Inherit from model" nBitShiftRight "-16" nBinPtShiftRight "0" } Block { BlockType Sum Name "Sum1" Ports [2, 1] Position [300, 170, 320, 190] ShowName off IconShape "round" Inputs "|++" CollapseMode "All dimensions" InputSameDT off OutDataTypeMode "Inherit via internal rule" OutDataType "sfix(16)" OutScaling "2^0" SaturateOnIntegerOverflow off } Block { BlockType Outport Name "Out1" Position [365, 173, 395, 187] IconDisplay "Port number" OutDataType "sfix(16)" OutScaling "2^0" } Line { SrcBlock "Sum1" SrcPort 1 DstBlock "Out1" DstPort 1 } Line { SrcBlock "Mask" SrcPort 1 Points [220, 0] DstBlock "Sum1" DstPort 2 } Line { SrcBlock "Filter" SrcPort 1 DstBlock "Shift\nArithmetic1" DstPort 1 } Line { SrcBlock "Shift\nArithmetic1" SrcPort 1 DstBlock "Sum1" DstPort 1 } } } Block { BlockType Sum Name "Sum" Ports [2, 1] Position [530, 610, 550, 630] ShowName off IconShape "round" Inputs "|+-" CollapseMode "All dimensions" InputSameDT off OutDataTypeMode "double" OutDataType "sfix(16)" OutScaling "2^0" SaturateOnIntegerOverflow off } Block { BlockType Sum Name "Sum1" Ports [2, 1] Position [700, 610, 720, 630] ShowName off IconShape "round" Inputs "|++" CollapseMode "All dimensions" InputSameDT off OutDataTypeMode "double" OutDataType "sfix(16)" OutScaling "2^0" SaturateOnIntegerOverflow off } Block { BlockType Sum Name "Sum2" Ports [2, 1] Position [405, 485, 425, 505] ShowName off IconShape "round" Inputs "|+-" CollapseMode "All dimensions" InputSameDT off OutDataTypeMode "double" OutDataType "sfix(16)" OutScaling "2^0" SaturateOnIntegerOverflow off } Block { BlockType Reference Name "TX Output Multiplexed\nfor Matlab / Labview1" Tag "dsPIC_TX_Multiplexed" Ports [1] Position [470, 374, 610, 416] Priority "5" SourceBlock "dsPICdrivers/Serial PORT/TX Output Multiplexed\nfor Matlab // Labview" SourceType "send structured data frame to Matlab / Labview" UART "2" CleverSpreadingChk on CleverSpreading "1" CHANNEL "[0]" CHANNELBLOCKED "[]" CHANNELBLOCKED_BITEWISE "0" Status "OK" } Block { BlockType SubSystem Name "Triggered\nSubsystem" Ports [1, 1, 0, 1] Position [320, 866, 455, 924] TreatAsAtomicUnit on MinAlgLoopOccurrences off RTWSystemCode "Auto" FunctionWithSeparateData off System { Name "Triggered\nSubsystem" Location [401, 346, 899, 646] Open off ModelBrowserVisibility off ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "landscape" PaperPositionMode "auto" PaperType "usletter" PaperUnits "inches" TiledPaperMargins [0.500000, 0.500000, 0.500000, 0.500000] TiledPageScale 1 ShowPageBoundaries off ZoomFactor "100" Block { BlockType Inport Name "In1" Position [110, 103, 140, 117] IconDisplay "Port number" OutDataType "sfix(16)" OutScaling "2^0" } Block { BlockType TriggerPort Name "Trigger" Ports [] Position [225, 20, 245, 40] StatesWhenEnabling "held" } Block { BlockType Outport Name "Out1" Position [360, 103, 390, 117] IconDisplay "Port number" OutDataType "sfix(16)" OutScaling "2^0" } Line { SrcBlock "In1" SrcPort 1 DstBlock "Out1" DstPort 1 } } } Block { BlockType Reference Name "UART Configuration" Tag "dsPIC_config_UART" Ports [] Position [135, 88, 235, 138] BackgroundColor "lightBlue" DropShadow on Priority "2" List { ListType RTWdata RxBufferSize "32" } SourceBlock "dsPICdrivers/Serial PORT/UART Configuration" SourceType "Configure UART" UART "2" proposed_BAUD "115200" ALT_TX_RX on InterruptTxWhen "When Transmit Buffer is empty" TXInterruptPri "1" TxBufferSize "32" TXEN on InterruptRxWhen "When Receive Buffer is full (contain 4 characters)" RXInterruptPri "2" RxBufferSize "32" BAUD "115200" UxBRG "21" Info "UxBRG = 21 || Real Baud : 113636 || % error : -1.3573 || max 11.3636 Bytes / Step" RealBaud "0" } Block { BlockType DataStoreMemory Name "Variable" Position [1165, 80, 1222, 109] BackgroundColor "[0.501961, 0.501961, 1.000000]" DataStoreName "boucle" ReadBeforeWriteMsg "warning" WriteAfterWriteMsg "warning" WriteAfterReadMsg "warning" RTWStateStorageClass "ExportedGlobal" VectorParams1D on DataType "uint8" OutDataType "sfix(16)" OutScaling "2^0" } Block { BlockType DataStoreMemory Name "Variable unit roll on QEI" Position [1060, 80, 1117, 109] BackgroundColor "[0.501961, 0.501961, 1.000000]" DataStoreName "ct_turns" ReadBeforeWriteMsg "warning" WriteAfterWriteMsg "warning" WriteAfterReadMsg "warning" RTWStateStorageClass "ExportedGlobal" VectorParams1D on DataType "int16" OutDataType "sfix(16)" OutScaling "2^0" } Block { BlockType Reference Name "dbl-click to open\nGraphical interface" Ports [] Position [260, 88, 360, 138] BackgroundColor "cyan" DropShadow on SourceBlock "dsPICdrivers/Serial PORT/dbl-click to open\nGraphical interface" SourceType "" ShowPortLabels "FromPortIcon" SystemSampleTime "-1" FunctionWithSeparateData off RTWMemSecFuncInitTerm "Inherit from model" RTWMemSecFuncExecute "Inherit from model" RTWMemSecDataConstants "Inherit from model" RTWMemSecDataInternal "Inherit from model" RTWMemSecDataParameters "Inherit from model" Nothing "0" } Block { BlockType Constant Name "Constant1" Position [40, 95, 70, 125] IOType "siggen" OutDataType "sfix(16)" OutScaling "2^0" } Block { BlockType Constant Name "Constant2" Position [40, 95, 70, 125] IOType "siggen" Value "12" OutDataTypeMode "uint32" OutDataType "sfix(16)" OutScaling "2^0" } Line { SrcBlock "Reception" SrcPort 1 DstBlock "Extract data" DstPort 1 } Line { SrcBlock "Subsystem1" SrcPort 1 DstBlock "Mask/Filter configuration" DstPort 1 } Line { SrcBlock "Filter1" SrcPort 1 DstBlock "Subsystem1" DstPort 1 } Line { SrcBlock "Data2" SrcPort 1 Points [0, -15] DstBlock "Subsystem1" DstPort 2 } Line { SrcBlock "Subsystem2" SrcPort 1 DstBlock "Mask/Filter configuration" DstPort 2 } Line { SrcBlock "Subsystem3" SrcPort 1 DstBlock "Mask/Filter configuration" DstPort 3 } Line { SrcBlock "Filter2" SrcPort 1 DstBlock "Subsystem2" DstPort 1 } Line { SrcBlock "Mask2" SrcPort 1 Points [0, -15] DstBlock "Subsystem2" DstPort 2 } Line { SrcBlock "Filter3" SrcPort 1 DstBlock "Subsystem3" DstPort 1 } Line { SrcBlock "Mask3" SrcPort 1 Points [0, -15] DstBlock "Subsystem3" DstPort 2 } Line { SrcBlock "Extract data" SrcPort 1 Points [20, 0; 0, 100; 30, 0] Branch { DstBlock "Gain1" DstPort 1 } Branch { Points [-30, 0; 0, -100] DstBlock "Data Type Conversion6" DstPort 1 } } Line { SrcBlock "Embedded\nMATLAB Function" SrcPort 1 DstBlock "Data Type Conversion1" DstPort 1 } Line { SrcBlock "Data Type Conversion1" SrcPort 1 Points [10, 0] Branch { Points [0, -95] DstBlock "Scope1" DstPort 1 } Branch { DstBlock "I2C Bus Master1" DstPort 1 } } Line { SrcBlock "Embedded\nMATLAB Function" SrcPort 2 Points [10, 0; 0, 70] DstBlock "Data Type Conversion2" DstPort 1 } Line { SrcBlock "Data Type Conversion2" SrcPort 1 Points [40, 0; 0, -45] Branch { Labels [2, 0] Points [-15, 0] DstBlock "Scope1" DstPort 2 } Branch { DstBlock "I2C Bus Master1" DstPort 2 } } Line { SrcBlock "Motor\n Quadrature Incremental Encoder\n to screw \nvalue ROLL" SrcPort 1 DstBlock "Data Type Conversion5" DstPort 1 } Line { SrcBlock "Data Type Conversion3" SrcPort 1 DstBlock "Embedded\nMATLAB Function" DstPort 1 } Line { SrcBlock "Data Type Conversion5" SrcPort 1 Points [35, 0] DstBlock "Sum" DstPort 2 } Line { SrcBlock "Sum1" SrcPort 1 DstBlock "Gain" DstPort 1 } Line { SrcBlock "PD just Gain1" SrcPort 1 DstBlock "Sum1" DstPort 1 } Line { SrcBlock "Constant4" SrcPort 1 Points [20, 0] DstBlock "Sum1" DstPort 2 } Line { SrcBlock "Saturation" SrcPort 1 DstBlock "Data Type Conversion3" DstPort 1 } Line { SrcBlock "Data Type Conversion6" SrcPort 1 DstBlock "TX Output Multiplexed\nfor Matlab / Labview1" DstPort 1 } Line { SrcBlock "Gain" SrcPort 1 DstBlock "Saturation" DstPort 1 } Line { SrcBlock "Sum" SrcPort 1 DstBlock "PD just Gain1" DstPort 1 } Line { SrcBlock "Gain1" SrcPort 1 DstBlock "Sum2" DstPort 1 } Line { SrcBlock "Constant3" SrcPort 1 Points [35, 0] DstBlock "Sum2" DstPort 2 } Line { SrcBlock "Sum2" SrcPort 1 Points [40, 0; 0, 125] DstBlock "Sum" DstPort 1 } Annotation { Name "RECEPTION" Position [56, 373] BackgroundColor "yellow" DropShadow on TeXMode "on" } Annotation { Name "INITIALIZATION" Position [61, 58] BackgroundColor "magenta" DropShadow on TeXMode "on" } } } # Finite State Machines # # Stateflow Version 6.7 (R2007b) dated Aug 7 2007, 16:48:14 # # Stateflow { machine { id 1 name "ecan2essai" created "04-Sep-2009 14:19:52" isLibrary 0 firstTarget 10 sfVersion 67014000.000001 } chart { id 2 name "Embedded\nMATLAB Function" windowPosition [332.039 338.766 200.25 189.75] viewLimits [0 156.75 0 153.75] screen [1 1 1600 1200 1.333333333333333] treeNode [0 3 0 0] firstTransition 5 firstJunction 4 viewObj 2 machine 1 decomposition CLUSTER_CHART type EML_CHART firstData 6 chartFileNumber 2 disableImplicitCasting 1 eml { name "fcn" } } state { id 3 labelString "eML_blk_kernel()" position [18 64.5 118 66] fontSize 12 chart 2 treeNode [2 0 0 0] superState SUBCHART subviewer 2 type FUNC_STATE decomposition CLUSTER_STATE eml { isEML 1 script "function [w1,w2] = fcn(u)\n\n% Funktion to send the right value to the I²C block\n% input: u, a signal from 0 - 4095 \n% output: w1 for the MSB\n% w2 for the LSB \n\n\n\n\nw2_1 = bitshift(u,12,16);\n\nw2 = bitshift(w2_1,-8,16);\n\n\nw1 = bitshift(u,-4,16);\n\nend\n\n" editorLayout "100 M4x1[502 59 835 507]" } } junction { id 4 position [23.5747 49.5747 7] chart 2 linkNode [2 0 0] subviewer 2 type CONNECTIVE_JUNCTION } transition { id 5 labelString "{eML_blk_kernel();}" labelPosition [32.125 19.875 102.544 14.964] fontSize 12 src { intersection [0 0 1 0 23.5747 14.625 0 0] } dst { id 4 intersection [7 0 -1 -1 23.5747 42.5747 0 0] } midPoint [23.5747 24.9468] chart 2 linkNode [2 0 0] dataLimits [23.575 23.575 14.625 34.575] subviewer 2 drawStyle SMART executionOrder 1 } data { id 6 name "u" linkNode [2 0 7] scope INPUT_DATA machine 1 props { array { size "-1" } type { method SF_INHERITED_TYPE } complexity SF_COMPLEX_INHERITED } dataType "inherited" fixptType { slope 1 baseType SF_INT16_TYPE } complexity SF_COMPLEX_INHERITED } data { id 7 name "w1" linkNode [2 6 8] scope OUTPUT_DATA machine 1 props { array { size "-1" } type { method SF_INHERITED_TYPE } complexity SF_COMPLEX_INHERITED frame SF_FRAME_NO } dataType "inherited" fixptType { slope 1 baseType SF_INT16_TYPE } complexity SF_COMPLEX_INHERITED } data { id 8 name "w2" linkNode [2 7 0] scope OUTPUT_DATA machine 1 props { array { size "-1" } type { method SF_INHERITED_TYPE primitive SF_DOUBLE_TYPE isSigned 1 wordLength "16" } complexity SF_COMPLEX_INHERITED frame SF_FRAME_NO } dataType "inherited" complexity SF_COMPLEX_INHERITED } instance { id 9 name "Embedded\nMATLAB Function" machine 1 chart 2 } target { id 10 name "sfun" description "Default Simulink S-Function Target." machine 1 linkNode [1 0 11] } target { id 11 name "rtw" codeFlags " comments=1 statebitsets=1 databitsets=1 emitlogicalops=1 elseifdetection=1 constantfolding=1 redundantloadelimination=0 preservenames=0 preservenameswithparent=0 exportcharts=0" machine 1 linkNode [1 10 0] } }