Skip to main content

Simple library to control older ISEG HV supplies over CAN interface.

Project description

IsegCAN

Description

Simple library for controlling ISEG HV modules in a single crate over CAN bus.

The library is just a wrapper around the Iseg DHCP command set. Most single channel and Module commands in the Iseg CAN control protocol have been implemented (see definitions.py). Some often used operations have been exposed as methods, but the raw CAN commands can be accessed

Installation

IsegCAN uses python-can, and specifically the SocketCAN interface. Documentation can be found from https://python-can.readthedocs.io/en/stable/interfaces/socketcan.html

For a quick start, the next few lines should work for PEAK usb adapter:

# Create a can network interface with a specific name
sudo ip link set can0 up type can bitrate 125000

Note that the bitrate depends on the setup of your Iseg modules. All connections fail and interface is brought down if the bitrate is wrong.

Usage

The library has only one class, the resource. The resource object is used to control a single module.

Most EDCP commands are automatically generated from a dictionary in _edcp_definitions.py, but only small subset of them have been tested. They can be run using the automatically generated set_command and query_command methods, which have the same signature (value, channel). Type of value depends on the command. It is only used for set commands. Address is unsigned one-byte integer for the channel number in the module or for an offset for some module commands.

The query commands return a value and update the state of the resource directly in the resource object once they are read from the buffer. This is done automatically but is not synchronized, so there is a possibility of retrieving stale data.

For ease of use, some methods have been defined for the most common uses. These are:

command direction description
channel_status_query(_value, channel) r Returns the 16-bit channel status
module_status_query(_value, channel) r Returns the 16-bit module status
state(value, channel) w Set channel on or off
state_query(_value, channel) r Read channel state
voltage_out_measure(_value, channel) r Measurement of the voltage
voltage_set(value, channel) w Set voltage
voltage_set_query(_value, channel) r Read set voltage value
current_out_measure(_value, channel) r Measurement of the current.
current_set(value, channel) w Set current limit
current_set_query(_value, channel) r Read current limit
ramp_speed(value, _channel) w Set ramp speed (in V/s. Max 20% of max voltage)
ramp_speed_query(_value, _channel) r Read ramp speed
reset_trip(_value, _channel) w Reset all trips

Random remarks

For some reason, the channel commands for ramp speed don't work with either of our Iseg modules (EHS F460n-F, EHS 84 60n). All ramp speed commands are therefore made using module command relative to the nominal voltage of channel 0.

Support

Hmmm?

Roadmap

The objective is to be functional with Dirigent via ICICLE. Other features may be decided in the future

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

isegcan-0.6.1.tar.gz (11.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

isegcan-0.6.1-py3-none-any.whl (11.5 kB view details)

Uploaded Python 3

File details

Details for the file isegcan-0.6.1.tar.gz.

File metadata

  • Download URL: isegcan-0.6.1.tar.gz
  • Upload date:
  • Size: 11.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for isegcan-0.6.1.tar.gz
Algorithm Hash digest
SHA256 4aa8a7800b2efe22ebffb7a66db2ef3c55e16581d1cac3e41b947bca479331d4
MD5 9f9d988c7bbb4b22485abad5bffc6eee
BLAKE2b-256 4814bcfa7ce876d96f2d9b0ee3ba0b7ba1be6d8481a709ce23218ed95374603e

See more details on using hashes here.

File details

Details for the file isegcan-0.6.1-py3-none-any.whl.

File metadata

  • Download URL: isegcan-0.6.1-py3-none-any.whl
  • Upload date:
  • Size: 11.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for isegcan-0.6.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5c92aee9239732c4bb56507cad20e9e7dc36f35a02a7c62fc43e983a770bd32e
MD5 7c6fd99b1ef4923116aad5be9d2831bb
BLAKE2b-256 5f6103e76a27a223af70106c1837ee93d056289b741d2b5099a94495571ca9e0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page