The EnDat diagnostic application, described here, demonstrates the EnDat receiver operation.
The EnDat driver provides a well defined set of APIs to expose EnDat receiver interface.
The diagnostic invokes these APIs to
Once these steps are executed,
Once initial setup is over,
After the user selects an EnDat command,
Following section describes the Example implementation of EnDat on ARM(R5F).
Folder/Files | Description |
---|---|
${SDK_INSTALL_PATH}/examples/position_sense/endat_diagnostic | |
endat_diagnostic.c | EnDAT diagnostic application |
${SDK_INSTALL_PATH}/source/position_sense/endat | |
firmware/ | Folder containing EnDAT firmware sources. |
driver/ | EnDAT diagnostic driver. |
Parameter | Value |
---|---|
CPU + OS | r5fss0-0 freertos |
ICSSG | ICSSG0 |
PRU | PRU1 (single channel, multi channel using single PRU) |
PRU1, RTU-PRU1, TXPRU1 (multi channel using three PRUs - load share mode) | |
Toolchain | ti-arm-clang |
Board | am243x-evm (3 channel and 1 channel examples), am243x-lp (2 channel and 1 channel examples) |
Example folder | examples/position_sense/endat_diagnostic |
Other than the basic EVM setup mentioned in EVM Setup , below additional hardware is required to run this demo
Designator | ON/OFF | Description |
---|---|---|
J11 | OFF | VSENSE/ISENSE select |
J13 | OFF | VSENSE/ISENSE select |
J17 | Pin 1-2 Connected | SDFM Clock Feedback Select |
J18/J19 | J18 OFF & J19 ON | Axis 1: Encoder/Resolver Voltage Select |
J20/J21 | J20 ON & J21 OFF | Axis 2: Encoder/Resolver Voltage Select |
J22 | OFF | Axis 1: Manchester Encoding Select |
J23 | OFF | Axis 2: Manchester Encoding Select |
J24 | OFF | Axis 1: RS485/DSL MUX |
J25 | OFF | Axis 2: RS485/DSL MUX |
J26 | OFF | VSENSE/ISENSE Select |
J27 | ON | 3WIRE/SDFM MUX |
J28 | OFF | 3WIRE MUX |
Shown below is a sample output when the application is run:
S.No | Test Details | Steps | Pass/Fail Criteria |
---|---|---|---|
1. | To check position value | 1. Enter 1 to select "Encoder send position values" | CRC success |
2. | To receive encoder's operating parameters (Error Message) | 1. Enter 2 to select "Selection of memory area" | |
2. Enter "B9" in MRS code to select "Operating parameters" | CRC success | ||
3. Enter 4 to select "Encoder to send parameter" | |||
4. Enter 00 in "parameter address" for selecting "Error message" | CRC success | ||
3. | To receive encoder's operating parameters (Warning message) | 1. Enter 2 to select "Selection of memory area" | |
2. Enter "B9" in MRS code to select "Operating parameters" | CRC success | ||
3. Enter 4 to select "Encoder to send parameter" | |||
4. Enter 01 in "parameter address" for selecting "Error message" | CRC success | ||
4. | To receive encoder's manufacture parameters for Endat 2.2 | 1. Enter 2 to select "Selection of memory area" | |
2. Enter "BD" in MRS code to select "Parameters of encoder manufacturer for Endat 2.2" | CRC success | ||
3. Enter 4 to select "Encoder to send parameter" | CRC success | ||
4. Enter 0 in "parameter address" for selecting "Status of additional info 1" | CRC success | ||
5. | To set values to encoder's operating parameters (Clear error message) | 1. Enter 2 to select "Selection of memory area" | |
2. Enter "B9" in MRS code to select "Operating parameters" | CRC success | ||
3. Enter 3 to select "Encoder to receive parameter" | |||
4. Enter 0 in "parameter address" for selecting "Error message" | |||
5. Enter 0 in "parameter value" for seting value in " Error message" | CRC success | ||
6. | To set values to encoder's operating parameters (Clear warning message) | 1. Enter 2 to select "Selection of memory area" | |
2. Enter "B9" in MRS code to select "Operating parameters" | CRC success | ||
3. Enter 3 to select "Encoder to receive parameter" | |||
4. Enter 01 in "parameter address" for selecting "Error message" | |||
5. Enter 0 in "parameter value" for seting value in " Error message" | CRC success | ||
7. | To set values to encoder's manufacturing parameters for Endat 2.2(Status of additional info) | 1. Enter 9 to select "Encoder send position values + Additional Information(s) and Selection of memory area" | |
2. Enter "45" in MRS code to select "Parameters of encoder manufacturer for Endat 2.2" | CRC success | ||
3. Enter 9 to select "Encoder send position values + Additional Information(s) and Selection of memory area" | CRC success | ||
4. Enter "BD" in MRS code to select "Memory parameter (LSB)" of Additional Information 1 | CRC success | ||
5. Enter 10 to select "Encoder send position values + Additional Information(s) and receive parameter" | |||
6. Enter 0 in "parameter address" for selecting "Status of additional info" | |||
7. Enter 1235 (or any 2 byte value) in "parameter value" for seting value in " Status of additional info" | CRC success | ||
8. Enter 8 to select "Encoder send position values + Additional Information(s)" Note: Write is not permenant. When read again using Command 11, encoder will return the default value | Values followed by 0x45 represents last byte of the data received by encoder Crc success | ||
8. | To reset encoder | 1. Enter 5 to select "Encoder receive reset" | CRC success |
9. | To receive test values from encoder with port address "0" | 1. Enter 7 to select "Encoder receive test command" | |
2. Enter 0 in "enter port address" | |||
3. Enter 6 to select "Encoder send test values" | CRC success | ||
10. | To receive test values from encoder with port address "E" | 1. Enter 7 to select "Encoder receive test command" | |
2. Enter "E" in "enter port address" | |||
3. Enter 6 to select "Encoder send test values" | CRC success | ||
11. | To check position value with aditional info. | 1. Enter 9 to select "Encoder send position values + Additional Information(s) and Selection of memory area" | CRC success |
2. Enter "47" in MRS code to select "Acknowledge MRS code" of Additional Information 1 | CRC success | ||
3. Enter 9 to select "Encoder send position values + Additional Information(s) and Selection of memory area" | |||
4. Enter "56" in MRS code to select "Asynchronous Position value word 1 LSB" of Additional Information 2 | CRC success | ||
5. Enter 8 to select "Encoder send position values + Additional Information(s)" | CRC success | ||
12. | To receive encoder's operating parameters(error messege) +receive position value with additional info | 1. Enter 9 to select "Encoder send position values + Additional Information(s) and Selection of memory area" | |
2. Enter "45" in MRS code to select "Memory parameter (LSB)" of Additional Information 1 | CRC success | ||
3. Enter 9 to select "Encoder send position values + Additional Information(s) and Selection of memory area" | |||
4. Enter "B9" in MRS code to select "Operating parameters" | CRC success | ||
5. Enter 11 to select "Encoder send position values + Additional Information(s) and send parameter" | |||
6. Enter 0 in "parameter address" for selecting "Error message" | CRC success | ||
7. Enter 8 to select "Encoder send position values + Additional Information(s)" | CRC success | ||
13. | To receive encoder's manufacture parameters for Endat 2.2 +receive position value with additional info | 1. Enter 9 to select "Encoder send position values + Additional Information(s) and Selection of memory area" | |
2. Enter "45" in MRS code to select "Memory parameter (LSB)" of Additional Information 1 | CRC success | ||
3. Enter 9 to select "Encoder send position values + Additional Information(s) and Selection of memory area" | |||
4. Enter "BD" in MRS code to select "Parameters of encoder manufacturer for Endat 2.2" | CRC success | ||
5. Enter 11 to select "Encoder send position values + Additional Information(s) and send parameter" | |||
6. Enter 0 in "parameter address" for selecting "Status of additional info 1" | |||
7. Enter 8 to select "Encoder send position values + Additional Information(s)" | CRC success | ||
14. | To acknowledge MRS code for Endat 2.2 | 1. Enter 9 to select "Encoder send position values + Additional Information(s) and Selection of memory area" | |
2. Enter "47" in MRS code to select "Acknowledge MRS code" of Additional Information 1 | CRC success | ||
3. Enter 9 to select "Encoder send position values + Additional Information(s) and Selection of memory area | |||
4. Enter "BD" or any other valid MRS code | CRC success | ||
5. Enter 8 to select "Encoder send position values + Additional Information(s)" | Additional Information 1:0x47bd00 (for MRS code = BD) | ||
15. | To set values to encoder's operating parameters (error message) +receive position value with additional info | 1. Enter 9 to select "Encoder send position values + Additional Information(s) and Selection of memory area" | |
2. Enter "B9" in MRS code to select "Operating parameters" | CRC success | ||
3. Enter 10 to select "Encoder send position values + Additional Information(s) and receive parameter" | |||
4. Enter 0 in "parameter address" for selecting "Error message" | |||
5. Enter 0 in "parameter value" for seting value in "Error message" | CRC success | ||
16. | To set values to encoder's manufacturing parameters for Endat 2.2(Status of additional info) +receive position value with additional info | 1. Enter 9 to select "Encoder send position values + Additional Information(s) and Selection of memory area" | |
2. Enter "BD" in MRS code to select "Parameters of encoder manufacturer for Endat 2.2" | CRC success | ||
3. Enter 10 to select "Encoder send position values + Additional Information(s) and receive parameter" | |||
4. Enter 0 in "parameter address" for selecting "Status of additional info" | |||
5. Enter 0 in "parameter value" for seting value in " Status of additional info" | CRC success | ||
17. | To receive encoder's OEM (Original Equipment Manufacturer) data | 1. Enter 9 to select "Encoder send position values + Additional Information(s) and Selection of memory area" | |
2. Enter "45" in MRS code to select "Memory parameter (LSB)" of Additional Information 1 | CRC success | ||
3. Enter 9 to select "Encoder send position values + Additional Information(s) and Selection of memory area" | |||
4. Enter A9 (or AB or AD) in MRS code to select the OEM memory | CRC success | ||
5. Enter 11 to select "Encoder send position values + Additional Information(s) and send parameter" | |||
6. Enter 40 in "parameter address" | |||
7. Enter 8 to select "Encoder send position values + Additional Information(s)" | CRC success | ||
18. | To set values in OEM memory area | 1. Enter 9 to select "Encoder send position values + Additional Information(s) and Selection of memory area" | |
2. Enter "A9" in MRS code to select "Operating parameters" | CRC success | ||
3. Enter 10 to select "Encoder send position values + Additional Information(s) and receive parameter" | |||
4. Enter 40 in "parameter address" | |||
5. Enter E9 in "parameter value" | CRC success | ||
19. | To reset encoder +receive position value with additional info | 1. Enter 12 to select "Encoder send position values + Additional Information(s) and receive error reset" | CRC success |
1. Enter 14 to select "Encoder receive communication command" | CRC success | ||
2. Enter ______in "enter encoder address" | CRC success | ||
3. Enter _____ in "instruction hex value" | CRC success | ||
1. Enter 14 to select "Encoder receive communication command" | CRC success | ||
2. Enter ______in "enter encoder address" | CRC success | ||
3. Enter _____ in "instruction hex value" | CRC success | ||
20. | Configure Clock | 1. Enter 100 to select "configure clock" | |
2. Enter ___ for clock frequency(in Hz) | CRC success(Tested up to 8MHz) | ||
21. | Simulate motor control 2.1 position loop | 1. Enter 101 to select "Simulate motor control 2.1 position loop" | |
2. Enter 1000 to select "clock frequency" | |||
3. Rotate the rotor of motor and see the changes in Position value on UART | Position Values are changing when rotor moves | ||
22. | Toggle raw data display | 1. Enter 102 to select "Toggle raw data display" | |
2. Enter 1 to select "Encoder send position value" | raw data can be displayed | ||
23. | Configure TST delay | ||
24. | Start continuous mode | 1. Enter 104 to select "Start continuous mode" | |
2. Rotate the rotor of motor and see the changes in Position value on UART | Position Values are changing when rotor moves | ||
25. | Configure rx arm counter | 1. Enter 105 to select "Configure rx arm counter" | |
2. Enter 0 to select channel 0 | |||
3. Enter ___ to "select time in ns" | |||
26. | configure rx clock disable time | 1. Enter 106 to select "configure rx clock disable time" | |
2. Enter 0 to select channel 0 | |||
3. Enter ___ to "select time in ns" | |||
27. | Simulate motor control 2.2 position loop(safety) | 1. Enter 107 to select "Simulate motor control 2.2 position loop" | |
2. Enter 1000 to select "clock frequency" | |||
3. Rotate the rotor of motor and see the changes in Position value on UART | Position Values are changing when rotor moves | ||
28. | Configure propogation delay(td) | 1. Enter 108 to select configure propagation delay | |
2. Enter 0 to select channel 0 | |||
29. | Configure Recovery time (tr) using EnDat 2.2 mode transmission | 1. Enter 9 to select "Encoder send position values + Additional Information(s) and Selection of memory area" | |
2. Enter "B9" in MRS code to select "Operating parameters" | |||
3. Enter 10 to select "Encoder send position values + Additional Information(s) and receive parameter" | |||
4. Enter 03 in "parameter address" for selecting "Initializing the functions" | |||
5. Enter 01 in "parameter value" for selecting low recovery time or Enter 02 in "parameter value" for selecting high recovery time | CRC success | ||
30. | To read Recovery Time | 1. Enter 8 to select "Encoder send position values + Additional Information(s)" | CRC Success |
2. Enter 110 for read recovery time from DMEM | Recovery Time is set to 1.25 us <= RT <= 3.75us or 10 us <= RT <= 30 us | ||
31. | To test periodic continuous mode | 1. Enter 200 to enable periodic mode | |
2. Enter 5000 (in ns) for position read time | Position Values are changing when rotor moves | ||
32. | Long term test | 1. Enter 111 to enable Long time continuous mode | |
2. press enter to stop the long term test | The result shows the number of position command sent and the number of CRC failures received |