Positioner calibration#

Positioners are shipped calibrated but it’s possible that the calibration needs to be redone over their lifetime. The calibration procedure runs through the motor, datums, and cogging calibrations, and then saves the configuration to the positioner EPROM.

Performing calibration on a positioner#

The calibration steps can be commanded independently while in normal mode (no bootloader):

  • Motor calibration: command StartMotorCalibration. Wait until DISPLACEMENT_COMPLETED, MOTOR_ALPHA_CALIBRATED, and MOTOR_BETA_CALIBRATED are set.

  • Datums calibration: command StartDatumCalibration. Wait until DISPLACEMENT_COMPLETED, DATUM_ALPHA_CALIBRATED, and DATUM_BETA_CALIBRATED are set.

  • Cogging torque calibration: command StartCoggingCalibration. Wait until COGGING_ALPHA_CALIBRATED and COGGING_BETA_CALIBRATED are set. This step can take 20+ minutes.

  • Save calibration: command SaveInternalCalibration.

Normally the calibration is done using the calibrate_positioner coroutine. For example

>>> from jaeger import FPS
>>> from jaeger.commands import calibrate_positioner
>>> fps = await FPS().initialise()
>>> calibrate_positioner(fps, 31)

This can be conveniently run from the command line as

$ jaeger calibrate 31

API#

async jaeger.commands.calibration.calibrate_positioners(fps, axis, positioner_ids, motors=True, datums=True, cogging=True)[source]

Runs the calibration process and saves it to the internal memory.

Parameters:
  • fps (FPS) – The instance of FPS that will receive the trajectory.

  • axis (str) – The axis to calibrate, either "alpha", "beta", or "both".

  • positioner_id – The ID of the positioner(s) to calibrate.

  • motors (bool) – Whether to perform the motor calibration.

  • datums (bool) – Whether to perform the datums calibration.

  • cogging (bool) – Whether to perform the cogging calibration (may take more than one hour).

  • positioner_ids (int | list[int]) –

Raises:

JaegerError – If encounters a problem during the process.

Examples

>>> fps = FPS()
>>> await fps.initialise()

# Calibrate positioner 31.
>>> await calibrate_positioner(fps, 31)
class jaeger.commands.calibration.StartDatumCalibration(positioner_ids, timeout=None, done_callback=None, n_positioners=None, data=None, ignore_unknown=True)[source]

Bases: Command

Indicates that the transmission for the trajectory has ended.

Parameters:
  • positioner_ids (int | List[int]) –

  • timeout (float) –

  • done_callback (Optional[Callable]) –

  • n_positioners (Optional[int]) –

  • data (Union[None, data_co, Dict[int, data_co]]) –

  • ignore_unknown (bool) –

command_id: CommandID = 23

The id of the command.

broadcastable: bool = False

Whether the command can be broadcast to all robots.

move_command = True

Whether this command produces a positioner move.

class jaeger.commands.calibration.StartMotorCalibration(positioner_ids, timeout=None, done_callback=None, n_positioners=None, data=None, ignore_unknown=True)[source]

Bases: Command

Aborts sending a trajectory.

Parameters:
  • positioner_ids (int | List[int]) –

  • timeout (float) –

  • done_callback (Optional[Callable]) –

  • n_positioners (Optional[int]) –

  • data (Union[None, data_co, Dict[int, data_co]]) –

  • ignore_unknown (bool) –

command_id: CommandID = 26

The id of the command.

broadcastable: bool = False

Whether the command can be broadcast to all robots.

move_command = True

Whether this command produces a positioner move.

class jaeger.commands.calibration.StartCoggingCalibration(positioner_ids, timeout=None, done_callback=None, n_positioners=None, data=None, ignore_unknown=True)[source]

Bases: Command

Starts the trajectories.

Parameters:
  • positioner_ids (int | List[int]) –

  • timeout (float) –

  • done_callback (Optional[Callable]) –

  • n_positioners (Optional[int]) –

  • data (Union[None, data_co, Dict[int, data_co]]) –

  • ignore_unknown (bool) –

command_id: CommandID = 47

The id of the command.

broadcastable: bool = False

Whether the command can be broadcast to all robots.

move_command = True

Whether this command produces a positioner move.

class jaeger.commands.calibration.SaveInternalCalibration(positioner_ids, timeout=None, done_callback=None, n_positioners=None, data=None, ignore_unknown=True)[source]

Bases: Command

Stop the trajectories.

Parameters:
  • positioner_ids (int | List[int]) –

  • timeout (float) –

  • done_callback (Optional[Callable]) –

  • n_positioners (Optional[int]) –

  • data (Union[None, data_co, Dict[int, data_co]]) –

  • ignore_unknown (bool) –

command_id: CommandID = 53

The id of the command.

broadcastable: bool = False

Whether the command can be broadcast to all robots.

move_command = False

Whether this command produces a positioner move.

class jaeger.commands.calibration.HallOn(positioner_ids, timeout=None, done_callback=None, n_positioners=None, data=None, ignore_unknown=True)[source]

Bases: Command

Turns hall sensors ON.

Parameters:
  • positioner_ids (int | List[int]) –

  • timeout (float) –

  • done_callback (Optional[Callable]) –

  • n_positioners (Optional[int]) –

  • data (Union[None, data_co, Dict[int, data_co]]) –

  • ignore_unknown (bool) –

command_id: CommandID = 116

The id of the command.

broadcastable: bool = False

Whether the command can be broadcast to all robots.

move_command = False

Whether this command produces a positioner move.

safe = True

Whether it’s safe to execute this command when the FPS is locked.

class jaeger.commands.calibration.HallOff(positioner_ids, timeout=None, done_callback=None, n_positioners=None, data=None, ignore_unknown=True)[source]

Bases: Command

Turns hall sensors ON.

Parameters:
  • positioner_ids (int | List[int]) –

  • timeout (float) –

  • done_callback (Optional[Callable]) –

  • n_positioners (Optional[int]) –

  • data (Union[None, data_co, Dict[int, data_co]]) –

  • ignore_unknown (bool) –

command_id: CommandID = 117

The id of the command.

broadcastable: bool = False

Whether the command can be broadcast to all robots.

move_command = False

Whether this command produces a positioner move.

safe = True

Whether it’s safe to execute this command when the FPS is locked.