Skip to content

spellman

borealis.spellman

Spellman High Voltage power supply.

Created on Tue May 30 15:22:12 2023.

@author: R. Bes

Spellman_uX50P50(ip_address, port=50001)

Class for Spellman uX50P50 high voltage power supply (ethernet).

Initialise the connection to the device.

Source code in borealis/spellman.py
32
33
34
35
36
37
38
39
40
41
42
43
44
def __init__(self, ip_address, port=50001):
    """Initialise the connection to the device."""
    self._socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    self._socket.connect((ip_address, port))
    # TODO: catch possible errors from _send()
    self.software_version = self._send('23,')[1]
    self.hardware_version = self._send('24,')[1]
    self.model_number = self._send('26,')[1]
    self.set_filament_default_values(preheat=self.FIL_PREHEAT,
                                     limit=self.FIL_LIMIT,
                                     ramp_time=self.FIL_RAMP_TIME)
    # TODO Logging the successful initialisation of the device
    print(f'Spellman {self.model_number} successfully initialised')

current property

Return the source current, in mA, from analog feedback.

current_setpoint property writable

Request the source current setpoint value, in mA

fil_current property

Return the filament current from analog feedback.

fil_voltage property

Return the filament voltage from analog feedback.

hv_temperature property

Return the High voltage board temperature from analog feedback.

low_voltage property

Return the low voltage supply monitor from analog feedback.

temperature property

Return the Control board temperature from analog feedback.

voltage property

Return the accelerating voltage, in kV, from analog feedback.

voltage_setpoint property writable

Request the accelerating voltage setpoint value, in kV.

set_filament_default_values(preheat, limit, ramp_time)

Set default values for filament.

Source code in borealis/spellman.py
46
47
48
49
50
51
52
53
def set_filament_default_values(self, preheat: float, limit: float, ramp_time: float):
    """Set default values for filament."""
    # TODO: handle errors of progamming the filament ramp time, prehat and limits
    val = int(round(1000 * preheat / self.D2A_FIL))
    self._send(f'12,{val},')
    val = int(round(1000 * limit / self.D2A_FIL))
    self._send(f'13,{val},')
    self._send(f'47,1,{ramp_time},')