Skip to content

API Reference

pypiezosystemsjena.NV200D

NV200D(
    connection: Connection,
    port: str = None,
    ip_address: str = None,
    mac_address: str = None,
    timeout: float = 0.2,
)

A wrapper for class for the Piezosystems Jena NV200D (Net) piezo controller

Parameters:

  • connection (Connection) –

    type of connection with device

  • port (Optional[str], default: None ) –

    serial port

  • ip_address (Optional[str], default: None ) –

    i.p. address to find device

  • mac_address (Optional[str], default: None ) –

    mac address to search for

  • timeout (Optional[float], default: 0.2 ) –

    timeout for commands over serial connections

Examples:

Connection to an NV200 can be done via either serial or telnet.

nv = NV200D(psj.Connection.usb, port="/dev/ttyUSB0")
nv = NV200D(psj.Connection.ethernet, ip_address="192.168.188.71")
# i.p. address of network the controller is attached to
base_ip_address = "192.168.188.71"

MAC_address = "00:00:00:00:00:0A"

nv = NV200D(Connection.ethernet,
            ip_address=base_ip_address,
            mac_address=MAC_address)

Attributes

PID_feedforward_control_amplification property writable

PID_feedforward_control_amplification: Tuple[
    float, float, float
]

Feed forward control amplification for position, velocity and acceleration

Returns:

  • Tuple[float, float, float]

    A tuple of PID factors in the order ( position, velocity, acceleration)

PID_mode property writable

PID_mode: LoopMode

PID open or closed loop mode

control_mode property writable

control_mode: ControlMode

Access control mode of NV200D

data_recorder_autostart property writable

data_recorder_autostart: DataRecorderStartMode

doc

data_recorder_buffer_length property

data_recorder_buffer_length: int

doc

data_recorder_source property writable

data_recorder_source: Tuple[
    DataRecorderBuffer, DataRecorderSource
]

doc

data_recorder_stride property writable

data_recorder_stride: int

doc

fenable property writable

fenable: bool

Enable cycling through entire piezo voltage range during startup

ilc_desired_position_profile_frequency_domain property

ilc_desired_position_profile_frequency_domain

Desired position profile in frequency domain

ilc_learning_function_frequency_domain property

ilc_learning_function_frequency_domain

Learning function in frequency domain

ilc_learning_limit property writable

ilc_learning_limit: float

doc

ilc_learning_rate property writable

ilc_learning_rate: float

doc

ilc_measured_position_profile_frequency_domain property

ilc_measured_position_profile_frequency_domain

Measured position profile in frequency domain

ilc_number_of_basic_scans property writable

ilc_number_of_basic_scans: int

doc

ilc_number_of_frequency_components property writable

ilc_number_of_frequency_components: int

doc

ilc_number_of_subsamples property writable

ilc_number_of_subsamples: int

doc

ilc_piezo_current_profile_1_profile property

ilc_piezo_current_profile_1_profile

Piezo current_profile_1 profile in time domain

ilc_piezo_current_profile_2_profile property

ilc_piezo_current_profile_2_profile

Piezo current_profile_2 profile in time domain

ilc_piezo_measured_position_profile property

ilc_piezo_measured_position_profile

Piezo measured_position profile in time domain

ilc_piezo_voltage_profile property

ilc_piezo_voltage_profile

Piezo voltage profile in time domain

ilc_voltage_profile_frequency_domain property

ilc_voltage_profile_frequency_domain

Voltage profile in frequency domain

initial_actuator_position property writable

initial_actuator_position: int

Initial actuator position after power-up

lower_motion_range_limit property

lower_motion_range_limit: float

Lower motion range limit of piezo

lower_voltage_range_limit property

lower_voltage_range_limit: float

Lower voltage range limit of piezo

measured_current property

measured_current: Tuple[float, float]

Measured piezo current on each channel

modulation_source property writable

modulation_source: ModulationSource

Source of signal for setpoint

monitor_source property writable

monitor_source: MonitorSource

Source of data for analogue output

recording property writable

recording: bool

doc

set_point property writable

set_point: float

Actuator position to move to

slew_rate property writable

slew_rate: float

Maximum slew rate

spi_control_loop_interupt_source property writable

spi_control_loop_interupt_source: SPIControlLoopInterupt

doc

status property

status: dict

Get the current status of the controller

temperature property

temperature: float

Heat sink temperature

trigger_input_function property writable

trigger_input_function: TriggerInputFunction

Function to run on trigger input

triggering_edge property writable

triggering_edge: TriggerEdge

Which edge to trigger on

upper_motion_range_limit property

upper_motion_range_limit: float

Upper motion range limit of piezo

upper_voltage_range_limit property

upper_voltage_range_limit: float

Upper voltage range limit of piezo

Functions

apply_voltage

apply_voltage(voltage: float)

Voltage sent to the controller to apply to the acutator.

Requires that the the controller is operating in open-loop mode and will throw an assertion error otherwise. Voltages passed to this function are also required to be within the voltage range of controller, these can be found through NV200D.lower_voltage_range_limit for the lower limit and NV200D.upper_voltage_range_limit for the upper limit.

