Bene... è ufficiale che non ci ho capito niente!!
Il fatto è che non ho mai usato né Matlab ne Simulink e ora che li utilizziamo per fare queste simulazioni di robotica volevo solo che la simulazione fosse il più possibile fluida (o per lo meno che non ci mettesse 20-25 secondi per simularne 5).
Poi in realtà tutto quello che dovrò fare io è modificare i tre guadagni di un regolatore PID per controllare correttamente il manipoatore.
Speravo che ci fosse qualche "trucchetto" per rendere le cose un po' più fluide ma comincio a dubitarne...
Quindi con "algoritmo di integrazione impiegato per il solutore" intendi quello che viene indicato con ode45 (metodo di Dormand-Prince)? Quale dovrei utilizzare?
So che magari sono domande stupide ma per me è tutto nuovo...
simulazione simulink lenta
20 messaggi
• Pagina 2 di 2 • 1, 2
0
voti
0
voti
Guarda le caratteristiche dei solutori delle ODE in questa pagina.
In base al tipo di equazione hai un solutore ottimale.
Se stai lontano dalle singolarità il robot non dovrebbe generare equazioni stiff.
In base al tipo di equazione hai un solutore ottimale.
Se stai lontano dalle singolarità il robot non dovrebbe generare equazioni stiff.
Ingegneria : alternativa intelligente alla droga.
-

dimaios
30,2k 7 10 12 - G.Master EY

