device.paschen_motor module¶
- class device.paschen_motor.Arduino(serialbus, nodeid)[source]¶
Bases:
objectInternal helper class for communication with Arduino.
Note: See ‘hardware/arduino_motor_emca/’ for Arduino sourcecode.
- emcy_readcodes()[source]¶
Parse all buffered EMCY packets and return them as a list of 2-byte errorcodes in string format ‘0x0123’. EMCA-EC-C-HP.pdf page 255
- fhpp_send(ccon, cpos, cdir, data1=0, data2=0, data2signed=True)[source]¶
Send basic FHPP packet (type RPDO1), see EMCA-EC-C-HP.pdf page 50.
Packet structure:
ccon, cpos, cdit, data1 - each size 1 byte, usigned int data2 - size 4 bytes, signed int (by default)
- fhpp_state(actual2signed=True)[source]¶
Get most recent FHPP packet (type TPDO1) received from EMCA, see EMCA-EC-C-HP.pdf page 54.
Returns list of [SCON, SPOS, SDIR, actual1, actual2].
- Note: actual2 is by default interpretted as signed int, actual1 is
always unsigned.
- get_relay_states()[source]¶
Get current state of all three relays in a dict. The keys of the returned dict correspond to parameter which in
toggle_relay_state().
- other_readall()[source]¶
Return a list of all buffered uncathegorized packets. Packets are represented as tuples (packet type [str], packet data [bytes]).
- sdo_read(index, subindex=1)[source]¶
Execute SDO read transaction.
- Return bytes data:
little-endian representation of 1, 2, or 4 bytes
- class device.paschen_motor.PaschenMotor(serialbus, nodeid, **kwargs)[source]¶
Bases:
HardwareBaseMotor that controls the distance of electrodes (Paschen experiment).
Model name: Festo EMCA-EC-67-M-1TE-CO
Communication:
CAN bus, using FHPP protocol (see documentation file EMCA-EC-C-HP.pdf)
CAN bus connects to Arduino that connects to RaspberryPi via serial (USB)
Note: See ‘hardware/arduino_motor_emca/’ for Arduino sourcecode.