EnDat Sensor
Purpose
Provide an EnDat sensor implementation to transmit position information.
Description
The EnDat sensor takes a rotational angle \(\theta\) as input.
The EnDat sensor is available on RT Box 2 and RT Box 3 with hardware revision 1.2 and later, and also on the RT Box 4. It supports a subset of the EnDat 2.1 command set, in particular:
Mode command |
M2 |
M1 |
M0 |
(M2) |
(M1) |
(M0) |
|---|---|---|---|---|---|---|
Encoder send position values |
0 |
0 |
0 |
1 |
1 |
1 |
Selection of memory area |
0 |
0 |
1 |
1 |
1 |
0 |
Encoder send parameter (for selected parameters, see below) |
1 |
0 |
0 |
0 |
1 |
1 |
Encoder receive parameter |
0 |
1 |
1 |
1 |
0 |
0 |
Encoder receive reset |
1 |
0 |
1 |
0 |
1 |
0 |
The following parameters can be queried using a combination of mode commands “Selection of memory area” and “Encoder send parameter”:
Parameter |
Parameter no. |
MRS code |
|---|---|---|
EnDat version |
8 |
161 |
Resolution |
13 |
161 |
EnDat command set |
42 |
165 |
In each of the EnDat OEM parameter areas (MRS codes 169, 171, 173 and 175) a range of 256 words may be written (using the “Encoder receive parameter” command) and read back (using the “Encoder send parameter” command).
An EnDat Controller must be connected to the RS-232/422/485 port on the back of the RT box. The connector layout for the EnDat sensor is shown below:
9 pin male D-Sub (front view)
Pin |
EnDat |
|---|---|
1 |
n/c |
2 |
n/c |
3 |
CLK+ |
4 |
DATA+ |
5 |
GND |
6 |
DATA- |
7 |
CLK- |
8 |
n/c |
9 |
n/c |
The EnDat connector is electrically isolated from the rest of the RT Box. The GND line of the EnDat connector needs to be connected to the controller board.
Parameters
General
- Resolution (bits)
Specifies the resolution of the EnDat position signal, in bits. The maximum resolution is 31 bits.
Advanced
- Maximum clock pulse width (s)
Specifies the maximum duration of a positive or negative clock pulse. If a transfer is active and the clock line remains stable for longer than the specified time, the internal state machine of the EnDat receiver is reset and the start of a new transfer is expected. The allowed range for this parameter is \(10{\mu}s\) to \(650{\mu}s\), the default is \(100{\mu}s\).
- Allow dynamic (dis-)connect
If enabled, an additional input port named en is shown. This port can be used to simulate a connection failure (see below).
- Additional initialization code
Allows to add C code that is executed during the initialization of the EnDat block.
This parameter can be used to initialize the OEM parameter area using the command
plxWriteEndatMemory(uint8_t aMrsCode, uint8_t aAddress, uint16_t aValue), whereaMrsCodeis the MRS code of the OEM area (169, 171, 173 or 175),aAddressis the address within the OEM area (0-255) andaValueis the value to write to the address (0-65535).
Inputs
- \(\theta\)
The rotational angle or rotor position, in rad.
- en
If the parameter Allow dynamic (dis-)connect is set to enabled, a boolean signal \(0\) on this port deactivates all EnDat communication, i.e. the RT Box no longer responds to EnDat commands. A boolean signal \(1\) on this port activates the EnDat operations.