Model { Name "Trust_twoEngineAircraft" Version 6.6 MdlSubVersion 0 GraphicalInterface { NumRootInports 0 NumRootOutports 0 ParameterArgumentNames "" ComputedModelVersion "1.28" NumModelReferences 0 NumTestPointedSignals 0 } SavedCharacterEncoding "windows-1252" SaveDefaultBlockParams on SampleTimeColors on LibraryLinkDisplay "none" WideLines off ShowLineDimensions off ShowPortDataTypes on 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 CloseFcn "rtwprivate ssgencode ModelCloseRequest dspic_model" Created "Thu Dec 20 11:36:08 2007" Creator "Lubin" UpdateHistory "UpdateHistoryNever" ModifiedByFormat "%" LastModifiedBy "Lubin" ModifiedDateFormat "%" LastModifiedDate "Fri Dec 28 22:59:36 2007" ModelVersionFormat "1.%" ConfigurationManager "None" SimulationMode "normal" LinearizationMsg "none" Profile off ParamWorkspaceSource "MATLABWorkspace" AccelSystemTargetFile "accel.tlc" AccelTemplateMakefile "accel_default_tmf" AccelMakeCommand "make_rtw" AccelVerboseBuild off 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 off ProdHWDeviceType "16-bit Generic" ShowModelReferenceBlockVersion off ShowModelReferenceBlockIO off Array { Type "Handle" Dimension 1 Simulink.ConfigSet { $ObjectID 1 Version "1.2.0" Array { Type "Handle" Dimension 7 Simulink.SolverCC { $ObjectID 2 Version "1.2.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.2.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.2.0" BlockReduction off BooleanDataType on ConditionallyExecuteInputs on InlineParams on InlineInvariantSignals off OptimizeBlockIOStorage off BufferReuse off EnforceIntegerDowncast off ExpressionFolding off ExpressionDepthLimit 2147483647 FoldNonRolledExpr on LocalBlockOutputs off 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 } Simulink.DebuggingCC { $ObjectID 5 Version "1.2.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 "TryResolveAllWithWarning" BlockPriorityViolationMsg "warning" MinStepSizeMsg "warning" TimeAdjustmentMsg "none" MaxConsecutiveZCsMsg "error" SolverPrmCheckMsg "warning" InheritedTsInSrcMsg "warning" DiscreteInheritContinuousMsg "warning" MultiTaskDSMMsg "warning" MultiTaskCondExecSysMsg "none" 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" } Simulink.HardwareCC { $ObjectID 6 Array { Type "Cell" Dimension 2 Cell "ProdHWDeviceType" Cell "ProdEqTarget" PropName "DisabledProps" } Version "1.2.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.2.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.2.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-t" "ime)" GenerateReport off 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 IncludeHyperlinkInReport off LaunchReport off TargetLang "C" IncludeBusHierarchyInRTWFileBlockHierarchyMap off IncludeERTFirstTime off Array { Type "Handle" Dimension 2 Simulink.CodeAppCC { $ObjectID 9 Version "1.2.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 PrefixModelToSubsysFcnNames on 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.2.0" TargetFcnLib "ansi_tfl_tmw.mat" TargetLibSuffix "" TargetPreCompLibLocation "" GenFloatMathFcnCalls "ANSI_C" UtilityFuncGeneration "Auto" GenerateFullHeader on GenerateSampleERTMain off GenerateTestInterfaces off IsPILTarget off ModelReferenceCompliant 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 on 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.2.0" TargetFcnLib "ansi_tfl_tmw.mat" TargetLibSuffix "" TargetPreCompLibLocation "" GenFloatMathFcnCalls "ANSI_C" UtilityFuncGeneration "Auto" GenerateFullHeader on GenerateSampleERTMain off GenerateTestInterfaces off IsPILTarget off ModelReferenceCompliant 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 on 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 "Unspecified" SignalDisplayLevel 10 ParamTuneLevel 10 GlobalDataDefinition "Auto" DataDefinitionFile "global.c" GlobalDataReference "Auto" DataReferenceFile "global.h" GRTInterface off PreserveExpressionOrder off PreserveIfCondition off EnableUserReplacementTypes off 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\\R2006a\\rtw\\bi" "n\\win32\\gmake" } CustomProperty { DataType "string" Name "OPTIM_GCC" Value "-mcpu=30F3011 -O3 -fschedule-insns -f" "schedule-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\\gld\\p30f3011.gld" } CustomProperty { DataType "string" Name "LDLIBPIC" Value "C:\\PROGRA~1\\MICROC~1\\MPLABC~1\\lib" "\\libpic30-coff.a C:\\PROGRA~1\\MICROC~1\\MPLABC~1\\lib\\libp30F3011-coff.a " "C:\\PROGRA~1\\MICROC~1\\MPLABC~1\\lib\\libc-coff.a C:\\PROGRA~1\\MICROC~1\\MP" "LABC~1\\lib\\libm-coff.a" } CustomProperty { DataType "string" Name "PIC_INCLUDES" Value "-IC:\\PROGRA~1\\MICROC~1\\MPLABC~1\\i" "nclude" } CustomProperty { DataType "string" Name "PIC_REF" Value "30f3011" } } PropName "Components" } } PropName "Components" } Name "Configuration" CurrentDlgPage "Optimization" } 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 DataTypeConversion OutDataTypeMode "Inherit via back propagation" OutDataType "sfix(16)" OutScaling "2^0" LockScale off ConvertRealWorld "Real World Value (RWV)" RndMeth "Zero" SaturateOnIntegerOverflow on SampleTime "-1" } Block { BlockType DiscreteTransferFcn Numerator "[1]" Denominator "[1 0.5]" SampleTime "1" StateMustResolveToSignalObject off RTWStateStorageClass "Auto" Realization "auto" } Block { BlockType From IconDisplay "Tag" } 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 Goto IconDisplay "Tag" } Block { BlockType GotoTagVisibility GotoTag "A" } Block { BlockType Saturate UpperLimit "0.5" LowerLimit "-0.5" LinearizeAsGain on ZeroCross on 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 OutDataTypeMode "Same as first input" OutDataType "sfix(16)" OutScaling "2^0" LockScale off RndMeth "Floor" SaturateOnIntegerOverflow on SampleTime "-1" } } 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 "Trust_twoEngineAircraft" Location [5, 67, 1017, 712] Open on ModelBrowserVisibility off ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "landscape" PaperPositionMode "auto" PaperType "A4" PaperUnits "centimeters" TiledPaperMargins [0.500000, 0.500000, 0.500000, 0.500000] TiledPageScale 1 ShowPageBoundaries off ZoomFactor "100" ReportName "simulink-default.rpt" Block { BlockType Reference Name "ADC Input" Tag "dsPIC_ADC" Ports [0, 2] Position [15, 170, 100, 270] Priority "5" SourceBlock "dsPICdrivers/Peripheral I//O/ADC Input" SourceType "dsPIC : ADC10" ADC_TYPE "10 bits" ADC_MODE "Continuous sampling & get last channel value" NbrSampleStep "1" VoltRefpopup "AVdd - AVss" OutFormatBitspopup "0000 00dd dddd dddd : Integer" InterruptPriority "6" ANCHANNELS "[0 1]" MaxName "ANmax = 1024" Rin "1e2" ADCS "0" SAMC "1" Temperature "25" SampleTime "0.001" Status "OK | Tsmp=5.000e-007 | T/Channel=6.500e-006 " "| Tall=1.300e-005" Port { PortNumber 1 Name "v_wanted" RTWStorageClass "Auto" DataLoggingNameMode "SignalName" } } Block { BlockType Sum Name "Add" Ports [2, 1] Position [1107, 350, 1138, 380] Orientation "down" NamePlacement "alternate" Inputs "+-" CollapseMode "All dimensions" InputSameDT off OutDataTypeMode "Inherit via internal rule" OutScaling "2^-10" SaturateOnIntegerOverflow off SampleTime "0.001" Port { PortNumber 1 Name "delta_f" RTWStorageClass "Auto" DataLoggingNameMode "SignalName" } } Block { BlockType Sum Name "Add1" Ports [2, 1] Position [995, 427, 1025, 458] Orientation "left" Inputs "-+" CollapseMode "All dimensions" InputSameDT off OutDataTypeMode "Inherit via internal rule" OutScaling "2^-10" SaturateOnIntegerOverflow off SampleTime "0.001" } Block { BlockType Sum Name "Add3" Ports [2, 1] Position [465, 117, 495, 148] InputSameDT off OutDataTypeMode "Inherit via internal rule" OutScaling "2^-10" SaturateOnIntegerOverflow off SampleTime "0.001" } Block { BlockType Sum Name "Add4" Ports [2, 1] Position [455, 232, 485, 263] Inputs "+-" InputSameDT off OutDataTypeMode "Inherit via internal rule" OutScaling "2^-10" SaturateOnIntegerOverflow off SampleTime "0.001" Port { PortNumber 1 Name "n_2" RTWStorageClass "Auto" DataLoggingNameMode "SignalName" } } Block { BlockType Reference Name "Configuration" Ports [] Position [140, 35, 240, 85] BackgroundColor "lightBlue" SourceBlock "dsPICdrivers/Configuration" 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" double64 off } Block { BlockType DataTypeConversion Name "Data Type Conversion2" Position [1033, 175, 1067, 225] Orientation "down" ShowName off OutDataTypeMode "double" RndMeth "Floor" SaturateOnIntegerOverflow off } Block { BlockType DataTypeConversion Name "Data Type Conversion5" Position [540, 118, 615, 152] OutDataTypeMode "uint16" RndMeth "Floor" SaturateOnIntegerOverflow off SampleTime "0.001" } Block { BlockType DataTypeConversion Name "Data Type Conversion6" Position [560, 233, 635, 267] OutDataTypeMode "uint16" RndMeth "Floor" SaturateOnIntegerOverflow off SampleTime "0.001" } Block { BlockType DataTypeConversion Name "Data Type Conversion7" Position [165, 178, 240, 212] OutDataTypeMode "double" RndMeth "Floor" SaturateOnIntegerOverflow off SampleTime "0.001" } Block { BlockType DataTypeConversion Name "Data Type Conversion9" Position [1158, 175, 1192, 225] Orientation "down" ShowName off OutDataTypeMode "double" RndMeth "Floor" SaturateOnIntegerOverflow off } Block { BlockType DiscreteTransferFcn Name "Discrete\nTransfer Fcn3" Position [715, 427, 775, 463] Orientation "left" Numerator "[0.101 -1]" Denominator "[1 -1]" SampleTime "0.001" } Block { BlockType From Name "From" Position [1130, 436, 1220, 464] Orientation "left" NamePlacement "alternate" CloseFcn "tagdialog Close" GotoTag "delta_f_wanted" Port { PortNumber 1 Name "delta_f_wanted" RTWStorageClass "Auto" DataLoggingNameMode "SignalName" } } Block { BlockType Gain Name "Gain" Position [285, 176, 345, 214] Gain "0.0075" ParameterDataTypeMode "Inherit via internal rule" OutDataTypeMode "Inherit via internal rule" SaturateOnIntegerOverflow off SampleTime "0.001" } Block { BlockType Gain Name "Gain2" Position [550, 427, 615, 463] Orientation "left" Gain "1e-4" ParameterDataTypeMode "Inherit via internal rule" OutDataTypeMode "Inherit via internal rule" SaturateOnIntegerOverflow off SampleTime "0.001" } Block { BlockType Goto Name "Goto" Position [140, 230, 245, 260] GotoTag "delta_f_wanted" TagVisibility "local" } Block { BlockType GotoTagVisibility Name "Goto Tag\nVisibility" Position [115, 297, 248, 339] GotoTag "delta_f_wanted" } Block { BlockType Reference Name "Input Capture1" Tag "dsPIC_PWM_IC" Ports [0, 2] Position [935, 96, 1035, 154] NamePlacement "alternate" Priority "5" SourceBlock "dsPICdrivers/Peripheral I//O/Input Capture" SourceType "Input driver for Input Capture Peripheral" IntPriority "7" Channel "[ 1 2 ]" Channel_UP_Down_Periode "[4 4]" MaxChannel "[0.05 0.05]" SafeMarge "[10 10]" MaxName " ' IC1max , IC2max ' " Precision "[15.6096 15.6096]" Timer "[2 2]" ChangeDetected "[0 0]" ChangeDetectedPortRef "3" SampleTime "0.001" Status "OK" Port { PortNumber 1 Name "n_2" RTWStorageClass "Auto" DataLoggingNameMode "SignalName" } } Block { BlockType Reference Name "Lookup\nTable (n-D)1" Ports [2, 1] Position [1037, 245, 1088, 300] Orientation "down" NamePlacement "alternate" SourceBlock "simulink/Lookup\nTables/Lookup\nTable (n-D)" SourceType "LookupNDInterp" numDimsPopupSelect " 2 " bp1 "[3000 3500 4000 4500 5000 5500 6000 6500 7000 7" "500 8000 8500 9000 9500 10000 10500 11000 11500 12000]" bp2 "[0 30]" bp3 "[1:3]" bp4 "[1:3]" bpcell "{ [1:3], [1:3] }" explicitNumDims "2" searchMode "Binary Search" cacheBpFlag off vectorInputFlag off tableData "[1.73 -3;1.91 -3;2.55 -2.5;3.14 -2;3.6 -1.66;4." "06 -1.21;4.6 -0.32;5.68 0.68;6.4 1.68;7.45 2.45;8.68 3.4;9.66 5.29;10.97 6.37" ";11.74 6.85;13.41 7.71;14.77 8.82;16.41 10.08;17.85 11.58;19.54 13.19]" interpMethod "Linear" extrapMethod "Linear" rangeErrorMode "None" } Block { BlockType Reference Name "Lookup\nTable (n-D)2" Ports [2, 1] Position [1162, 250, 1213, 305] Orientation "down" NamePlacement "alternate" SourceBlock "simulink/Lookup\nTables/Lookup\nTable (n-D)" SourceType "LookupNDInterp" numDimsPopupSelect " 2 " bp1 "[3000 3500 4000 4500 5000 5500 6000 6500 7000 7" "500 8000 8500 9000 9500 10000 10500 11000 11500 12000]" bp2 "[0 30]" bp3 "[1:3]" bp4 "[1:3]" bpcell "{ [1:3], [1:3] }" explicitNumDims "2" searchMode "Binary Search" cacheBpFlag off vectorInputFlag off tableData "[1.73 -3;1.91 -3;2.55 -2.5;3.14 -2;3.6 -1.66;4." "06 -1.21;4.6 -0.32;5.68 0.68;6.4 1.68;7.45 2.45;8.68 3.4;9.66 5.29;10.97 6.37" ";11.74 6.85;13.41 7.71;14.77 8.82;16.41 10.08;17.85 11.58;19.54 13.19]" interpMethod "Linear" extrapMethod "Linear" rangeErrorMode "None" } Block { BlockType Reference Name "Master" Tag "dsPIC_MASTER" Ports [] Position [15, 32, 124, 83] BackgroundColor "lightBlue" Priority "1" List { ListType RTWdata NumBusyPort "-1" } SourceBlock "dsPICdrivers/Master" SourceType "Master" TimeStepType "Timer1" picType "30f3011" fcy "1e6" Quartz_33f "5e6" PLLActive_33f off fcyDesired_33f "0" tmr1 "[1 1000 0]" tmr1Info "Time Step : 0.001 ; Error : 0% PR1=1000" tmr2345 "[1 0 0 0]" tmr2345cfg "[-1 -1 -1 -1]" IOautoConf on typePort "[ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 " "0 8 8 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 6 6 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 ]" TRIS "[ 65535 65535 65535 65535 65535 65535 655" "35 ]" ADPCFG "0" MasterBusyPort "None" MasterOverloadPort "None" FOSC "XT" TempProtection_33f "TEMP_ON" FPBOR "PBOR_OFF" PWRT "PWRT_OFF" MCLR "MCLR_DIS" PowerSave off } Block { BlockType Reference Name "PWM Motor Output2" Tag "dsPIC_PWM_motor" Ports [2] Position [740, 139, 900, 266] Priority "5" SourceBlock "dsPICdrivers/Peripheral I//O/PWM Motor Output" SourceType "PWM Motor Output" InputEnableChk off InputPeriodeChk off Channel "[1 2]" TPeriode ".01" PrescalerValue "1" PeriodeInteger "5000" MaxName "'PWM'" Centered on HChannelON off Info "Nbr Bits : 13.2877 || PWM = 10000 || Presca" "ler = 1" Delay "0" IntPriority "5" nbrPwmChannelPIC "3" Status "OK" } Block { BlockType Saturate Name "Saturation" Position [685, 155, 715, 185] UpperLimit "PWM" LowerLimit "0" } Block { BlockType Saturate Name "Saturation1" Position [685, 220, 715, 250] UpperLimit "PWM" LowerLimit "0" } Line { SrcBlock "Discrete\nTransfer Fcn3" SrcPort 1 DstBlock "Gain2" DstPort 1 } Line { Name "delta_f" Labels [1, 0] SrcBlock "Add" SrcPort 1 Points [0, 50] DstBlock "Add1" DstPort 1 } Line { Name "delta_f_wanted" Labels [0, 0] SrcBlock "From" SrcPort 1 DstBlock "Add1" DstPort 2 } Line { SrcBlock "Add1" SrcPort 1 DstBlock "Discrete\nTransfer Fcn3" DstPort 1 } Line { Name "v_wanted" Labels [0, 0] SrcBlock "ADC Input" SrcPort 1 DstBlock "Data Type Conversion7" DstPort 1 } Line { Name "n_2" SrcBlock "Add4" SrcPort 1 DstBlock "Data Type Conversion6" DstPort 1 } Line { SrcBlock "Add3" SrcPort 1 DstBlock "Data Type Conversion5" DstPort 1 } Line { SrcBlock "Data Type Conversion5" SrcPort 1 Points [50, 0] DstBlock "Saturation" DstPort 1 } Line { SrcBlock "Data Type Conversion7" SrcPort 1 Points [15, 0] Branch { DstBlock "Gain" DstPort 1 } Branch { Points [0, -160; 940, 0; 0, 50] Branch { Points [-125, 0] DstBlock "Lookup\nTable (n-D)1" DstPort 2 } Branch { DstBlock "Lookup\nTable (n-D)2" DstPort 2 } } } Line { SrcBlock "Gain" SrcPort 1 Points [75, 0] Branch { Points [0, 45] DstBlock "Add4" DstPort 1 } Branch { Points [0, -55] DstBlock "Add3" DstPort 2 } } Line { SrcBlock "Lookup\nTable (n-D)2" SrcPort 1 Points [0, 5; -60, 0] DstBlock "Add" DstPort 2 } Line { SrcBlock "Data Type Conversion2" SrcPort 1 DstBlock "Lookup\nTable (n-D)1" DstPort 1 } Line { Name "n_2" Labels [0, 0] SrcBlock "Input Capture1" SrcPort 1 Points [10, 0] DstBlock "Data Type Conversion2" DstPort 1 } Line { SrcBlock "Input Capture1" SrcPort 2 Points [135, 0] DstBlock "Data Type Conversion9" DstPort 1 } Line { SrcBlock "Data Type Conversion9" SrcPort 1 DstBlock "Lookup\nTable (n-D)2" DstPort 1 } Line { SrcBlock "ADC Input" SrcPort 2 DstBlock "Goto" DstPort 1 } Line { SrcBlock "Saturation" SrcPort 1 DstBlock "PWM Motor Output2" DstPort 1 } Line { SrcBlock "Saturation1" SrcPort 1 DstBlock "PWM Motor Output2" DstPort 2 } Line { SrcBlock "Data Type Conversion6" SrcPort 1 Points [15, 0; 0, -15] DstBlock "Saturation1" DstPort 1 } Line { SrcBlock "Gain2" SrcPort 1 Points [-160, 0; 0, -190] Branch { DstBlock "Add4" DstPort 2 } Branch { Points [0, -130] DstBlock "Add3" DstPort 1 } } Line { SrcBlock "Lookup\nTable (n-D)1" SrcPort 1 Points [0, 15; 50, 0] DstBlock "Add" DstPort 1 } Annotation { Name "Look up table are not integer values.\nIf the r" "esult is converted to integer, \nthe decimal part will be lost." Position [1322, 281] BackgroundColor "[0.501961, 1.000000, 0.501961]" } Annotation { Name "Only one block for all IC input" Position [984, 70] BackgroundColor "[0.501961, 1.000000, 0.501961]" } Annotation { Name "We get a double" Position [1201, 368] BackgroundColor "[0.501961, 1.000000, 0.501961]" } Annotation { Name "Should use a saturation. \nThe max value for t" "he PWM_motor block \nis stored into the PWM variable. " Position [815, 109] BackgroundColor "[0.501961, 1.000000, 0.501961]" } Annotation { Name "Only one block for all ADC input" Position [82, 144] BackgroundColor "[0.501961, 1.000000, 0.501961]" } Annotation { Name "Input Capture peripheral : \nThe max frequency " "you could measure with IC1 is 20Hz since the max periode is defined here to 0" ".05s. \n\nLookup Table : \nMax value defned in the lookup table for input 1 i" "s 12000 while IC1 take value between [0 IC1max = 50000]. \nMax value defned i" "n the lookup table for input 2 is 30 while ADC output takes value between [0 " "2^10 = 1024]\nis it OK with this ?" Position [730, 576] BackgroundColor "[1.000000, 0.501961, 0.752941]" } } }