- Messaggi: 3381
- Iscritto il: 24 ago 2010, 14:12
- Località: Behind the scenes
0
voti
Ok grazie adesso provo a guardare.
Comunque faccio una bella cosa: posto lo script e il file di simulink. Magari capisci come potrei sistemare i parametri:
SCRIPT
SIMULAZIONE
Grazie ancora per la pazienza!
Comunque faccio una bella cosa: posto lo script e il file di simulink. Magari capisci come potrei sistemare i parametri:
SCRIPT
- Codice: Seleziona tutto
l1=link([0 0 0 0], 'modified');
l2=link([-pi/2 0 0 0], 'modified');
l3=link([0 1 0 0], 'modified');
l4=link([0 0.5 0 0], 'modified');
l5=link([pi/2 0 0 0], 'modified');
l1.m = 0;
l2.m = 12.0;
l3.m = 4.8;
l4.m = 0.82;
l5.m = 0.34;
%--r: posizione del baricentro
l1.r = [ 0 0 0];
l2.r = [ 0.6 0.06 0];
l3.r = [ 0.2 0.03 0];
l4.r = [ 0 .019 0];
l5.r = [ 0 0 0];
l1.I = [ 0 0.35 0 0 0 0];
l2.I = [ .13 .524 .539 0 0 0];
l3.I = [ .066 .086 .0125 0 0 0];
l4.I = [ 1.8e-3 1.3e-3 1.8e-3 0 0 0];
l5.I = [ .3e-3 .4e-3 .3e-3 0 0 0];
%--jm: inerzia del motore
l1.Jm = 200e-6;
l2.Jm = 200e-6;
l3.Jm = 200e-6;
l4.Jm = 33e-6;
l5.Jm = 33e-6;
%--G: rapporto riduzione del motore
l1.G = -62.6111;
l2.G = 107.815;
l3.G = -53.7063;
l4.G = 76.0364;
l5.G = 71.923;
%--B: attrito
l1.B = 1.5e-3;
l2.B = 2.8e-3;
l3.B = 1.7e-3;
l4.B = 70.0e-6;
l5.B = 80.0e-6;
yasukawa=robot({l1 l2 l3 l4 l5});
yasukawa.name='yasukawa';
drivebot(yasukawa);
SIMULAZIONE
- Codice: Seleziona tutto
Model {
Name "simulazioneRobot"
Version 7.9
MdlSubVersion 0
GraphicalInterface {
NumRootInports 0
NumRootOutports 0
ParameterArgumentNames ""
ComputedModelVersion "1.12"
NumModelReferences 0
NumTestPointedSignals 0
}
SavedCharacterEncoding "windows-1252"
SaveDefaultBlockParams on
ScopeRefreshTime 0.035000
OverrideScopeRefreshTime on
DisableAllScopes off
DataTypeOverride "UseLocalSettings"
DataTypeOverrideAppliesTo "AllNumericTypes"
MinMaxOverflowLogging "UseLocalSettings"
MinMaxOverflowArchiveMode "Overwrite"
FPTRunName "Run 1"
MaxMDLFileLineLength 120
Created "Tue Nov 27 15:10:24 2012"
Creator "user"
UpdateHistory "UpdateHistoryNever"
ModifiedByFormat "%<Auto>"
LastModifiedBy "user"
ModifiedDateFormat "%<Auto>"
LastModifiedDate "Wed Nov 28 17:29:39 2012"
RTWModifiedTimeStamp 276023845
ModelVersionFormat "1.%<AutoIncrement:12>"
ConfigurationManager "None"
SampleTimeColors off
SampleTimeAnnotations off
LibraryLinkDisplay "disabled"
WideLines on
ShowLineDimensions on
ShowPortDataTypes off
ShowDesignRanges off
ShowLoopsOnError on
IgnoreBidirectionalLines off
ShowStorageClass off
ShowTestPointIcons on
ShowSignalResolutionIcons on
ShowViewerIcons on
SortedOrder off
ExecutionContextIcon off
ShowLinearizationAnnotations on
BlockNameDataTip off
BlockParametersDataTip off
BlockDescriptionStringDataTip off
ToolBar on
StatusBar on
BrowserShowLibraryLinks off
BrowserLookUnderMasks off
SimulationMode "normal"
LinearizationMsg "none"
Profile off
ParamWorkspaceSource "MATLABWorkspace"
AccelSystemTargetFile "accel.tlc"
AccelTemplateMakefile "accel_default_tmf"
AccelMakeCommand "make_rtw"
TryForcingSFcnDF off
Object {
$PropName "DataLoggingOverride"
$ObjectID 1
$ClassName "Simulink.SimulationData.ModelLoggingInfo"
model_ "simulazioneRobot"
overrideMode_ [0.0]
Array {
Type "Cell"
Dimension 1
Cell "simulazioneRobot"
PropName "logAsSpecifiedByModels_"
}
Array {
Type "Cell"
Dimension 1
Cell []
PropName "logAsSpecifiedByModelsSSIDs_"
}
}
RecordCoverage off
CovPath "/"
CovSaveName "covdata"
CovMetricSettings "dw"
CovNameIncrementing off
CovHtmlReporting on
CovForceBlockReductionOff on
covSaveCumulativeToWorkspaceVar on
CovSaveSingleToWorkspaceVar on
CovCumulativeVarName "covCumulativeData"
CovCumulativeReport off
CovReportOnPause on
CovModelRefEnable "Off"
CovExternalEMLEnable off
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 2
Version "1.12.0"
Array {
Type "Handle"
Dimension 8
Simulink.SolverCC {
$ObjectID 3
Version "1.12.0"
StartTime "0.0"
StopTime "5.0"
AbsTol "auto"
FixedStep "auto"
InitialStep "auto"
MaxNumMinSteps "-1"
MaxOrder 5
ZcThreshold "auto"
ConsecutiveZCsStepRelTol "10*128*eps"
MaxConsecutiveZCs "1000"
ExtrapolationOrder 4
NumberNewtonIterations 1
MaxStep "auto"
MinStep "auto"
MaxConsecutiveMinStep "1"
RelTol "1e-3"
SolverMode "Auto"
EnableConcurrentExecution off
ConcurrentTasks off
Solver "ode45"
SolverName "ode45"
SolverJacobianMethodControl "auto"
ShapePreserveControl "DisableAll"
ZeroCrossControl "UseLocalSettings"
ZeroCrossAlgorithm "Nonadaptive"
AlgebraicLoopSolver "TrustRegion"
SolverResetMethod "Fast"
PositivePriorityOrder off
AutoInsertRateTranBlk off
SampleTimeConstraint "Unconstrained"
InsertRTBMode "Whenever possible"
}
Simulink.DataIOCC {
$ObjectID 4
Version "1.12.0"
Decimation "1"
ExternalInput "[t, u]"
FinalStateName "xFinal"
InitialState "xInitial"
LimitDataPoints on
MaxDataPoints "1000"
LoadExternalInput off
LoadInitialState off
SaveFinalState off
SaveCompleteFinalSimState off
SaveFormat "Array"
SignalLoggingSaveFormat "ModelDataLogs"
SaveOutput on
SaveState off
SignalLogging on
DSMLogging on
InspectSignalLogs off
SaveTime on
ReturnWorkspaceOutputs off
StateSaveName "xout"
TimeSaveName "tout"
OutputSaveName "yout"
SignalLoggingName "logsout"
DSMLoggingName "dsmout"
OutputOption "RefineOutputTimes"
OutputTimes "[]"
ReturnWorkspaceOutputsName "out"
Refine "1"
}
Simulink.OptimizationCC {
$ObjectID 5
Version "1.12.0"
Array {
Type "Cell"
Dimension 8
Cell "BooleansAsBitfields"
Cell "PassReuseOutputArgsAs"
Cell "PassReuseOutputArgsThreshold"
Cell "ZeroExternalMemoryAtStartup"
Cell "ZeroInternalMemoryAtStartup"
Cell "OptimizeModelRefInitCode"
Cell "NoFixptDivByZeroProtection"
Cell "UseSpecifiedMinMax"
PropName "DisabledProps"
}
BlockReduction on
BooleanDataType on
ConditionallyExecuteInputs on
InlineParams off
UseIntDivNetSlope off
UseFloatMulNetSlope off
UseSpecifiedMinMax off
InlineInvariantSignals off
OptimizeBlockIOStorage on
BufferReuse on
EnhancedBackFolding off
StrengthReduction off
ExpressionFolding on
BooleansAsBitfields off
BitfieldContainerType "uint_T"
EnableMemcpy on
MemcpyThreshold 64
PassReuseOutputArgsAs "Structure reference"
ExpressionDepthLimit 2147483647
FoldNonRolledExpr on
LocalBlockOutputs on
RollThreshold 5
SystemCodeInlineAuto off
StateBitsets off
DataBitsets off
UseTempVars off
ZeroExternalMemoryAtStartup on
ZeroInternalMemoryAtStartup on
InitFltsAndDblsToZero off
NoFixptDivByZeroProtection off
EfficientFloat2IntCast off
EfficientMapNaN2IntZero on
OptimizeModelRefInitCode off
LifeSpan "inf"
MaxStackSize "Inherit from target"
BufferReusableBoundary on
SimCompilerOptimization "Off"
AccelVerboseBuild off
ParallelExecutionInRapidAccelerator on
}
Simulink.DebuggingCC {
$ObjectID 6
Version "1.12.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
UnderspecifiedInitializationDetection "Classic"
MergeDetectMultiDrivingBlocksExec "none"
CheckExecutionContextPreStartOutputMsg off
CheckExecutionContextRuntimeOutputMsg off
SignalResolutionControl "UseLocalSettings"
BlockPriorityViolationMsg "warning"
MinStepSizeMsg "warning"
TimeAdjustmentMsg "none"
MaxConsecutiveZCsMsg "error"
MaskedZcDiagnostic "warning"
IgnoredZcDiagnostic "warning"
SolverPrmCheckMsg "none"
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"
FixptConstUnderflowMsg "none"
FixptConstOverflowMsg "none"
FixptConstPrecisionLossMsg "none"
UnderSpecifiedDataTypeMsg "none"
UnnecessaryDatatypeConvMsg "none"
VectorMatrixConversionMsg "none"
InvalidFcnCallConnMsg "error"
FcnCallInpInsideContextMsg "Enable All"
SignalLabelMismatchMsg "none"
UnconnectedInputMsg "warning"
UnconnectedOutputMsg "warning"
UnconnectedLineMsg "warning"
SFcnCompatibilityMsg "none"
FrameProcessingCompatibilityMsg "warning"
UniqueDataStoreMsg "none"
BusObjectLabelMismatch "warning"
RootOutportRequireBusObject "warning"
AssertControl "UseLocalSettings"
EnableOverflowDetection off
ModelReferenceIOMsg "none"
ModelReferenceMultiInstanceNormalModeStructChecksumCheck "error"
ModelReferenceVersionMismatchMessage "none"
ModelReferenceIOMismatchMessage "none"
ModelReferenceCSMismatchMessage "none"
UnknownTsInhSupMsg "warning"
ModelReferenceDataLoggingMessage "warning"
ModelReferenceSymbolNameMessage "warning"
ModelReferenceExtraNoncontSigs "error"
StateNameClashWarn "warning"
SimStateInterfaceChecksumMismatchMsg "warning"
SimStateOlderReleaseMsg "error"
InitInArrayFormatMsg "warning"
StrictBusMsg "ErrorLevel1"
BusNameAdapt "WarnAndRepair"
NonBusSignalsTreatedAsBus "none"
LoggingUnavailableSignals "error"
BlockIODiagnostic "none"
SFUnusedDataAndEventsDiag "warning"
SFUnexpectedBacktrackingDiag "warning"
SFInvalidInputDataAccessInChartInitDiag "warning"
SFNoUnconditionalDefaultTransitionDiag "warning"
SFTransitionOutsideNaturalParentDiag "warning"
SFUnconditionalTransitionShadowingDiag "warning"
}
Simulink.HardwareCC {
$ObjectID 7
Version "1.12.0"
ProdBitPerChar 8
ProdBitPerShort 16
ProdBitPerInt 32
ProdBitPerLong 32
ProdBitPerFloat 32
ProdBitPerDouble 64
ProdBitPerPointer 32
ProdLargestAtomicInteger "Char"
ProdLargestAtomicFloat "None"
ProdIntDivRoundTo "Undefined"
ProdEndianess "Unspecified"
ProdWordSize 32
ProdShiftRightIntArith on
ProdHWDeviceType "32-bit Generic"
TargetBitPerChar 8
TargetBitPerShort 16
TargetBitPerInt 32
TargetBitPerLong 32
TargetBitPerFloat 32
TargetBitPerDouble 64
TargetBitPerPointer 32
TargetLargestAtomicInteger "Char"
TargetLargestAtomicFloat "None"
TargetShiftRightIntArith on
TargetIntDivRoundTo "Undefined"
TargetEndianess "Unspecified"
TargetWordSize 32
TargetTypeEmulationWarnSuppressLevel 0
TargetPreprocMaxBitsSint 32
TargetPreprocMaxBitsUint 32
TargetHWDeviceType "Specified"
TargetUnknown off
ProdEqTarget on
}
Simulink.ModelReferenceCC {
$ObjectID 8
Version "1.12.0"
UpdateModelReferenceTargets "IfOutOfDateOrStructuralChange"
CheckModelReferenceTargetMessage "error"
EnableParallelModelReferenceBuilds off
ParallelModelReferenceErrorOnInvalidPool on
ParallelModelReferenceMATLABWorkerInit "None"
ModelReferenceNumInstancesAllowed "Multi"
PropagateVarSize "Infer from blocks in model"
ModelReferencePassRootInputsByReference on
ModelReferenceMinAlgLoopOccurrences off
PropagateSignalLabelsOutOfModel off
SupportModelReferenceSimTargetCustomCode off
}
Simulink.SFSimCC {
$ObjectID 9
Version "1.12.0"
SFSimEnableDebug on
SFSimOverflowDetection on
SFSimEcho on
SimBlas on
SimCtrlC on
SimExtrinsic on
SimIntegrity on
SimUseLocalCustomCode off
SimParseCustomCode on
SimBuildMode "sf_incremental_build"
}
Simulink.RTWCC {
$BackupClass "Simulink.RTWCC"
$ObjectID 10
Version "1.12.0"
Array {
Type "Cell"
Dimension 8
Cell "IncludeHyperlinkInReport"
Cell "GenerateTraceInfo"
Cell "GenerateTraceReport"
Cell "GenerateTraceReportSl"
Cell "GenerateTraceReportSf"
Cell "GenerateTraceReportEml"
Cell "GenerateSLWebview"
Cell "GenerateCodeMetricsReport"
PropName "DisabledProps"
}
SystemTargetFile "grt.tlc"
GenCodeOnly off
MakeCommand "make_rtw"
GenerateMakefile on
TemplateMakefile "grt_default_tmf"
GenerateReport off
SaveLog off
RTWVerbose on
RetainRTWFile off
ProfileTLC off
TLCDebug off
TLCCoverage off
TLCAssert off
ProcessScriptMode "Default"
ConfigurationMode "Optimized"
ConfigAtBuild off
RTWUseLocalCustomCode off
RTWUseSimCustomCode off
IncludeHyperlinkInReport off
LaunchReport off
TargetLang "C"
IncludeBusHierarchyInRTWFileBlockHierarchyMap off
IncludeERTFirstTime off
GenerateTraceInfo off
GenerateTraceReport off
GenerateTraceReportSl off
GenerateTraceReportSf off
GenerateTraceReportEml off
GenerateCodeInfo off
GenerateWebview off
GenerateCodeMetricsReport off
GenerateCodeReplacementReport off
RTWCompilerOptimization "Off"
CheckMdlBeforeBuild "Off"
CustomRebuildMode "OnUpdate"
Array {
Type "Handle"
Dimension 2
Simulink.CodeAppCC {
$ObjectID 11
Version "1.12.0"
Array {
Type "Cell"
Dimension 21
Cell "IgnoreCustomStorageClasses"
Cell "IgnoreTestpoints"
Cell "InsertBlockDesc"
Cell "InsertPolySpaceComments"
Cell "SFDataObjDesc"
Cell "MATLABFcnDesc"
Cell "SimulinkDataObjDesc"
Cell "DefineNamingRule"
Cell "SignalNamingRule"
Cell "ParamNamingRule"
Cell "InlinedPrmAccess"
Cell "CustomSymbolStr"
Cell "CustomSymbolStrGlobalVar"
Cell "CustomSymbolStrType"
Cell "CustomSymbolStrField"
Cell "CustomSymbolStrFcn"
Cell "CustomSymbolStrFcnArg"
Cell "CustomSymbolStrBlkIO"
Cell "CustomSymbolStrTmpVar"
Cell "CustomSymbolStrMacro"
Cell "ReqsInCode"
PropName "DisabledProps"
}
ForceParamTrailComments off
GenerateComments on
IgnoreCustomStorageClasses on
IgnoreTestpoints off
IncHierarchyInIds off
MaxIdLength 31
PreserveName off
PreserveNameWithParent off
ShowEliminatedStatement off
IncAutoGenComments off
SimulinkDataObjDesc off
SFDataObjDesc off
MATLABFcnDesc off
IncDataTypeInIds off
MangleLength 1
CustomSymbolStrGlobalVar "$R$N$M"
CustomSymbolStrType "$N$R$M"
CustomSymbolStrField "$N$M"
CustomSymbolStrFcn "$R$N$M$F"
CustomSymbolStrFcnArg "rt$I$N$M"
CustomSymbolStrBlkIO "rtb_$N$M"
CustomSymbolStrTmpVar "$N$M"
CustomSymbolStrMacro "$R$N$M"
DefineNamingRule "None"
ParamNamingRule "None"
SignalNamingRule "None"
InsertBlockDesc off
InsertPolySpaceComments off
SimulinkBlockComments on
MATLABSourceComments off
EnableCustomComments off
InlinedPrmAccess "Literals"
ReqsInCode off
UseSimReservedNames off
}
Simulink.GRTTargetCC {
$BackupClass "Simulink.TargetCC"
$ObjectID 12
Version "1.12.0"
Array {
Type "Cell"
Dimension 16
Cell "GeneratePreprocessorConditionals"
Cell "IncludeMdlTerminateFcn"
Cell "CombineOutputUpdateFcns"
Cell "SuppressErrorStatus"
Cell "ERTCustomFileBanners"
Cell "GenerateSampleERTMain"
Cell "GenerateTestInterfaces"
Cell "ModelStepFunctionPrototypeControlCompliant"
Cell "CPPClassGenCompliant"
Cell "MultiInstanceERTCode"
Cell "PurelyIntegerCode"
Cell "SupportComplex"
Cell "SupportAbsoluteTime"
Cell "SupportContinuousTime"
Cell "SupportNonInlinedSFcns"
Cell "PortableWordSizes"
PropName "DisabledProps"
}
TargetFcnLib "ansi_tfl_table_tmw.mat"
TargetLibSuffix ""
TargetPreCompLibLocation ""
CodeReplacementLibrary "ANSI_C"
UtilityFuncGeneration "Auto"
ERTMultiwordTypeDef "System defined"
CodeExecutionProfiling off
ERTMultiwordLength 256
MultiwordLength 2048
GenerateFullHeader on
GenerateSampleERTMain off
GenerateTestInterfaces off
IsPILTarget off
ModelReferenceCompliant on
ParMdlRefBuildCompliant on
CompOptLevelCompliant on
ConcurrentExecutionCompliant on
IncludeMdlTerminateFcn on
GeneratePreprocessorConditionals "Disable all"
CombineOutputUpdateFcns off
CombineSignalStateStructs off
SuppressErrorStatus off
ERTFirstTimeCompliant off
IncludeFileDelimiter "Auto"
ERTCustomFileBanners off
SupportAbsoluteTime on
LogVarNameModifier "rt_"
MatFileLogging on
MultiInstanceERTCode off
SupportNonFinite on
SupportComplex on
PurelyIntegerCode off
SupportContinuousTime on
SupportNonInlinedSFcns on
SupportVariableSizeSignals off
EnableShiftOperators on
ParenthesesLevel "Nominal"
PortableWordSizes off
ModelStepFunctionPrototypeControlCompliant off
CPPClassGenCompliant off
AutosarCompliant off
GRTInterface on
UseMalloc off
ExtMode off
ExtModeStaticAlloc off
ExtModeTesting off
ExtModeStaticAllocSize 1000000
ExtModeTransport 0
ExtModeMexFile "ext_comm"
ExtModeIntrfLevel "Level1"
RTWCAPISignals off
RTWCAPIParams off
RTWCAPIStates off
RTWCAPIRootIO off
GenerateASAP2 off
}
PropName "Components"
}
}
PropName "Components"
}
Name "Configuration"
CurrentDlgPage "Data Import//Export"
ConfigPrmDlgPosition [ 206, 121, 1075, 841 ]
}
PropName "ConfigurationSets"
}
Simulink.ConfigSet {
$PropName "ActiveConfigurationSet"
$ObjectID 2
}
ExplicitPartitioning off
BlockDefaults {
ForegroundColor "black"
BackgroundColor "white"
DropShadow off
NamePlacement "normal"
FontName "Helvetica"
FontSize 10
FontWeight "normal"
FontAngle "normal"
ShowName on
BlockRotation 0
BlockMirror off
}
AnnotationDefaults {
HorizontalAlignment "center"
VerticalAlignment "middle"
ForegroundColor "black"
BackgroundColor "white"
DropShadow off
FontName "Helvetica"
FontSize 10
FontWeight "normal"
FontAngle "normal"
UseDisplayTextAsClickCallback off
}
LineDefaults {
FontName "Helvetica"
FontSize 9
FontWeight "normal"
FontAngle "normal"
}
BlockParameterDefaults {
Block {
BlockType Constant
Value "1"
VectorParams1D on
SamplingMode "Sample based"
OutMin "[]"
OutMax "[]"
OutDataTypeStr "Inherit: Inherit from 'Constant value'"
LockScale off
SampleTime "inf"
FramePeriod "inf"
PreserveConstantTs off
}
Block {
BlockType Gain
Gain "1"
Multiplication "Element-wise(K.*u)"
ParamMin "[]"
ParamMax "[]"
ParamDataTypeStr "Inherit: Same as input"
OutMin "[]"
OutMax "[]"
OutDataTypeStr "Inherit: Same as input"
LockScale off
RndMeth "Floor"
SaturateOnIntegerOverflow on
SampleTime "-1"
}
Block {
BlockType Integrator
ExternalReset "none"
InitialConditionSource "internal"
InitialCondition "0"
LimitOutput off
UpperSaturationLimit "inf"
LowerSaturationLimit "-inf"
ShowSaturationPort off
ShowStatePort off
AbsoluteTolerance "auto"
IgnoreLimit off
ZeroCross on
ContinuousStateAttributes "''"
}
Block {
BlockType Saturate
UpperLimitSource "Dialog"
UpperLimit "0.5"
LowerLimitSource "Dialog"
LowerLimit "-0.5"
LinearizeAsGain on
ZeroCross on
SampleTime "-1"
OutMin "[]"
OutMax "[]"
OutDataTypeStr "Inherit: Same as input"
LockScale off
RndMeth "Floor"
}
Block {
BlockType Scope
ModelBased off
TickLabels "OneTimeTick"
ZoomMode "on"
Grid "on"
TimeRange "auto"
YMin "-5"
YMax "5"
SaveToWorkspace off
SaveName "ScopeData"
DataFormat "Array"
LimitDataPoints on
MaxDataPoints "5000"
Decimation "1"
SampleInput off
SampleTime "-1"
}
Block {
BlockType Selector
NumberOfDimensions "1"
IndexMode "One-based"
InputPortWidth "-1"
SampleTime "-1"
}
Block {
BlockType Sum
IconShape "rectangular"
Inputs "++"
CollapseMode "All dimensions"
CollapseDim "1"
InputSameDT on
AccumDataTypeStr "Inherit: Inherit via internal rule"
OutMin "[]"
OutMax "[]"
OutDataTypeStr "Inherit: Same as first input"
LockScale off
RndMeth "Floor"
SaturateOnIntegerOverflow on
SampleTime "-1"
}
Block {
BlockType Terminator
}
}
System {
Name "simulazioneRobot"
Location [9, 635, 1176, 1243]
Open on
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "A4"
PaperUnits "centimeters"
TiledPaperMargins [1.270000, 1.270000, 1.270000, 1.270000]
TiledPageScale 1
ShowPageBoundaries off
ZoomFactor "100"
ReportName "simulink-default.rpt"
SIDHighWatermark "25"
Block {
BlockType Constant
Name "Constant"
SID "2"
Position [70, 209, 170, 241]
ZOrder -4
Value "[0 0 0 0 0]"
}
Block {
BlockType Constant
Name "Constant1"
SID "12"
Position [70, 279, 170, 311]
ZOrder -4
Value "[0 0 0 0 0]"
}
Block {
BlockType Scope
Name "Coppia"
SID "21"
Ports [1]
Position [790, 524, 820, 556]
ZOrder -16
Floating off
Location [944, 65, 1268, 304]
Open on
NumInputPorts "1"
ZoomMode "xonly"
List {
ListType AxesTitles
axes1 "%<SignalLabel>"
}
List {
ListType ScopeGraphics
FigureColor "[0.5 0.5 0.5]"
AxesColor "[0 0 0]"
AxesTickColor "[1 1 1]"
LineColors "[1 1 0;1 0 1;0 1 1;1 0 0;0 1 0;0 0 1]"
LineStyles "-|-|-|-|-|-"
LineWidths "[0.5 0.5 0.5 0.5 0.5 0.5]"
MarkerStyles "none|none|none|none|none|none"
}
ShowLegends off
YMin "-175"
YMax "250"
SaveName "ScopeData2"
DataFormat "StructureWithTime"
SampleTime "0"
}
Block {
BlockType Scope
Name "Errore"
SID "17"
Ports [1]
Position [500, 59, 530, 91]
ZOrder -16
Floating off
Location [7, 54, 331, 293]
Open on
NumInputPorts "1"
ZoomMode "yonly"
List {
ListType AxesTitles
axes1 "%<SignalLabel>"
}
List {
ListType ScopeGraphics
FigureColor "[0.5 0.5 0.5]"
AxesColor "[0 0 0]"
AxesTickColor "[1 1 1]"
LineColors "[1 1 0;1 0 1;0 1 1;1 0 0;0 1 0;0 0 1]"
LineStyles "-|-|-|-|-|-"
LineWidths "[0.5 0.5 0.5 0.5 0.5 0.5]"
MarkerStyles "none|none|none|none|none|none"
}
ShowLegends off
YMin "-0.75"
YMax "1.75"
DataFormat "StructureWithTime"
SampleTime "0"
}
Block {
BlockType Integrator
Name "Integrator"
SID "10"
Ports [1, 1]
Position [375, 210, 405, 240]
ZOrder -10
}
Block {
BlockType Gain
Name "Kd"
SID "7"
Position [475, 280, 505, 310]
ZOrder -8
Gain "[0 1450 0 0 0]"
ParamDataTypeStr "Inherit: Inherit via internal rule"
OutDataTypeStr "Inherit: Inherit via internal rule"
SaturateOnIntegerOverflow off
}
Block {
BlockType Gain
Name "Ki"
SID "8"
Position [475, 210, 505, 240]
ZOrder -8
Gain "[0 600 0 0 0]"
ParamDataTypeStr "Inherit: Inherit via internal rule"
OutDataTypeStr "Inherit: Inherit via internal rule"
SaturateOnIntegerOverflow off
}
Block {
BlockType Gain
Name "Kp"
SID "9"
Position [475, 145, 505, 175]
ZOrder -8
Gain "[0 800 500 0 0]"
ParamDataTypeStr "Inherit: Inherit via internal rule"
OutDataTypeStr "Inherit: Inherit via internal rule"
SaturateOnIntegerOverflow off
}
Block {
BlockType Reference
Name "Robot"
SID "1"
Ports [1, 3]
Position [670, 189, 785, 261]
BackgroundColor "red"
DropShadow on
LibraryVersion "1.27"
SourceBlock "roblocks/Robot"
SourceType ""
robot "yasukawa"
q0 "[0 -pi/2 0 0 0]"
}
Block {
BlockType Saturate
Name "Saturation"
SID "16"
Ports [1, 1]
Position [590, 210, 620, 240]
ZOrder -15
InputPortMap "u0"
UpperLimit "[150 250 40 1 1]"
LowerLimit "[-150 -250 -40 -1 -1]"
}
Block {
BlockType Selector
Name "Selector"
SID "18"
Ports [1, 1]
Position [370, 56, 410, 94]
ZOrder -17
InputPortWidth "5"
IndexOptions "Index vector (dialog)"
Indices "[2]"
OutputSizes "1"
}
Block {
BlockType Selector
Name "Selector1"
SID "20"
Ports [1, 1]
Position [820, 441, 860, 479]
ZOrder -17
InputPortWidth "5"
IndexOptions "Index vector (dialog)"
Indices "[2]"
OutputSizes "1"
}
Block {
BlockType Selector
Name "Selector2"
SID "22"
Ports [1, 1]
Position [685, 521, 725, 559]
ZOrder -17
InputPortWidth "5"
IndexOptions "Index vector (dialog)"
Indices "[2]"
OutputSizes "1"
}
Block {
BlockType Sum
Name "Sum"
SID "6"
Ports [3, 1]
Position [550, 215, 570, 235]
ZOrder -18
ShowName off
IconShape "round"
Inputs "+++"
InputSameDT off
OutDataTypeStr "Inherit: Inherit via internal rule"
SaturateOnIntegerOverflow off
}
Block {
BlockType Sum
Name "Sum1"
SID "11"
Ports [2, 1]
Position [245, 215, 265, 235]
ZOrder -18
ShowName off
IconShape "round"
Inputs "|+-"
InputSameDT off
OutDataTypeStr "Inherit: Inherit via internal rule"
SaturateOnIntegerOverflow off
}
Block {
BlockType Sum
Name "Sum4"
SID "15"
Ports [2, 1]
Position [335, 285, 355, 305]
ZOrder -18
ShowName off
IconShape "round"
Inputs "|+-"
InputSameDT off
OutDataTypeStr "Inherit: Inherit via internal rule"
SaturateOnIntegerOverflow off
}
Block {
BlockType Terminator
Name "Terminator"
SID "4"
Position [930, 205, 950, 225]
ZOrder -20
}
Block {
BlockType Terminator
Name "Terminator1"
SID "5"
Position [930, 270, 950, 290]
ZOrder -20
}
Block {
BlockType Reference
Name "plot"
SID "3"
Ports [1]
Position [900, 97, 980, 153]
BackgroundColor "red"
LibraryVersion "1.27"
SourceBlock "roblocks/plot"
SourceType ""
robot "yasukawa"
}
Block {
BlockType Scope
Name "q"
SID "19"
Ports [1]
Position [950, 444, 980, 476]
ZOrder -16
Floating off
Location [343, 53, 667, 292]
Open off
NumInputPorts "1"
List {
ListType AxesTitles
axes1 "%<SignalLabel>"
}
List {
ListType ScopeGraphics
FigureColor "[0.5 0.5 0.5]"
AxesColor "[0 0 0]"
AxesTickColor "[1 1 1]"
LineColors "[1 1 0;1 0 1;0 1 1;1 0 0;0 1 0;0 0 1]"
LineStyles "-|-|-|-|-|-"
LineWidths "[0.5 0.5 0.5 0.5 0.5 0.5]"
MarkerStyles "none|none|none|none|none|none"
}
ShowLegends off
YMin "-1.75"
YMax "0.25"
SaveName "ScopeData1"
DataFormat "StructureWithTime"
SampleTime "0"
}
Line {
SrcBlock "Robot"
SrcPort 1
Points [45, 0]
Branch {
Points [0, -75]
DstBlock "plot"
DstPort 1
}
Branch {
Points [0, 165; -45, 0]
Branch {
Points [-535, 0]
DstBlock "Sum1"
DstPort 2
}
Branch {
Points [0, 95]
DstBlock "Selector1"
DstPort 1
}
}
}
Line {
SrcBlock "Robot"
SrcPort 2
Points [20, 0]
Branch {
Points [40, 0; 0, -10]
DstBlock "Terminator"
DstPort 1
}
Branch {
Points [0, 120; -465, 0]
DstBlock "Sum4"
DstPort 2
}
}
Line {
SrcBlock "Robot"
SrcPort 3
Points [60, 0; 0, 30]
DstBlock "Terminator1"
DstPort 1
}
Line {
SrcBlock "Sum"
SrcPort 1
DstBlock "Saturation"
DstPort 1
}
Line {
SrcBlock "Kp"
SrcPort 1
Points [50, 0]
DstBlock "Sum"
DstPort 1
}
Line {
SrcBlock "Ki"
SrcPort 1
DstBlock "Sum"
DstPort 2
}
Line {
SrcBlock "Kd"
SrcPort 1
Points [50, 0]
DstBlock "Sum"
DstPort 3
}
Line {
SrcBlock "Integrator"
SrcPort 1
DstBlock "Ki"
DstPort 1
}
Line {
SrcBlock "Sum1"
SrcPort 1
Points [40, 0]
Branch {
DstBlock "Integrator"
DstPort 1
}
Branch {
Points [0, -65; 25, 0]
Branch {
DstBlock "Kp"
DstPort 1
}
Branch {
Points [0, -85]
DstBlock "Selector"
DstPort 1
}
}
}
Line {
SrcBlock "Constant"
SrcPort 1
DstBlock "Sum1"
DstPort 1
}
Line {
SrcBlock "Constant1"
SrcPort 1
DstBlock "Sum4"
DstPort 1
}
Line {
SrcBlock "Sum4"
SrcPort 1
DstBlock "Kd"
DstPort 1
}
Line {
SrcBlock "Selector"
SrcPort 1
DstBlock "Errore"
DstPort 1
}
Line {
SrcBlock "Selector1"
SrcPort 1
DstBlock "q"
DstPort 1
}
Line {
SrcBlock "Selector2"
SrcPort 1
DstBlock "Coppia"
DstPort 1
}
Line {
SrcBlock "Saturation"
SrcPort 1
Points [15, 0]
Branch {
DstBlock "Robot"
DstPort 1
}
Branch {
Points [0, 315]
DstBlock "Selector2"
DstPort 1
}
}
}
}
Grazie ancora per la pazienza!
0
voti
Ho provato a utilizzare tutti gli algoritmi ode45, ode23, ode15, eccetera ma non ho notato miglioramenti. Che tu sappia non esiste un modo per far in modo di utilizzare più potenza di calcolo (la cpu è sempre al 25% mentre mi aspetterei di vederla lavorare ben di più durante la simulazione)? O la cpu non c'entra niente?
0
voti
Scusate il post multiplo ma credo di avercela fatta: la soluzione era algoritmo ode3 con type impostato a fixed-step. Ora la simulazione è molto fluida. Si doveva solo procedere con metodo scientifico: provarle tutte!! 
0
voti
minomic ha scritto:Che tu sappia non esiste un modo per far in modo di utilizzare più potenza di calcolo (la cpu è sempre al 25% mentre mi aspetterei di vederla lavorare ben di più durante la simulazione)? O la cpu non c'entra niente?
Si. Bisogna utilizzare il toolbox parallel computing ma serve per accelerare il codice Matlab quindi le chiamate da Simulink verso funzioni scritte in tale linguaggio per cui non ci si attende un'accelerazione dovuta all'incremento delle perfomance del task simulink ma delle chiamate alle funzioni Matlab che vengono eseguite in parallelo. link.
minomic ha scritto: Si doveva solo procedere con metodo scientifico: provarle tutte!!
Un'interpretazione personale della teoria di Bernulli .... prove ripetute ed indipendenti ovvero non capitalizzare quanto si è imparato in quelle precedenti e sparare a caso nelle successive !
Ingegneria : alternativa intelligente alla droga.
-