Parameters:

  • voltage (float) –

    set point for controller in volts

go_to_position

go_to_position(position: float)

Position sent to controller to move the acutator to.

Requires that the the controller is operating in closed-loop mode and will throw an assertion error otherwise. Positions passed to this function are also required to be within the movement range of controller, these can be found through NV200D.lower_motion_range_limit for the lower limit and NV200D.upper_motion_range_limit for the upper limit.

Parameters:

  • position (float) –

    set point for controller in mrad or µm

read_data_recorder

read_data_recorder(
    channel: DataRecorderBuffer,
    index: Optional[int] = None,
    length: Optional[int] = None,
)

Read the data from the buffer on chosen channel.

If index and length are not supplied the entire contents of the buffer will read out for the chosen buffer.

Parameters:

  • channel (DataRecorderBuffer) –

    data buffer

  • index (Optional[int], default: None ) –

    first value to read out of buffer

  • length (Optional[int, default: None ) –

    number of values to read out of buffer

Returns:

  • List[float]

    list of recorded data

pypiezosystemsjena.TipTilt

TipTilt(
    axis_x_connection: ControllerID,
    axis_y_connection: ControllerID,
)

Combines a pair of NV200D (Net) piezo controllers, providing joint control over a both x and y axes.

Parameters:

  • axis_x_connection (ControllerID) –

    connection details for x-axis

  • axis_y_connection (ControllerID) –

    connection details for y-axis

Examples:

Connect to two network attached NV200D driving a single mirror mount.

from pypiezosystemsjena import find_device,  TipTilt

# i.p. address of network adapter controllers are attached to
base_ip = "169.254.1.1"

# MAC addresses of controllers connected to mirror
mac_addresses = {
    "x": "00:00:00:00:00:0A,
    "y": "00:00:00:00:00:0B,
}

# get pairs of matching ip and mac address
controller_ids = find_device(mac_addresses, base_ip)

mirror = TipTilt(controller_ids["x"], controller_ids["y"])

Set closed-loop control

from pypiezosystemsjena import LoopMode
mirror.loop_mod = LoopMode.closed

Set a position to move the mirror to. This will depend on the type of control loop that has been chosen, as open loop control (default) expects set points to defined as voltages whereas closed-loop control allows the user to define set points in terms of positions with units defined by the type of piezo device attached to the controllers. Examples for both are given below:

from pypiezosystemsjena import LoopMode, ModulationSource

# positions in mrad or µm require closed loop operation
mirror.loop_mod = LoopMode.closed
mirror.modulation_source = ModulationSource.usb_or_ethernet

pos_x = 0.5
pos_y = -0.1

mirror.go_to_position(pos_x, pos_y)
from pypiezosystemsjena import LoopMode, ModulationSource

# positions in volts require open loop operation
mirror.loop_mod = LoopMode.open
mirror.modulation_source = ModulationSource.usb_or_ethernet

voltage_x = 10
voltage_y = 50

mirror.apply_voltage(voltage_x, voltage_y)

Attributes

loop_mode property writable

loop_mode: Dict[str, LoopMode]

Control mode both axes are set to

modulation_source property writable

modulation_source: ModulationSource

Modulation source for both axes

Functions

apply_voltage

apply_voltage(voltage_x: float, voltage_y: float)

Set voltage applied to both axes Args: voltage_x (float): set point for x-axis voltage_y (float): set point for y-axis

go_to_position

go_to_position(position_x: float, position_y: float)

Position to set both axes to Args: position_x (float): set point for x-axis position_y (float): set point for y-axis

pypiezosystemsjena.list_status_codes

list_status_codes(status: int) -> List[int]

Convert status bitset to list of active status codes

The NV200D controller maintains its status as a 16bit register of bit flags. For each high bit found in the bit set we return an integer from 0-15 to represent the relevent status code found.

Parameters:

  • status (int) –

    result of NV200D.status

Returns:

  • List[int]

    list of active codes

pypiezosystemsjena.current_status

current_status(status: int) -> dict

Parse NV200D statuse to dictionary of active statuses

Convert the result of NV200D.status to a dictionary of all status codes that could be available

Parameters:

  • status (int) –

    result of NV200D.status

Returns:

  • dict

    active statuses

pypiezosystemsjena.Connection

Bases: Enum

Connection type for NV200D

Used to specify use of serial port or network connection

Attributes

ethernet class-attribute instance-attribute

ethernet = 2

usb class-attribute instance-attribute

usb = 1

pypiezosystemsjena.ControlMode

Bases: Enum

Active control mode of NV200D

Attributes

feedback class-attribute instance-attribute

feedback = 3

feedforward class-attribute instance-attribute

feedforward = 2

identification class-attribute instance-attribute

identification = 1

pid class-attribute instance-attribute

pid = 0

pypiezosystemsjena.SensorType

Bases: Enum

Type of sensor fitted to current attached piezo device

Attributes

actuator_without_position_sensor class-attribute instance-attribute

actuator_without_position_sensor = 0

capacitve_sensor class-attribute instance-attribute

capacitve_sensor = 1

strain_guage_sensor class-attribute instance-attribute

strain_guage_sensor = 2

pypiezosystemsjena.LoopMode

Bases: Enum

Open or closed loop operation

Attributes

closed class-attribute instance-attribute

closed = 1

open class-attribute instance-attribute

open = 0

pypiezosystemsjena.ModulationSource

Bases: Enum

Source of control signal for device setpoint

Attributes

analogue_in class-attribute instance-attribute

analogue_in = 1

awg class-attribute instance-attribute

awg = 3

spi class-attribute instance-attribute

spi = 2

usb_or_ethernet class-attribute instance-attribute

usb_or_ethernet = 0

pypiezosystemsjena.MonitorSource

Bases: Enum

Source of data for analogue output

Attributes

absolute_position_error class-attribute instance-attribute

absolute_position_error = 4

piezo_current_1 class-attribute instance-attribute

piezo_current_1 = 6

piezo_current_2 class-attribute instance-attribute

piezo_current_2 = 7

piezo_voltage class-attribute instance-attribute

piezo_voltage = 2

position_close_loop class-attribute instance-attribute

position_close_loop = 0

position_error class-attribute instance-attribute

position_error = 3

position_open_loop class-attribute instance-attribute

position_open_loop = 5

setpoint class-attribute instance-attribute

setpoint = 1

pypiezosystemsjena.ArbitraryWaveformGeneratorRun

Bases: Enum

Set whether to start or stop the AWG

Attributes

start class-attribute instance-attribute

start = 1

stop class-attribute instance-attribute

stop = 0

pypiezosystemsjena.DataRecorderBuffer

Bases: Enum

Which data buffer to read from

Attributes

a class-attribute instance-attribute

a = 0

b class-attribute instance-attribute

b = 1

pypiezosystemsjena.DataRecorderSource

Bases: Enum

Source of data to be stored in data recorder buffer

Attributes

abs_position_error class-attribute instance-attribute

abs_position_error = 4

piezo_current_1 class-attribute instance-attribute

piezo_current_1 = 6

piezo_current_2 class-attribute instance-attribute

piezo_current_2 = 7

piezo_position class-attribute instance-attribute

piezo_position = 0

piezo_position_2 class-attribute instance-attribute

piezo_position_2 = 5

piezo_voltage class-attribute instance-attribute

piezo_voltage = 2

position_error class-attribute instance-attribute

position_error = 3

setpoint class-attribute instance-attribute

setpoint = 1

pypiezosystemsjena.DataRecorderStartMode

Bases: Enum

Autostart mode of data recorder

Attributes

grun class-attribute instance-attribute

grun = 2

off class-attribute instance-attribute

off = 0

set class-attribute instance-attribute

set = 1

pypiezosystemsjena.TriggerInputFunction

Bases: Enum

Function to run on trigger input

Attributes

awg_start class-attribute instance-attribute

awg_start = 1

awg_step class-attribute instance-attribute

awg_step = 2

awg_sync class-attribute instance-attribute

awg_sync = 3

ilc_sync class-attribute instance-attribute

ilc_sync = 4

none class-attribute instance-attribute

none = 0

start_data_recorder class-attribute instance-attribute

start_data_recorder = 5

pypiezosystemsjena.TriggerEdge

Bases: Enum

Edge to trigger on

Attributes

both class-attribute instance-attribute

both = 3

falling class-attribute instance-attribute

falling = 2

off class-attribute instance-attribute

off = 0

rising class-attribute instance-attribute

rising = 1

pypiezosystemsjena.SPIMonitor

Bases: Enum

Return value for SPI monitor

Attributes

abs_position_error class-attribute instance-attribute

abs_position_error = 5

piezo_current_1 class-attribute instance-attribute

piezo_current_1 = 7

piezo_current_2 class-attribute instance-attribute

piezo_current_2 = 8

piezo_voltage class-attribute instance-attribute

piezo_voltage = 3

position_closed_loop class-attribute instance-attribute

position_closed_loop = 1

position_error class-attribute instance-attribute

position_error = 4

position_open_loop class-attribute instance-attribute

position_open_loop = 6

setpoint class-attribute instance-attribute

setpoint = 2

zero class-attribute instance-attribute

zero = 0

pypiezosystemsjena.SPIControlLoopInterupt

Bases: Enum

PID control loop interupt source

Attributes

interal class-attribute instance-attribute

interal = 0

spi class-attribute instance-attribute

spi = 1

pypiezosystemsjena.SPISetpoint

Bases: Enum

Datatype of last received setpoint over SPI

Attributes

decimal class-attribute instance-attribute

decimal = 1

hex class-attribute instance-attribute

hex = 0

stroke_or_voltage class-attribute instance-attribute

stroke_or_voltage = 2

pypiezosystemsjena.LearningCorrectionType

Bases: Enum

Correction type in frequency domain of itertive learning control method

Attributes

no_learning class-attribute instance-attribute

no_learning = 0

offline_identification class-attribute instance-attribute

offline_identification = 1

online_identification class-attribute instance-attribute

online_identification = 2