A collection of different scripts and drivers (PSU, EtherCAT, Labjack,...)
Project description
All modules to make successful and complete testing of SOMANET modules possible.
Even though this suite is written for Linux, at least the Elektronik Automation Power Supply Driver also runs under Windows.
Installation
- Install non-python tools (only Linux)
sudo ./install.sh -a -m <MAC_OF_ETHERCAT_INTERFACE>
- This will install:
IgH EtherCAT Master
UDEV rules for power supplies
LabJack driver and Kipling
SOEM EtherCAT Master
If one of these tools are already installed, the script will skip the installation and continue with the next tool. Call “-h” to show the help text.
- Install python script
python setup.py install
Usage
1. PSU
Import module
import somanet_test_suite as sts
Create object
To connect to a specific PSU, you can call
Linux: psu = sts.PsuEA(comport='ttyACM0') or psu = sts.PsuEA(comport='usb-EA_Elektro-Automatik_PS_2042-10B_2815450332-if00')
Windows: psu = sts.PsuEA(comport='COM1') or as com port description: psu = sts.PsuEA(comport='PS 2000 B')
If you added the device rule and you connected only one PSU, there is no need to provide a device name:
psu = sts.PsuEA()
Also possible is:
psu = sts.PsuEA(comport='ea-ps-20xx-xx-0')
psu = sts.PsuEA(sn='0123456789')
or to use the device designator:
psu = sts.PsuEA(desi='PS 2142-10B')
Dis/connect to power supply for controlling
psu.remote_on()
psu.remote_off()
For multi output devices most functions provide an additional output argument:
psu.remote_on(output_num=0)
psu.remote_on(output_num=1)
Power on and off output
psu.output_on()
psu.output_off()
or
psu.output_on(output_num=1)
psu.output_off(output_num=1)
Set parameters
Arguments can be int or float.
psu.set_voltage(24, output_num=0)
psu.set_current(0.5, output_num=0)
psu.set_ovp(30, output_num=0)
psu.set_ocp(8, output_num=0)
The script will always set the maximum possible values in dependency of the nominal power.
Get parameters
Return argument: float.
psu.get_voltage(output_num: int)
psu.get_current(output_num: int)
psu.get_power(output_num: int)
Maximum sampling rate is ~10 Hz.
Nominal values:
If update is true, the value will be pulled directly from the device.
psu.get_nominal_voltage(output_num: int, update: bool)
psu.get_nominal_current(output_num: int, update: bool)
psu.get_nominal_power(output_num: int, update: bool)
Reset error
If an overcurrent, overvoltage, overpower or overtemperature protection error happens, you can reset the error with:
psu.reset_error(output_num: int)
Tracking
(Only 3-port devices). Tracking disables the controlling of output 2. Output 1 controls then also output 2.
psu.tracking_on()
psu.tracking_off()
Get status
Return argument: dictionary
psu.get_status(update: bool)
List of dictionary containing the following keys (index is output number):
‘output’ (int)
‘remote on’ (bool)
‘output on’ (bool)
‘controller state’ (‘CV’, ‘CC’)
‘tracking active’ (bool)
‘OVP activ’ (bool)
‘OCP activ’ (bool)
‘OPP activ’ (bool)
‘OTP activ’ (bool)
‘act voltage’ (float)
‘act current’ (float)
Get device description
Return argument: tuple (name, SN)
psu.get_device_description(update : bool)
Close connection
To close the connection, call:
psu.close()
This will just stop the communication, the PSU outputs will remain in their current states.
2. SANSSOUCI - So(manet) Se(nsor) Si(mulator)
A framework to simulate different sensors (Hall, QEI, …). Currently only velocity is supported for Hall and QEI.
Preperation
- What you need:
LabJack
SN75174 Differential Line Driver (for RS-422 communication and as level shifter 3.3V -> 5V)
Connection
See also: https://doc.synapticon.com/hardware/drive/drive_1000/d3/docs/index.html#encoder-port-1
Pin SN75174 |
Encoder/Labjack |
---|---|
1 |
LJ: FIO0 |
2 |
A+ |
3 |
A- |
4 |
Connect with 10kOhm to Vcc or NC |
5 |
B- |
6 |
B+ |
7 |
LJ: FIO01 |
8 |
GND of LJ and Encoder |
9 |
LJ: FIO2 |
10 |
I+ |
11 |
I- |
12 |
Connect with 10kOhm to Vcc or NC |
13 |
N.C. |
14 |
N.C. |
15 |
N.C. |
16 |
Vcc (5V) |
Usage
Hall
sensor = Sanssouci(printer.write, 'HALL', pole_pairs=7)
sensor.set_velocity(20)
QEI
sensor = Sanssouci(printer.write, 'QEI', resolution=100)
sensor.set_velocity(20)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file somanet_test_suite-1.1.5.tar.gz
.
File metadata
- Download URL: somanet_test_suite-1.1.5.tar.gz
- Upload date:
- Size: 59.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5c37eeef0e947071bad63e984d13dbaad54feb5897c33666345087dc15f6b8a2 |
|
MD5 | e91f04f2066db73580a307ec62be84c4 |
|
BLAKE2b-256 | 1b15194d7352d95e9ba13e2a142c2bafb4ba25817be5ce127eac84aa7fbe1860 |
File details
Details for the file somanet_test_suite-1.1.5-py3-none-any.whl
.
File metadata
- Download URL: somanet_test_suite-1.1.5-py3-none-any.whl
- Upload date:
- Size: 64.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b8d721f8d3addb8227f80c98822edd328104cbfca1eeabcb5ab40503e219ba52 |
|
MD5 | d1dc1833a20b2c80f2654e5eeecf2a61 |
|
BLAKE2b-256 | f33a4002dffc7e2a77274e061e28518fcf3de246f9d7d929811c13d0d5054729 |