LaPDXYTransformο
- class bapsf_motion.transform.lapd.LaPDXYTransform(drive, *, pivot_to_center: float, pivot_to_drive: float, pivot_to_feedthru: float, probe_axis_offset: float, drive_polarity: Tuple[int, int] = (1, 1), mspace_polarity: Tuple[int, int] = (-1, 1), droop_correct: bool = False, droop_scale: int | float = 1.0)ο
Bases:
BaseTransformClass that defines a coordinate transform for a LaPD XY probe drive.
transform type:
'lapd_xy'- Parameters:
drive (
Drive) β The instance ofDrivethe coordinate transformer will be working with.pivot_to_center (
float) β Distance from the center of the LaPD to the center βpivotβ point of the ball valve. A positive value indicates the probe drive is set up on the East side of the LaPD and a negative value indicates the West side.pivot_to_drive (
float) β Distance from the center line of the probe drive vertical axis to the center βpivotβ point of the ball valve.pivot_to_feedthru (
float) β Distance from the center βpivotβ point of the ball valve to the nearest face of the probe drive feed-through.probe_axis_offset (
float) β Perpendicular distance from the center line of the probe shaft to the probe drive pivot point on the vertical axis.drive_polarity (2D tuple, optional) β A two element tuple of +/- 1 values indicating the polarity of the probe drive motion to how the math was done for the underlying matrix transformations. For example, a value of
(1, 1)would indicate that positive movement (in probe drive coordinates) of the drive would be inwards and downwards. However, this is inconsistent if the vertical axis has the motor mounted to the bottom of the axis. In this case thedrive_polaritywould be(1, -1). (DEFAULT:(1, 1))mspace_polarity (2D tuple, optional) β A two element tuple of +/- 1 values indicating the polarity of the motion space motion to how the math was done for the underlying matrix transformations. For example, a value of
(-1, 1)for a probe mounted on an East port would indicate that inward probe drive movement would correspond to a LaPD -X movement and downward probe drive movement would correspond to LaPD +Y. If the probe was mounted on a West port then the polarity would need to be(1, 1)since inward probe drive movement corresponds to +X LaPD coordinate movement. (DEFAULT:(-1, 1))droop_correct (bool) β Set
Truefor the coordinate transform to correct for the droop of a probe shaft. This will useLaPDXYDroopCorrectto correct for the droop of a stainless steel 304 probe shaft of size .375β OD x 0.035β wall. SetFalsefor no droop correction. (DEFAULT:False)droop_scale (
float) β (DEFAULT1.0) A float>= 0.0indicating how much to scale the droop calculation by. A value of0would indicate no droop. A value between0and1indicates a droop less than the default model. A value of1indicates the default model droop. A value> 1indicates more droop.
Examples
Letβs set up a transformer for a probe drive mounted on an east port. In this case the vertical axis motor is mounted at the top of the vertical axis. (Values are NOT accurate to actual LaPD values.)
tr = LaPDXYTransform( drive, pivot_to_center = 62.94, pivot_to_drive = 133.51, pivot_to_feedthru = 21.6, probe_axis_offset = 20.16, drive_polarity = (1, 1), mspace_polarity = (-1, 1), )
tr = transform_factory( drive, tr_type = "lapd_xy", **{ "pivot_to_center": 62.94, "pivot_to_drive": 133.51, "pivot_to_feedthru": 21.6, "probe_axis_offset": 20.16, "drive_polarity": (1, 1), "mspace_polarity": (-1, 1), }, )
[...transform] type = "lapd_xy" pivot_to_center = 62.94 pivot_to_drive = 133.51 pivot_to_feedthru = 21.6 probe_axis_offset = 20.16 drive_polarity = [1, 1] mspace_polarity = [-1, 1]
config["transform"] = { "type": "lapd_xy", "pivot_to_center": 62.94, "pivot_to_drive": 133.51, "pivot_to_feedthru": 21.6, "probe_axis_offset": 20.16, "drive_polarity": (1, 1), "mspace_polarity": (-1, 1), }
Now, letβs do the same thing for a probe drive mounted on a West port and has the vertical axis motor mounted at the base.
tr = LaPDXYTransform( drive, pivot_to_center = -62.94, pivot_to_drive = 133.51, pivot_to_feedthru = 21.6, probe_axis_offset = 20.16, drive_polarity = (1, -1), mspace_polarity = (1, 1), )
tr = transform_factory( drive, tr_type = "lapd_xy", **{ "pivot_to_center": -62.94, "pivot_to_drive": 133.51, "pivot_to_feedthru": 21.6, "probe_axis_offset": 20.16, "drive_polarity": (1, -1), "mspace_polarity": (1, 1), }, )
[...transform] type = "lapd_xy" pivot_to_center = -62.94 pivot_to_drive = 133.51 pivot_to_feedthru = 21.6 probe_axis_offset = 20.16 drive_polarity = [1, -1] mspace_polarity = [1, 1]
config["transform"] = { "type": "lapd_xy", "pivot_to_center": -62.94, "pivot_to_drive": 133.51, "pivot_to_feedthru": 21.6, "probe_axis_offset": 20.16, "drive_polarity": (1, -1), "mspace_polarity": (1, 1), }
Attributes Summary
A list of axis identifiers.
A dictionary containing the coordinate transformation configuration.
The designed dimensionality of the transform.
A two element array of +/- 1 values indicating the polarity of the probe drive motion to how the math was done for the underlying matrix transformations.
Scale value for how much to adjust the droop from the default model.
A two element array of +/- 1 values indicating the polarity of the motion space motion to how the math was done for the underlying matrix transformations.
The number of axes of the probe drive.
Distance from the center of the LaPD to the center "pivot" point of the ball valve.
Distance from the center line of the probe drive vertical axis to the center "pivot" point of the ball valve.
Perpendicular distance from the center line of the probe shaft to the probe drive pivot point on the vertical axis.
String naming the coordinate transformation type.
Methods Summary
__call__(points[,Β to_coords])Perform a coordinate transformation on the supplied
points.matrix(points[,Β to_coords])The transformation matrix used to transform from probe drive coordinates to motion space coordinates, and vice versa.
Attributes Documentation
- axesο
A list of axis identifiers.
- configο
A dictionary containing the coordinate transformation configuration.
- deployed_sideο
- dimensionalityο
The designed dimensionality of the transform. If
-1, then the transform does not have a fixed dimensionality, and it can morph to the associatedDrive.
- drive_polarityο
A two element array of +/- 1 values indicating the polarity of the probe drive motion to how the math was done for the underlying matrix transformations.
For example, a value of
[1, 1]would indicate that positive movement (in probe drive coordinates) of the drive would be inwards and downwards. However, this is inconsistent if the vertical axis has the motor mounted to the bottom of the axis. In this case thedrive_polaritywould be(1, -1).
- droop_correctο
- droop_scaleο
Scale value for how much to adjust the droop from the default model.
- mspace_polarityο
A two element array of +/- 1 values indicating the polarity of the motion space motion to how the math was done for the underlying matrix transformations.
For example, a value of
(-1, 1)for a probe mounted on an East port would indicate that inward probe drive movement would correspond to a LaPD -X movement and downward probe drive movement would correspond to LaPD +Y. If the probe was mounted on a West port then the polarity would need to be(1, 1)since inward probe drive movement corresponds to +X LaPD coordinate movement.
- naxesο
The number of axes of the probe drive.
This is the same as the motion space dimensionality.
- pivot_to_centerο
Distance from the center of the LaPD to the center βpivotβ point of the ball valve.
- pivot_to_driveο
Distance from the center line of the probe drive vertical axis to the center βpivotβ point of the ball valve.
- pivot_to_feedthruο
- probe_axis_offsetο
Perpendicular distance from the center line of the probe shaft to the probe drive pivot point on the vertical axis.
- transform_typeο
String naming the coordinate transformation type. This is unique among all subclasses of
BaseTransform.
Methods Documentation
- __call__(points, to_coords='drive') ndarrayο
Perform a coordinate transformation on the supplied
points.- Parameters:
points (array_like) β A single point or array of points for which the transformation will be generated. The array of points needs to be of size \(M\) or \(N \times M\) where \(M\) is the dimensionality of the motion space and \(N\) is the number of points to be transformed.
to_coords (
str) β If"drive", then generate a transformation matrix that converts motion space coordinates to probe drive coordinates. If"motion space", then generate a transformation matrix that converts probe drive coordinates to motion space coordinates. (DEFAULT:"drive")
- Returns:
tr_points β The points calculated from the coordinate transformation of
points. The returned array has the same dimensionality aspoints.- Return type:
- matrix(points, to_coords='drive') ndarrayο
The transformation matrix used to transform from probe drive coordinates to motion space coordinates, and vice versa.
- Parameters:
points (array_like) β A single point or array of points for which the transformation matrix will be generated. The array of points needs to be of size \(M\) or \(N \times M\) where \(M\) is the dimensionality of the motion space and \(N\) is the number of points to be transformed.
to_coords (
str) β If"drive", then generate a transformation matrix that converts motion space coordinates to probe drive coordinates. If"motion space", then generate a transformation matrix that converts probe drive coordinates to motion space coordinates. (DEFAULT:"drive")
- Returns:
matrix β A transformation matrix of size \(N \times M+1 \times M+1\). The \(M+1\) dimensionality allows for the inclusion of a dimension for coordinate translations.
- Return type:
Notes
The generated matrix must have a dimensionality of \(N \times M+1 \times M+1\) where \(M\) is the dimensionality of the motion space and \(N\) is the number of points passed in. The +1 in the transformation matrix dimensionality corresponds to a dimension that allows for translational shifts in the coordinate transformation. For example, if a 2D probe drive is being used then the generated matrix for a single point would have a size of \(1 \times 3 \times 3\).
The matrix generation takes a
pointsargument because not all transformations are agnostic of the starting location, for example, the XY LaPD probe drive.