NAME
Lab::Instrument::Source - Generic voltage source base class
VERSION
version 3.810
DESCRIPTION
This class implements a general voltage source, if necessary with several channels. It is meant to be inherited by instrument classes that implement real voltage sources (e.g. the Lab::Instrument::Yokogawa7651 class).
The class provides a unified user interface for those 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.
There's no direct user application of this class.
CONSTRUCTOR
$self=new Lab::Instrument::Source(\%config);
This constructor will only be used by instrument drivers that inherit this class, not by the user. It accepts an additional configuration hash as parameter 'default_device_settings'. The first hash contains the parameters used by default for this device and its subchannels, if any. The second hash can be used to override options for this instance while still using the defaults for derived objects. If \%config is missing, \%default_config is used.
The instrument driver (e.g. Lab::Instrument::Yokogawa7651) has e.g. a constructor like this:
$yoko=new Lab::Instrument::Yokogawa7651({
connection_type => 'LinuxGPIB',
gpib_board => $board,
gpib_address => $address,
gate_protect => $gp,
[...]
});
METHODS
configure
$self->configure(\%config);
Supported configure options:
In general, all parameters which can be changed by access methods of the class/object can be used. In fact this is what happens, and the config hash given to configure() ist just a shorthand for this. The following are equivalent:
$source->set_gate_protect(1);
$source->set_gp_max_units_per_second(0.1);
...
$source->configure({ gate_protect=>1, gp_max_units_per_second=>0.1, ...)
Options in detail:
- 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_units_per_second
,gp_max_units_per_step
andgp_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_units_per_second
-
How much the output voltage is allowed to change per second.
- gp_max_units_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_units
-
The smallest allowed output voltage.
- gp_max_units
-
The largest allowed output voltage.
- gp_equal_level
-
Voltages with a difference less than this value are considered equal.
set_level
$new_volt=$self->set_level($srclvl);
Sets the output to $srclvl
(in Volts or Ampere). If the configure option gate_protect
is set to a true value, the safety mechanism takes into account the gp_max_units_per_step
, gp_max_units_per_second
etc. settings, by employing the sweep_to_level
method.
Returns for fast_set
off the actually set output source level. This can be different from $srclvl
, due to the gp_max_units
, gp_min_units
settings. For fast_set
on, set_level
returns always $level
.
For a multi-channel device, add the channel number as a parameter:
$new_volt=$self->set_voltage($voltage,$channel);
_set_level($targetlvl)
Function Stub. Has to be overwritten by device driver.
The function should set the source level to $targetlvl on the device. Should return the newly set source level.
get_level()
Function Stub. Has to be overwritten by device driver.
The function should return the source level from the device cache. If called with the option from_device => 1
, the value should be fetched from the device. Should return the current source level.
get_range()
Function Stub. Has to be overwritten by device driver.
The function should return the source range from the device cache. If called with the option from_device => 1
, the value should be fetched from the device. Should return the current source range.
set_range()
Function Stub. Has to be overwritten by device driver.
The function should set the source range on the device. Should return the newly set source range.
sweep_to_level
$new_volt=$self->sweep_to_level($srclvl);
$new_volt=$self->sweep_to_level($srclvl,$channel);
This method sweeps the output source level to the desired value and only returns then. If the specific Instrument implemented _sweep_to_level, this version is preferred.
Returns the actually set output source level. This can be different from $srclvl
, due to the gp_max_units
, gp_min_units
settings.
get_level
$new_volt=$self->get_level();
$new_volt=$self->get_level($channel);
Returns the source level currently set.
create_subsource
$bigc2 = $bigsource->create_subsource( channel=>2, gp_max_units_per_second=>0.01 );
Returns a new instrument object with its default channel set to channel $channel_nr of the parent multi-channel source.
The device_settings given to the parent at instantiation (or the default_device_settings if present) will be used as default
values, which can be overwritten by parameters to create_subsource().
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.
COPYRIGHT AND LICENSE
This software is copyright (c) 2022 by the Lab::Measurement team; in detail:
Copyright 2005-2006 Daniel Schroeer
2009 Andreas K. Huettel, Daniela Taubert
2010 Andreas K. Huettel, Daniel Schroeer
2011 Andreas K. Huettel, Florian Olbrich
2012 Alois Dirnaichner, Andreas K. Huettel, Florian Olbrich
2013 Alois Dirnaichner, Andreas K. Huettel, Christian Butschkow, Stefan Geissler
2014 Alexei Iankilevitch, Alois Dirnaichner, Christian Butschkow
2016 Simon Reinhardt
2017 Andreas K. Huettel
2020 Andreas K. Huettel
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.