17
CEO: Dr. Bernt Götz • Phone +493641/66880 • Fax +493641/668866 • www.piezosystem.com
8.4.4 SPI communication
Real-time communication can take place via the SPI interface. The device works as an SPI slave, i.e.
the device receives setpoints from an external SPI master. The return value retrieved over the MISO
channel can be set to different quantities (e.g. position values) via the USB or Ethernet interfaces.
The SPI connection is exclusively to send setpoints to the device. The device has to be configured via
the USB or Ethernet interfaces.
The interface requires the following configuration:
•
3.3 V logic voltage
•
SPI clock: max. 6 MHz
•
SPI mode: 3 (CPOL = 1, CPHA = 1)
•
SPI CS: low active
•
Word length: 16 bit, MSB First
Value range of the SPI-setpoint:
•
in closed loop mode [0x0000 … 0xFFFE] corresponds to 0 … 100% of the closed loop travel
of the connected actuator
•
in open loop mode [0x0000 … 0xFFFE] corresponds to 0 … 100% of the admissible piezo
voltage of the connected actuator
•
The value [0xFFFF] is used for error detection and is not interpreted as a setpoint
Value range of the return value:
•
The value selected by
spisrc
command is converted into a 16 bit integer value with the
following scaling:
Configuration
Value
Scaling
spisrc,0
none
0x0000
spisrc,1
Measured position in closed loop
posmin
=
̂
0x0000
posmax
=
̂
0xFFFF
spisrc,2
Setpoint in open loop
avmin
=
̂
0x0000
avmax
=
̂
0xFFFF
spisrc,3
Piezo voltage (controller output)
avmin
=
̂
0x2000
avmax
=
̂
0xDFFF
spisrc,4
Position error
-posmax
=
̂
0x2000
0
=
̂
0x8000
+posmax
=
̂
0xE000
spisrc,5
abs(Position error)
0
=
̂
0x0000
2*posmax
=
̂
0xFFFF
spisrc,6
Measured position in open loop
posmin
=
̂
0x2000
posmax
=
̂
0xDFFF
spisrc,7
Piezo current 1
-0.5A
=
̂
0x0000
0 A
=
̂
0x8000
+0.5A
=
̂
0xFFFF
spisrc,8
Piezo current 2
-0.5A
=
̂
0x0000
0 A
=
̂
0x8000
+0.5A
=
̂
0xFFFF
spisrc,9
Test value
0x5A5A