The ROQ437 defaults to a slower
EnDat2.1 recovery time between position latches. EnDat2.2 enables a faster recovery
time but we need to set a non-volatile bit one time in the ROQ437 before running the
rest of the demo to reduce the recovery time. This is a workaround for now that can
be incorporated into the demo code at a later time.
Explanation from the Heidenhain
documentation (https://www.heidenhain.us/wp-content/uploads/Bidirectional_Interface_for_Position_Encoders-1.pdf):
The extended EnDat interface version 2.2 is compatible in its communication, command
set and time conditions with the previous version 2.1, but also offers significant
advantages. It makes it possible, for example, to transfer additional information
with the position value without sending a separate request for it. The interface
protocol was expanded and the time conditions were optimized as follows: Increased
clock frequency (CLOCK) (16 MHz), Optimized calculating time (position value
acquisition within 5 µs), Minimized dead time (recovery time) (1.25 µs to 3.75 µs),
Expanded power supply range (3.6 V to 5.25 V or 14 V at the encoder)
- Plug in all of the hardware to
connect the EnDat2.2 encoder into the slot closest to the TMDS243GPEVM
- Import into CCS the
'endat_diagnostic' example from the MCU+ SDK located at
'%SDK_INSTALL_DIR%\examples\motor_control\endat_diagnostic'
- Build the example and load it
into MAIN_Cortex®_R5_0_0
- Setup the terminal in Code
Composer Studio™ (CCS) to view the diagnostic output (my port is COM6
below but yours may differ):
- Click 'Resume (F8)' to run the
Diagnostic
- Select 'y' for Multi channel
configuration, select 'y' for select channel 0, and select 'n' for channel 1 and
channel 2.
- After these selections the
diagnostics should communicate with the encoder and return ID, SN, and
information about the resolution and propagation delay
- Connect a logic analyzer to to
the EnDat CLK, TX, and RX pin (these pins can be accessed on the right angle
connector of the TIDA-00179 board as shown below)
- Select option '107' in the
diagnostic and enter '8000' for the frequency in Hz. This causes the program to
continuously request data from the encoder like that shown in Figure 11-8.
- Run the logic analyzer while the
simulated position loop is running and look at the recovery time on the RX
signal (the time the RX signal is held high after the CLK stops):
- To set the bit to enable EnDat2.2
recovery mode select diagnostic option: 10, parameter address: 3, and parameter
value: 1
- Then select diagnostic option '5'
to reset the encoder in order for the setting to take effect
- Re-run option 107 with 8000 as
the frequency to ensure that the setting has been saved and that the recovery
time is less than 3.75 µs:
- If the recovery time is still
around 20 µs, you may need to try the previous steps one more time (option 10,
address 3, value 1, then option 5 to reset)
At this point, your encoder should be
configured to run in EnDat2.2 recovery mode, which allows for the tight timings that
is needed throughout the rest of the demo.