dimaios
30,2k 7 10 12 - G.Master EY

- Messaggi: 3381
- Iscritto il: 24 ago 2010, 14:12
- Località: Behind the scenes
0
voti
dimaios ha scritto:non capitalizzare quanto si è imparato in quelle precedenti e sparare a caso nelle successive !
Parole sante!!
Grazie ancora

0
voti
Sono ancora io... Stamattina ho notato che tarando il PID con una terna di parametri all'università (algoritmo variable step-size ode45 dormand-prince) ottengo una certa simulazione. La stessa terna a casa (algoritmo fixed step-size ode3) mi dà una simulazione ben diversa (ad esempio il comportamento asintotico è instabile mentre all'università risultava stabile). Allora a casa ho provato a mettere variable step-size ode45 dormand-prince e infatti la simulazione è uguale a quella dell'università ma molto molto più lenta. Stesso discorso per fixed step-size ode8 dormand-prince (la simulazione è solo leggermente più veloce).
Quindi con algoritmi diversi ottengo simulazioni così diverse??
E allora come potrei fare per avere gli stessi risultati che ho all'università ma in modo più fluido?
Grazie!
Quindi con algoritmi diversi ottengo simulazioni così diverse??
E allora come potrei fare per avere gli stessi risultati che ho all'università ma in modo più fluido?
Grazie!
1
voti
La caratteristiche di A-stabilità,B-stabilità ed L-stabilità variano da algoritmo ad algoritmo come pure l'errore di approssimazione.
Inoltre la coerenza tra la simulazione effettuata ed il modello Simulink dipendono dalla presenza esclusiva o meno di stati nel dominio temporale discreto come pure le performance raggiungibili.
E' ovvio quindi che le simulazioni possano avere risultati diversi impiegando solutori differenti.
L'equivalenza del risultato si ha a patto che vengano impiegati metodi di integrazione compatibili con le equazioni differenziali in oggetto e la precisione del risultato atteso ( si sottintende che l'algoritmo lavori in una zona di stabilità numerica ).
Inoltre devi valutare attentamente la natura delle equazioni.
Se sono di tipo stiff dovrai necessariamente ricorrere a metodi robusti in questo senso.
Nel campo della robotica ti trovi spesso in questa situazione ogni volta che passi vicino ad un punto singolare della catena cinematica.
Ti consiglio vivamente di ripassare le tecniche di integrazione numerica e relative implementazioni in Matlab.
link.
Ingegneria : alternativa intelligente alla droga.
-

