Contenido principal

addComponentTiltTolerance

R2026b

Add tolerance for component tilt

Since R2026b

    Description

    Add-On Required: This feature requires the Optical Design and Simulation Library for Image Processing Toolbox add-on.

    tolSet = addComponentTiltTolerance(tolSet,propertyName,value) adds a tolerance for the component tilt property specified by propertyName to the tolerance set tolSet. The tolerance applies to all top-level components. The tolerance set, tolSet, is an opticalToleranceSet object. This function adds a ComponentTiltTolerance object to the Tolerances property of tolSet and appends the details of the tolerance to the ToleranceTable property of tolSet.

    tolSet = addComponentTiltTolerance(tolSet,propertyName,value,TargetIndex=targetIdx) applies the tolerance to only the components specified by targetIdx. This function does not support sub-component tolerancing.

    example

    Examples

    collapse all

    Import an optical system into the workspace.

    opsys = zmximport("PhotographicLens.zmx");

    Create an empty optical tolerance set.

    tolSet = opticalToleranceSet;

    Add tolerances to the tolerance set.

    tolSet = addSurfaceRadiusTolerance(tolSet,0.05);
    tolSet = addSurfaceConicConstantTolerance(tolSet,[-0.01 0.01],TargetIndex=2);
    tolSet = addSurfacePositionTolerance(tolSet,PositionX=0.1);
    tolSet = addSurfaceTiltTolerance(tolSet,TiltX=[-0.5 0.5],TargetIndex=3);
    tolSet = addSurfaceAsphericTolerance(tolSet,0.05,4);
    tolSet = addComponentPositionTolerance(tolSet,PositionX=0.1);
    tolSet = addComponentTiltTolerance(tolSet,TiltY=[-0.2 0.2],TargetIndex=2:8);
    tolSet = addComponentMaterialTolerance(tolSet,Nd=0.05,TargetIndex=2:8);

    Inspect the tolerance set.

    tolSet
    tolSet = 
      opticalToleranceSet with properties:
    
            Tolerances: [1×8 optics.tolerance.Tolerance]
        ToleranceTable: [8×4 table]
    
    
    tolSet.Tolerances
    ans = 1×8 heterogeneous Tolerance (SurfaceRadiusTolerance, SurfaceConicConstantTolerance, SurfacePositionTolerance, ...) array with properties:
        ToleranceRange
        ToleranceType
    
    
    tolSet.ToleranceTable
    ans = 8×4 table
             TargetProperty     ToleranceRange    ToleranceType       TargetIndex   
             _______________    ______________    _____________    _________________
    
        1    "Radius"           -0.05     0.05    "Percentage"     {0×0 double     }
        2    "ConicConstant"    -0.01     0.01    "Absolute"       {[            2]}
        3    "PositionX"         -0.1      0.1    "Percentage"     {0×0 double     }
        4    "TiltX"             -0.5      0.5    "Absolute"       {[            3]}
        5    "Aspheric"         -0.05     0.05    "Percentage"     {0×0 double     }
        6    "PositionX"         -0.1      0.1    "Percentage"     {0×0 double     }
        7    "TiltY"             -0.2      0.2    "Absolute"       {[2 3 4 5 6 7 8]}
        8    "Nd"               -0.05     0.05    "Percentage"     {[2 3 4 5 6 7 8]}
    
    	Get insights using Copilot
    
    

    Create a merit function object for evaluating system performance.

    meritFcn = opticalMeritFunction;
    meritFcn = addSpot(meritFcn);

    Run a sensitivity analysis on the optical system using the merit function and tolerances.

    resultSensitivity = opticalSensitivity(opsys,meritFcn,tolSet);

    Run a Monte Carlo tolerance analysis with 100 trials on the optical system using the same merit function and tolerances.

    resultTolerance = opticalTolerance(opsys,meritFcn,tolSet,NumTrials=100);

    Input Arguments

    collapse all

    Tolerance set to which to add the tolerance, specified as an opticalToleranceSet object.

    Component tilt property to which to apply the tolerance, specified as "TiltX", "TiltY", or "TiltZ".

    Data Types: char | string

    Tolerance value, specified as a numeric scalar or a 1-by-2 numeric vector of the form [min max].

    • Scalar — Specifies a percentage tolerance relative to the nominal value.

    • 1-by-2 vector — Specifies an offset tolerance range [min max] relative to the nominal value.

    Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

    Component indices to target, specified as a vector of positive integers. By default, the tolerance applies to all top-level components. This function does not support tolerancing for nested components.

    Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

    Output Arguments

    collapse all

    Updated tolerance set, returned as an opticalToleranceSet object with the component tilt tolerance appended. This function adds a ComponentTiltTolerance object to the Tolerances property of tolSet and appends the details of the tolerance to the ToleranceTable property of tolSet.

    Version History

    Introduced in R2026b