Polargraph#
- class QPolargraph.hardware.Polargraph.Polargraph(pitch=2.0, circumference=25, steps=200, ell=1.0, y0=0.1, speed=100.0, **kwargs)[source]#
Bases:
MotorsBase implementation for a polargraph scanner.
Extends
Motorswith the belt-drive geometry to convert between motor step-index space and Cartesian coordinates in metres. The payload hangs from the midpoint of a GT2 timing belt whose ends are wound on toothed gears driven by two Nema-17 stepper motors mounted above and to either side of the scan area.Properties#
- ellfloat
Separation between the two motor pulleys [m].
- y0float
Vertical distance from the pulleys to the home position [m].
- pitchfloat
Tooth pitch of the GT2 timing belt [mm]. Default: 2.
- circumferenceint
Number of belt teeth per full revolution of the gear. Default: 25.
- stepsint
Motor steps per revolution. Default: 200.
- speedfloat
Maximum translation speed [steps/s].
- dsfloat
Distance travelled per motor step [m]. Read-only.
- s0float
Belt length from pulley to payload at home position [m]. Read-only.
- positionnumpy.ndarray
Current Cartesian coordinates
(x, y, running)[m, m, flag]. Read-only.
- moveTo(x, y)[source]#
Move the payload to coordinates
(x, y)[m] measured from the home position, adjusting motor speeds so both arrive simultaneously.
References
H. W. Gao, K. I. Mishra, A. Winters, S. Wolin, and D. G. Grier, “Flexible wide-field high-resolution scanning camera for continuous-wave acoustic holography,” Rev. Sci. Instrum. 89, 114901 (2018). https://doi.org/10.1063/1.5053666
- r2f(x, y)[source]#
Convert Cartesian coordinates to continuous step indexes.
This is the exact (non-rounded) inverse of
i2r(), useful for trajectory interpolation. To obtain integer motor targets suitable forgoto(), round the result.
- i2r(m, n, *args)[source]#
Convert motor step indexes to Cartesian coordinates [m].
Works with scalar or array inputs for
mandn. When called with arrays,*argsmust be empty or also array-valued with a matching shape.- Parameters:
m (int, float, or numpy.ndarray) – Step index (or array of indexes) for motor 1.
n (int, float, or numpy.ndarray) – Step index (or array of indexes) for motor 2.
*args – Extra values appended to the result array (e.g. running flag).
len(result) == 2 + len(args).
- Return type:
- Returns:
numpy.ndarray –
[x, y, *args]Cartesian position [m] plus any extra payload supplied via*args.
- moveTo(x, y)[source]#
Move the payload to position
(x, y)[m].Computes the target step indexes and adjusts both motor speeds so they complete their moves simultaneously, accounting for AccelStepper trapezoidal ramp times.
- Parameters:
x (float) – Target horizontal coordinate [m].
y (float) – Target vertical coordinate [m].
- Return type: