qcodes_contrib_drivers.drivers.Attocube package

Subpackages

Submodules

qcodes_contrib_drivers.drivers.Attocube.ANC300 module

QCoDeS- Driver for the Attocube ANC300 controller.

This driver can be used with a simulation class (ANC300sim.py) to generate reasonable answers to all requests. The only thing is to change two times the comments as shown below (real mode/simulation mode).

Attention - the device has not feedback from the motor. That means, the current position is not known. The driver can send a move command and the controller behaves like there is a motor connected to it, even if there is no motor available.

Author:

Michael Wagener, FZJ / ZEA-2, m.wagener@fz-juelich.de

class qcodes_contrib_drivers.drivers.Attocube.ANC300.ANC300(*args: Any, **kwargs: Any)[source]

Bases: VisaInstrument

This is the qcodes driver for the Attocube ANC300.

Be careful to correct the parameters if not useing the USB port.

Status:

coding: finished communication tests: done usage in experiment: not yet

ask_raw(cmd: str) str[source]

Query instrument with cmd and return response.

Parameters:

cmd – Command to write to controller.

Returns:

Response of Attocube controller to the query.

Raises:

RuntimeError – if Error-Message from the device is read.

close()[source]

Override of the base class’ close function

getall(submod='*')[source]

Read all parameters and retun them to the caller. This will scan all submodules with all parameters, so in this function no changes are necessary for new modules or parameters.

Parameters:

submod – (optional) returns only the parameters for this submodule

Returns:

dict with all parameters, the key is the modulename and the parametername

stopall()[source]

Routine to stop all axis, regardless if the axis is available

version()[source]

Read all possible version informations.

Parameters:

None

Returns:

Dict with all version informations

write_raw(cmd: str) None[source]

Write cmd and wait until the ‘OK’ or ‘ERROR’ comes back from the device.

Parameters:

cmd – Command to write to controller.

Returns:

None

Raises:

RuntimeError – if Error-Message from the device is read.

class qcodes_contrib_drivers.drivers.Attocube.ANC300.Anc300Axis(parent: ANC300, name: str, axis: int, sn: str)[source]

Bases: InstrumentChannel

__init__(parent: ANC300, name: str, axis: int, sn: str) None[source]

Creates a new Anc300Axis class instance.

The Attocube ANC300 piezo controller has up to 7 axis. Each of them are controlled by the same class.

Parameters:
  • parent – the internal QCoDeS name of the instrument this axis belongs to

  • name – the internal QCoDeS name of the axis itself

  • axis – the Index of the axis (1..7)

  • sn – serial number of the axis controller to change some features

frequency

Set the frequency of the output signal. The maximum is restricted by the combination of output voltage and Capacitance of the piezo actuators.

amplitude

Set the maximum level of the output signal.

voltage

(Readonly) Reads the current stepping voltage.

offset

Add a constant voltage to the output signal. Attention: the output level is only from 0 to 150 V.

filter

Set the filter frequency of the internal low pass filter. For the ANM150 this attribute is not present. For the ANM200 and ANM300 this attribute has different allowed values.

mode

Setting to a certain mode typically switches other functionalities off. ‘gnd’: Setting to this mode diables all outputs and connects them to chassis mass. ‘inp’: (Not for ANM150) In this mode, AC-IN and DC-IN can be enabled using the specific attributes. Setting to inp mode disables stepping and offset modes. ‘cap’: Setting to cap mode starts a capacitance measurement. The axis returns to gnd mode afterwards. It is not needed to switch to gnd mode before. ‘stp’: This enables stepping mode. AC-IN and DC-IN functionalities are not modified, while an offset function would be turned off. ‘off’: This enables offset mode. AC-IN and DC-IN functionalities are not modified, while any stepping would be turned off. ‘stp+’: This enables additive offset + stepping mode. Stepping waveforms are added to an offset. AC-IN and DC-IN functionalities are not modified. ‘stp-’: This enables subtractive offset + stepping mode. Stepping waveforms are subtracted from an offset. AC-IN and DC-IN functionalities, are not modified.

ac

When switching on the AC-IN feature, a voltage of up to 10 VAC can be added to the output (gain 1, no amplification) using the AC-IN BNC on the frontplate of the module.

dc

When switching on the DC-IN feature, a voltage in the range -10 .. +10 V can be added to the output. The gain is 15.

move

Start the movement with the given steps. For moving out use positive numbers and to move in use negative numbers.

start

Start a continous movement in the given direction.

triggerUp

Set/get input trigger up number on axis

triggerDown

Set/get input trigger down number on axis

stopMove()[source]

Global function to stop the movement.

waitMove(wait=1.0, timeout=0)[source]

Global function to wait until the movement is finished.

The commandinterface has the function ‘stepw n’ to wait until the axis stops moving. The controller sends the ‘OK’ after the axis stops, so the communication is hanging. In the former version with the pyserial interface, it will work fine. But the visa library throws an error if the communication timed out. After this, the read function didn’t get the needed ‘OK’. To avoid this, this routine asks the current output voltage. This voltage will be zero if the axis has stopped.

Parameters:
  • wait – time to wait between the checks

  • timeout – number of seconds to generate a RuntimeError if not finished moving

Returns:

None. This function will block, until the motion of this axis has been stopped.

class qcodes_contrib_drivers.drivers.Attocube.ANC300.Anc300TriggerOut(parent: ANC300, name: str, num: int)[source]

Bases: InstrumentChannel

__init__(parent: ANC300, name: str, num: int) None[source]

The Attocube ANC300 piezo controller has three trigger outputs.

This function cannot be tested because this function belongs to a specific controller feature code. This code was not available during the tests.

Parameters:
  • parent – the internal QCoDeS name of the instrument this output belongs to

  • name – the internal QCoDeS name of the output itself

  • num – the Index of the trigger output

state

Set / get the state of the output

qcodes_contrib_drivers.drivers.Attocube.ANC300sim module

QCoDeS- Simulation for the Attocube ANC300 controller.

Simulation for the Attocube ANC300 driver in the same way as it is used in our lab.

Author:

Michael Wagener, FZJ / ZEA-2, m.wagener@fz-juelich.de

class qcodes_contrib_drivers.drivers.Attocube.ANC300sim.MockVisa(*args: Any, **kwargs: Any)[source]

Bases: VisaInstrument

set_address(address)[source]

Set the address for this instrument.

Parameters:

address – The visa resource name to use to connect. The address should be the actual address and just that. If you wish to change the backend for VISA, use the self.visalib attribute (and then call this function).

class qcodes_contrib_drivers.drivers.Attocube.ANC300sim.MockVisaHandle[source]

Bases: object

Simulate the API needed for the communication.

ask(cmd)[source]
clear()[source]
close()[source]
query(cmd)[source]
read()[source]

Reads data from device or interface synchronously.

write(data)[source]

Writes data to device or interface synchronously.

cmddef = {'geta 1': ['voltage = 0.000000 V'], 'geta 2': ['voltage = 0.000000 V'], 'geta 3': ['Wrong axis type', 'ERROR'], 'geta 4': ['Wrong axis type', 'ERROR'], 'geta 5': ['Wrong axis type', 'ERROR'], 'geta 6': ['Wrong axis type', 'ERROR'], 'geta 7': ['Wrong axis type', 'ERROR'], 'getaci 1': ['acin = off'], 'getaci 2': ['acin = off'], 'getaci 3': ['Wrong axis type', 'ERROR'], 'getaci 4': ['Wrong axis type', 'ERROR'], 'getaci 5': ['Wrong axis type', 'ERROR'], 'getaci 6': ['Wrong axis type', 'ERROR'], 'getaci 7': ['Wrong axis type', 'ERROR'], 'getc 1': ['cap = 5 nF'], 'getc 2': ['cap = 5 nF'], 'getc 3': ['Wrong axis type', 'ERROR'], 'getc 4': ['Wrong axis type', 'ERROR'], 'getc 5': ['Wrong axis type', 'ERROR'], 'getc 6': ['Wrong axis type', 'ERROR'], 'getc 7': ['Wrong axis type', 'ERROR'], 'getcser': ['ANC300B-C-1514-3006076'], 'getdci 1': ['dcin = off'], 'getdci 2': ['dcin = off'], 'getdci 3': ['Wrong axis type', 'ERROR'], 'getdci 4': ['Wrong axis type', 'ERROR'], 'getdci 5': ['Wrong axis type', 'ERROR'], 'getdci 6': ['Wrong axis type', 'ERROR'], 'getdci 7': ['Wrong axis type', 'ERROR'], 'getf 1': ['frequency = 210 Hz'], 'getf 2': ['frequency = 210 Hz'], 'getf 3': ['Wrong axis type', 'ERROR'], 'getf 4': ['Wrong axis type', 'ERROR'], 'getf 5': ['Wrong axis type', 'ERROR'], 'getf 6': ['Wrong axis type', 'ERROR'], 'getf 7': ['Wrong axis type', 'ERROR'], 'getm 1': ['mode = gnd'], 'getm 2': ['mode = gnd'], 'getm 3': ['Wrong axis type', 'ERROR'], 'getm 4': ['Wrong axis type', 'ERROR'], 'getm 5': ['Wrong axis type', 'ERROR'], 'getm 6': ['Wrong axis type', 'ERROR'], 'getm 7': ['Wrong axis type', 'ERROR'], 'getser 1': ['ANM150A-M-1545-3010045'], 'getser 2': ['ANM150A-M-1545-3010041'], 'getser 3': ['Wrong axis type', 'ERROR'], 'getser 4': ['Wrong axis type', 'ERROR'], 'getser 5': ['Wrong axis type', 'ERROR'], 'getser 6': ['Wrong axis type', 'ERROR'], 'getser 7': ['Wrong axis type', 'ERROR'], 'gettd 1': ['trigger = 1'], 'gettd 2': ['trigger = 3'], 'gettd 3': ['Wrong axis type', 'ERROR'], 'gettd 4': ['Wrong axis type', 'ERROR'], 'gettd 5': ['Wrong axis type', 'ERROR'], 'gettd 6': ['Wrong axis type', 'ERROR'], 'gettd 7': ['Wrong axis type', 'ERROR'], 'gettu 1': ['trigger = off'], 'gettu 2': ['trigger = 2'], 'gettu 3': ['Wrong axis type', 'ERROR'], 'gettu 4': ['Wrong axis type', 'ERROR'], 'gettu 5': ['Wrong axis type', 'ERROR'], 'gettu 6': ['Wrong axis type', 'ERROR'], 'gettu 7': ['Wrong axis type', 'ERROR'], 'getv 1': ['voltage = 20.000000 V'], 'getv 2': ['voltage = 20.000000 V'], 'getv 3': ['Wrong axis type', 'ERROR'], 'getv 4': ['Wrong axis type', 'ERROR'], 'getv 5': ['Wrong axis type', 'ERROR'], 'getv 6': ['Wrong axis type', 'ERROR'], 'getv 7': ['Wrong axis type', 'ERROR'], 'stepd 1': ['0'], 'stepd 2': ['0'], 'stepu 1': ['0'], 'stepu 2': ['0'], 'ver': ['attocube ANC300 controller version 1.1.0-1304 2013-10-17 08:16', 'ANC150 compatibillity console']}

qcodes_contrib_drivers.drivers.Attocube.ANC350 module

class qcodes_contrib_drivers.drivers.Attocube.ANC350.ANC350(*args: Any, **kwargs: Any)[source]

Bases: Instrument

Qcodes driver for the ANC350

Parameters:
  • name – the name of the instrument itself

  • library – library that fits to the version of the device and provides the appropriate dll wrappers

  • inst_no – Sequence number of the device to connect to (default: 0, the first device found)

close() None[source]

Closes the connection to the device. The device handle becomes invalid.

get_idn() Dict[str, str | None][source]

Returns a dictionary with information about the device

Returns:

A dictionary containing vendor, model, serial number and firmware version

save_params() None[source]

Saves parameters to persistent flash memory in the device. They will be present as defaults after the next power-on.

class qcodes_contrib_drivers.drivers.Attocube.ANC350.Anc350Axis(parent: ANC350, name: str, axis: int)[source]

Bases: InstrumentChannel

Representation of an axis of the ANC350

The Attocube ANC350 has 3 axis, one for every direction.

Parameters:
  • parent – the Instrument that the channel is attached to

  • name – the name of the axis itself

  • axis – the index of the axis (0..2)

position

Get the current position on a single axis

frequency

Set the frequency of the output signal. Depending on positioner type and usage of other axes one can adjust the frequency from 1Hz up to 5kHz (only on one axis at one time is a frequency above 2kHz allowed)

amplitude

Value for the drive voltage of the piezo drive. Bychanging this value, the step size of the positioner can be varied. Value for the drive voltage of the piezo drive. Bychanging this value, the step size of the positioner can be varied.

status
voltage

Sets the DC level on the voltage output when no sawtooth based motion and no feedback loop is active.

target_position

Sets the target position for automatic motion (start_auto_move). For linear type actuators the position unit is m, for goniometers and rotators it is degree.

target_range

Defines the range around the target position where the target is considered to be reached.

actuator

Selects the actuator to be used for the axis from actuator presets.

actuator_name

Get the name of the currently selected actuator

capacitance

Performs a measurement of the capacitance of the piezo motor and returns the result. If no motor is connected, the result will be 0. The function doesn’t return before the measurement is complete; this will take a few seconds of time.

disable_auto_move() None[source]

Disables automatic moving

enable_auto_move(relative: bool | str | None = None) None[source]

Enables automatic moving

Parameters:

relative – If the target position is to be interpreted absolute (False) or relative to the current position (True).

multiple_steps(steps: int) None[source]

Performs multiple steps. The direction depends on the sign (+: forward, -: backward)

Parameters:

steps – Number of steps to move. The sign indicates the moving direction (+: forward, -: backward)

single_step(backward: bool | str | int | None = None) None[source]

Triggers a single step in desired direction.

Parameters:

backward – Step direction forward (False) or backward (True). Beside True/False, you can set the direction to “forward”/”backward” or +1/-1 (default: forward or False)

start_continuous_move(backward: bool | str | int | None = None) None[source]

Starts continuous motion in forward or backward direction. Other kinds of motion are stopped.

Parameters:

backward – Step direction forward (False) or backward (True). Beside True/False, you can set the direction to “forward”/”backward” or +1/-1 (default: forward or False)

stop_continuous_move() None[source]

Stops continuous motion in forward or backward direction.

Module contents