dimaios
30,2k 7 10 12 - G.Master EY

- Messaggi: 3381
- Iscritto il: 24 ago 2010, 14:12
- Località: Behind the scenes
0
voti
dimaios ha scritto:Ti consiglio vivamente di ripassare le tecniche di integrazione numerica e relative implementazioni in Matlab.
Più che ripassarle dovrei proprio studiarle perché sono veramente le prime volte che utilizzo Matlab e quindi non ho la più pallida idea di cosa tutto ciò voglia dire. Per capirci non so neanche cosa siano le equazioni stiff e robe varie. Purtroppo però i molti impegni non mi lasciano affatto il tempo...
dimaios ha scritto:La caratteristiche di A-stabilità,B-stabilità ed L-stabilità variano da algoritmo ad algoritmo come pure l'errore di approssimazione.
Inoltre la coerenza tra la simulazione effettuata ed il modello Simulink dipendono dalla presenza esclusiva o meno di stati nel dominio temporale discreto come pure le performance raggiungibili.

Comunque ho definitivamente risolto il problema chiedendo al professore, il quale mi ha spiegato che la robotics toolbox che stavamo utilizzando era ottimizzata per la versione a 32 bit di Matlab e che su quella a 64 bit avrebbe fatto una fatica enorme. Mi ha anche suggerito di ricompilarla ma non ce l'ho fatta a saltarci fuori (SDK Microsoft che non si installava, eccetera).
Alla fine ho rimosso Matlab 64 bit e ho installato la versione a 32 bit and now it works like a charm!!
Quindi problema definitivamente risolto!
Grazie ancora!

20 messaggi
• Pagina 2 di 2 • 1, 2
Torna a Programmi applicativi: simulatori, CAD ed altro
Chi c’è in linea
Visitano il forum: Nessuno e 5 ospiti

Elettrotecnica e non solo (admin)
Un gatto tra gli elettroni (IsidoroKZ)
Esperienza e simulazioni (g.schgor)
Moleskine di un idraulico (RenzoDF)
Il Blog di ElectroYou (webmaster)
Idee microcontrollate (TardoFreak)
PICcoli grandi PICMicro (Paolino)
Il blog elettrico di carloc (carloc)
DirtEYblooog (dirtydeeds)
Di tutto... un po' (jordan20)
AK47 (lillo)
Esperienze elettroniche (marco438)
Telecomunicazioni musicali (clavicordo)
Automazione ed Elettronica (gustavo)
Direttive per la sicurezza (ErnestoCappelletti)
EYnfo dall'Alaska (mir)
Apriamo il quadro! (attilio)
H7-25 (asdf)
Passione Elettrica (massimob)
Elettroni a spasso (guidob)
Bloguerra (guerra)