Virtual

class empyric.collection.virtual.Clock(*args, **kwargs)

Virtual clock for time keeping; works like a standard stopwatch

name = 'Clock'
supported_adapters = ((<class 'empyric.adapters.Adapter'>, {}),)
knobs = ('state',)
meters = ('time',)
set_state(state: String)

Set the clock state:

  • ‘START’: setting to this state starts the clock, if it is stopped.

  • ‘STOP’: setting to this state stops the clock, if it is running.

  • ‘RESET’: setting to this state resets the clock time to zero.

measure_time() Float

Measure the clock time

class empyric.collection.virtual.Echo(address=None, adapter=None, presets=None, postsets=None, **kwargs)

Virtual instrument with a single knob “input” and single meter “output”, useful for testing.

The “output” meter simply returns the value of the “input” knob.

name = 'Echo'
supported_adapters = ((<class 'empyric.adapters.Adapter'>, {}),)
knobs = ('input',)
presets = {'input': 0}
meters = ('output',)
set_input(_input: Float)
measure_output() Float
class empyric.collection.virtual.HenonMapper(address=None, adapter=None, presets=None, postsets=None, **kwargs)

Virtual instrument based on the behavior of a 2D Henon Map:

x_{n+1} = 1 - a * x_n^2 + y_n

y_{n+1} = b * x_n

It has two virtual knobs (a,b) and two virtual meters (x,y)

name = 'HenonMapper'
supported_adapters = ((<class 'empyric.adapters.Adapter'>, {}),)
knobs = ('a', 'b')
presets = {'a': 1.4, 'b': 0.3}
meters = ('x', 'y')
set_a(value: Float)

Set the parameter a

Parameters:

value – (float) new value for a

Returns:

None

set_b(value: Float)

Set the parameter b

Parameters:

value – (float) new value for b

Returns:

None

measure_x() Float

Measure the coordinate x. Each call triggers a new iteration, with new values set for x and y based on the Henon Map. Therefore, each call to measure_x should be followed by a call to measure_y.

Returns:

(float) current value of x

measure_y() Float

Measure the coordinate y. Each call to measure_y should be preceded by a call to measure_x.

Returns:

(float) current value of y

class empyric.collection.virtual.PIDController(*args, **kwargs)

Virtual PID controller

name = 'PIDController'
supported_adapters = ((<class 'empyric.adapters.Adapter'>, {}),)
knobs = ('setpoint', 'proportional gain', 'derivative time', 'integral time', 'input')
presets = {'derivative time': 12, 'integral time': 180, 'proportional gain': 1}
meters = ('output',)
set_setpoint(setpoint: Float)

Set the process setpoint

set_proportional_gain(gain: Float)

Set the proportional gain

set_derivative_time(_time: Float)

Set the derivative time

set_integral_time(_time: Float)

Set the integral time

set_input(input: Float)

Input the process value

measure_output() Float

Get the controller output

class empyric.collection.virtual.RandomWalk(address=None, adapter=None, presets=None, postsets=None, **kwargs)

Virtual random walk process for testing controllers

Dynamics of the process value is determined by the mean, step and affinity knobs. The mean is the mean value of the process in steady state, the step is the size of the step that the process can take in either direction upon each measurement of the process value, and the affinity is the tendancy of the process value to return to its mean value at each step.

name = 'RandomWalk'
supported_adapters = ((<class 'empyric.adapters.Adapter'>, {}),)
knobs = ('mean', 'step', 'affinity')
meters = ('value',)
set_mean(mean: Float)
set_step(step: Float)
set_affinity(affinity: Float)
measure_value() Float
class empyric.collection.virtual.SimpleProcess(*args, **kwargs)

Virtual process that mimics the behavior of a heating process

name = 'SimpleProcess'
supported_adapters = ((<class 'empyric.adapters.Adapter'>, {}),)
knobs = ('setpoint', 'noise level', 'response time')
presets = {'noise level': 0.1, 'response time': 10.0, 'setpoint': 0.0}
meters = ('value',)
set_setpoint(setpoint: Float)
set_noise_level(noise_level: Float)
set_response_time(response_time: Float)
measure_value() Float
class empyric.collection.virtual.ModbusClient(address=None, adapter=None, presets=None, postsets=None, **kwargs)

Counterpart to the ModbusServer routine. Communicates with a ModbusServer instance in other experiments to control variables.

name = 'ModbusClient'
supported_adapters = ((<class 'empyric.adapters.Modbus'>, {}),)