The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Lab::Instrument::Source - Base class for voltage source instruments

SYNOPSIS

DESCRIPTION

This class implements a general voltage source, if necessary with several channels. It is meant to be inherited by instrument classes (virtual instruments) that implement real voltage sources (e.g. the Lab::Instrument::Yokogawa7651 class).

The class provides a unified user interface for those virtual voltage sources to support the exchangeability of instruments.

Additionally, this class provides a safety mechanism called gate_protect to protect delicate samples. It includes automatic limitations of sweep rates, voltage step sizes, minimal and maximal voltages.

The only user application of this class is to define a voltage source object which represents a single channel of a multi-channel voltage source. Otherwise, you will always have to instantiate classes derived from Lab::Instrument::Source.

CONSTRUCTOR

  $self=new Lab::Instrument::Source($multisource, $channel);
  $self=new Lab::Instrument::Source($multisource, $channel, \%config);

This constructor can be used to create a source object which represents channel $channel of the multi-channel voltage source $multisource. The default configuration of this source is the configuration of $multisource; it can be partially or entirely overridden with an additional \%config hash.

  $self=new Lab::Instrument::Source(\%default_config,\%config);

This constructor will only be used by instrument drivers that inherit this class, not by the user.

The instrument driver (e.g. Lab::Instrument::KnickS252) has a constructor like this:

  $knick=new Lab::Instrument::KnickS252({
    GPIB_board      => $board,
    GPIB_address    => $address,
    
    gate_protect    => $gp,
    [...]
  });

METHODS

configure

  $self->configure(\%config);

Supported configure options:

fast_set

This parameter controls the return value of the set_voltage function and can be set to 0 (off, default) or 1 (on). For fast_set off, set_voltage first requests the hardware to set the voltage, and then reads out the actually set voltage via get_voltage. The resulting number is returned. For fast_set on, set_voltage requests the hardware to set the voltage and returns without double-check the requested value. This, albeit less secure, may speed up measurements a lot.

gate_protect

Whether to use the automatic sweep speed limitation. Can be set to 0 (off) or 1 (on). If it is turned on, the output voltage will not be changed faster than allowed by the gp_max_volt_per_second, gp_max_volt_per_step and gp_max_step_per_second values. These three parameters overdefine the allowed speed. Only two parameters are necessary. If all three are set, the smallest allowed sweep rate is chosen.

Additionally the maximal and minimal output voltages are limited.

This mechanism is useful to protect sensible samples that are destroyed by abrupt voltage changes. One example is gate electrodes on semiconductor electronics samples, hence the name.

gp_max_volt_per_second

How much the output voltage is allowed to change per second.

gp_max_volt_per_step

How much the output voltage is allowed to change per step.

gp_max_step_per_second

How many steps are allowed per second.

gp_min_volt

The smallest allowed output voltage.

gp_max_volt

The largest allowed output voltage.

qp_equal_level

Voltages with a difference less than this value are considered equal.

set_voltage

  $new_volt=$self->set_voltage($voltage);

Sets the output to $voltage (in Volts). If the configure option gate_protect is set to a true value, the safety mechanism takes into account the gp_max_volt_per_step, gp_max_volt_per_second etc. settings, by employing the sweep_to_voltage method.

Returns for fast_set off the actually set output voltage. This can be different from $voltage, due to the gp_max_volt, gp_min_volt settings. For fast_set on, set_voltage returns always $voltage.

For a multi-channel device, add the channel number as a parameter:

  $new_volt=$self->set_voltage($voltage,$channel);

step_to_voltage

  $new_volt=$self->step_to_voltage($voltage);
  $new_volt=$self->step_to_voltage($voltage,$channel);

Makes one safe step in direction to $voltage. The output voltage is not changed by more than gp_max_volt_per_step. Before the voltage is changed, the methods waits if not enough times has passed since the last voltage change. For step voltage and waiting time calculation, the larger of gp_max_volt_per_second or gp_max_step_per_second is ignored (see code).

Returns the actually set output voltage. This can be different from $voltage, due to the gp_max_volt, gp_min_volt settings.

sweep_to_voltage

  $new_volt=$self->sweep_to_voltage($voltage);
  $new_volt=$self->sweep_to_voltage($voltage,$channel);

This method sweeps the output voltage to the desired value and only returns then. Uses the "step_to_voltage" method internally, so all discussions of config options from there apply too.

Returns the actually set output voltage. This can be different from $voltage, due to the gp_max_volt, gp_min_volt settings.

get_voltage

  $new_volt=$self->get_voltage();
  $new_volt=$self->get_voltage($channel);

Returns the voltage currently set.

CAVEATS/BUGS

Probably many.

SEE ALSO

Time::HiRes

Used internally for the sweep timing.

Lab::Instrument::KnickS252

This class inherits the gate protection mechanism.

Lab::Instrument::Yokogawa7651

This class inherits the gate protection mechanism.

AUTHOR/COPYRIGHT

This is $Id: Source.pm 650 2010-04-22 19:09:27Z schroeer $

 Copyright 2004-2008 Daniel Schröer (<schroeer@cpan.org>)
           2009-2010 Daniel Schröer, Andreas K. Hüttel (L<http://www.akhuettel.de/>) and Daniela Taubert

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

1 POD Error

The following errors were encountered while parsing the POD:

Around line 537:

Non-ASCII character seen before =encoding in 'Schröer'. Assuming CP1252