Nikon diagnostic application does the following:
This application is controlled with a terminal interface using a serial over USB connection between the PC host and the EVM. Please connect a USB cable between the PC and the EVM/LP. A serial terminal application (like teraterm/ hyperterminal/ minicom) is then run on the host. To configure, select the serial port corresponding to the port emulated over USB by the EVM. The host serial port should be configured to 115200 baud, no parity, 1 stop bit and no flow control.
The Nikon receiver firmware running on ICSS-PRU provides a defined interface. The Nikon diagnostic application interacts with the Nikon receiver firmware interface. It then presents the user with menu options to select different commands. The application collects the data entered by the user and configures the relevant interface. Then via the Nikon receiver interface, the command is triggered. Once the command completion is indicated by the interface, the status of the transaction is checked. If the Status indicates success, the result is presented to the user.
The Nikon diagnostic application supports two types of periodic trigger modes for continuous position sampling as described in Periodic Trigger Modes.
nikon_process_periodic_command() function in example codenikon_get_pos() in host trigger modenikon_get_pos() to properly set up command data (e.g., nikon_generate_cdf()). Refer the nikon_handle_command() function in the example code to identify all required API calls for specific command| Folder/Files | Description |
|---|---|
| ${SDK_INSTALL_PATH}/examples/position_sense/nikon_diagnostic | |
| nikon_diagnostic.c | Nikon diagnostic application |
| ${SDK_INSTALL_PATH}/source/position_sense/nikon | |
| firmware/ | Folder containing Nikon PRU firmware sources |
| driver/ | Nikon diagnostic driver |
| Parameter | Value |
|---|---|
| CPU + OS | r5fss0-0 freertos |
| ICSSM | ICSSM0 |
| PRU | PRU0 |
| Toolchain | ti-arm-clang |
| Board | am263px-lp |
| Example folder | examples/position_sense/nikon_diagnostic/single_channel |
This example supports one Nikon channel using one PRU. In this example:
| Designator | ON/OFF | Description |
|---|---|---|
| J13 | Pin 1-2 Connected | 3V3 Supply to Booster Pack |
| J14 | Pin 1-2 Connected | 5V0 Supply to Booster Pack |
| 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 | J19 installed: sets VSENSOR1 to 5.0V | Axis 1: Encoder/Resolver Voltage Select |
| J20/J21 | J21 installed: sets VSENSOR2 to 5.0V | 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 | OFF | Encoder and SDFM Paths Select |
| J28 | ON | AM243/AM263 Mode |
Shown below is a sample output when the application is run:
This section describes how to debug the Nikon A-format application, including a guide to debugging the Nikon A-format example and firmware. It mainly focuses on verifying the configuration of all components and encoder registers, as described in the Encoder Examples Debug Guide.
If the Nikon A-format interface is not initializing correctly, the steps mentioned below can help identify the root cause. Additionally, ensure that the hardware connections and software configurations are properly set up before proceeding with debugging, as described in the Encoder Examples Debug Guide.
In case of initialization failure, perform the following steps to identify the root cause:
If the initialization communication is incorrect, possible causes include:
Troubleshooting steps:
| CMD_ID | CMD | Description | Pass/fail Criteria |
|---|---|---|---|
| 0 | ABS full 40 bit data request | In this command, encoder sends absolute 40 bit data for single encoder with status information. | CRC success with rotor angle, number of rotations and CRC values printed in the terminal. |
| 1 | ABS lower 24bit data request | In this command, encoder sends absolute lower 24 bit data for single encoder with status information. | CRC success with rotor angle, number of rotations and CRC values printed in the terminal. |
| 1 (Nikon A-format version 3.0 only, based on factory setting) | ABS full 40bit data + velocity data request | In this command, encoder sends absolute 40 bit data for single encoder with status and velocity information. | CRC success with rotor angle, number of rotations, velocity and CRC values printed in the terminal. |
| 2 | ABS upper 24bit data request | In this command, encoder sends absolute upper 24 bit data for single encoder with status information. | CRC success with rotor angle, number of rotations and CRC values printed in the terminal. |
| 3 | Encoder status Request | In this command, encoder sends status information, alarm bits and additional information. | Alarm bits (PM Alarm bits shown for Nikon A-format version 3.0 only), encoder status bits printed in the terminal along with CRC success. |
| 4 | ABS full 40 bit data request(MT) | In this command, encoder sends absolute 40 bit data for multiple encoders connected in bus with status information. | CRC success with rotor angle, number of rotations and CRC values printed in the terminal. |
| 5 | ABS lower 24bit data request(MT) | In this command, encoder sends absolute lower 24 bit data for multiple encoders connected in bus with status information. | CRC success with rotor angle, number of rotations and CRC values printed in the terminal. |
| 5 (Nikon A-format version 3.0 only, based on factory setting) | ABS full 40bit data + velocity data request | In this command, encoder sends absolute 40 bit data for multiple encoders connected in bus with status and velocity information. | CRC success with rotor angle, number of rotations, velocity and CRC values printed in the terminal. |
| 6 | ABS upper 24bit data request(MT) | In this command, encoder sends absolute upper 24 bit data for multiple encoders connected in bus with status information. | CRC success with rotor angle, number of rotations and CRC values printed in the terminal. |
| 7 | Encoder status Request(MT) | In this command, encoder sends status information, alarm bits and additional information for all encoders connected in bus. | Alarm bits (PM Alarm bits shown for Nikon A-format version 3.0 only), encoder status bits printed in the terminal along with CRC success. |
| 8 | Status flag clear request | In this command, encoder sends status information, alarm bits and additional information after clearing the status flags. | Alarm bits (PM Alarm bits shown for Nikon A-format version 3.0 only), encoder status bits printed in the terminal along with CRC success. |
| 9 | Multiple turn data clear request | In this command, encoder sends status information, alarm bits and additional information after clearing the multiple turn data bits. | Alarm bits (PM Alarm bits shown for Nikon A-format version 3.0 only), encoder status bits printed in the terminal along with CRC success. |
| 10 | Status+ Multiple turn data clear request | In this command, encoder sends status information, alarm bits and additional information after clearing the status and multiple turn data bits. | Alarm bits (PM Alarm bits shown for Nikon A-format version 3.0 only), encoder status bits printed in the terminal along with CRC success. |
| 11 | Encoder address setting I (one-to-one connection) | In this command, encoder address setting will be performed and status will be returned with ALM bits. | Alarm bits (PM Alarm bits shown for Nikon A-format version 3.0 only), encoder status bits printed in the terminal along with CRC success. |
| 12 | Single turn data zero preset | In this command, encoder sets single turn data bits to zero and returns status bits along with ALM bits. | Alarm bits (PM Alarm bits shown for Nikon A-format version 3.0 only), encoder status bits printed in the terminal along with CRC success. |
| 8 to 12 (Nikon A-format version 3.0 only, based on factory setting) | ABS lower 24bit data request | In this command, encoder sends absolute lower 24 bit data for single encoder with status information. | CRC success with rotor angle, number of rotations and CRC values printed in the terminal. |
| 13 | EEPROM read request | In this command, encoder sends EEPROM register data along with the requested address information. | CRC success with matching address (received address should be the same as sent by user) |
| 13 (Nikon A-format version 3.0 only) | EEPROM read request with bank | In this command, encoder sends EEPROM register data along with the requested address and bank information. | CRC success with matching address and bank (received address and bank should be the same as sent by user) |
| 14 | EEPROM write request | In this command, encoder performs write and acknowledges the data and address specified by user. | CRC success with matching data and address (received data and address should be the same as sent by user) |
| 14 (Nikon A-format version 3.0 only) | EEPROM write request with bank | In this command, encoder performs write and acknowledges the data, address and bank specified by user. | CRC success with matching data, address and bank (received data, address and bank should be the same as sent by user) |
| 15 | Temperature data request | In this command, encoder sends temperature information along with status. | Encoder temperature and status bits printed in the terminal along with CRC success. |
| 16 | Identification code read I | In this command, encoder sends identification code. | Encoder identification code will be printed in the terminal along with CRC success. |
| 16 (Nikon A-format version 3.0 only) | Velocity coefficient read | In this command, encoder sends velocity coefficient. | Encoder velocity coefficient will be printed in the terminal along with CRC success. |
| 17 | Identification code read II(one-to-one connection) | In this command, encoder sends identification code irrespective of encoder address. | Encoder identification code will be printed in the terminal along with CRC success. |
| 18 | Identification code write I | In this command, encoder writes and acknowledges identification code provide by user in its local register. | CRC success with matching identification code (received identification code should be the same as sent by user) |
| 18 (Nikon A-format version 3.0 only) | Velocity coefficient write | In this command, encoder writes and acknowledges velocity coefficient. | CRC success with matching velocity coefficient (received velocity coefficient should be the same as sent by user) |
| 19 | Identification code write II(one-to-one connection) | In this command, encoder writes and acknowledges identification code provide by user in its local register irrespective of encoder address. | CRC success with matching identification code (received identification code should be the same as sent by user) |
| 20 | Encoder address setting II | In this command, encoder address is set based on identification code provided by user. | CRC success with matching identification code (received identification code should be the same as sent by user) |
| 21 | ABS lower 17bit data request | In this command, encoder sends absolute lower 17 bit data for single encoder with status information. | CRC success with rotor angle, number of rotations and CRC values printed in the terminal. |
| 22 | ABS lower 17bit data request(MT) | In this command, encoder sends absolute lower 17 bit data for encoders connected in bus with status information. | CRC success with rotor angle, number of rotations and CRC values printed in the terminal. |
| 23 (Nikon A-format version 3.0 only) | ABS lower 24bit + velocity request | In this command, encoder sends absolute lower 24 bit data for single encoder with velocity information. | CRC success with rotor angle, number of rotations, velocity and CRC values printed in the terminal. |
| 24 (Nikon A-format version 3.0 only) | ABS lower 24bit + velocity request(MT) | In this command, encoder sends absolute lower 24 bit data for encoders connected in bus with velocity information. | CRC success with rotor angle, number of rotations, velocity and CRC values printed in the terminal. |
| 25 (Nikon A-format version 3.0 only) | ABS lower 24bit + velocity + acceleration request | In this command, encoder sends absolute lower 24 bit data for single encoder with velocity and acceleration information. | CRC success with rotor angle, number of rotations, velocity, acceleration and CRC values printed in the terminal. |
| 26 (Nikon A-format version 3.0 only) | ABS lower 24bit + velocity + acceleration request(MT) | In this command, encoder sends absolute lower 24 bit data for encoders connected in bus with velocity and acceleration information. | CRC success with rotor angle, number of rotations, velocity, acceleration and CRC values printed in the terminal. |
| 27 | ABS lower 24bit + status request | In this command, encoder sends absolute lower 24 bit data for single encoder with status and alarm bits information. | CRC success with rotor angle, number of rotations, alarm bits and CRC values printed in the terminal. |
| 28 | ABS lower 24bit + status request(MT) | In this command, encoder sends absolute lower 24 bit data for encoders connected in bus with status and alarm bits information. | CRC success with rotor angle, number of rotations, alarm bits and CRC values printed in the terminal. |
| 29 | ABS lower 24bit + temperature data request | In this command, encoder sends absolute lower 24 bit data for single encoder with temperature information. | CRC success with rotor angle, number of rotations, temperature and CRC values printed in the terminal. |
| 30 | ABS lower 24bit + temperature data request(MT) | In this command, encoder sends absolute lower 24 bit data for encoders connected in bus with temperature information. | CRC success with rotor angle, number of rotations, temperature and CRC values printed in the terminal. |
| 32 (NOTE: This is not a command with ID 32, it is UART option number 32) | Start Periodic CMP Mode | In this command, encoder sends absolute lower 40 bit data for encoders connected in point to point / bus based on IEP CMP event. | CRC success with rotor angle, number of rotations and CRC stats printed in the terminal. |
| 33 (NOTE: This is not a command with ID 33, it is UART option number 33) | Start Periodic CAP Mode | In this command, encoder sends absolute lower 40 bit data for encoders connected in point to point / bus based on IEP CAP event. | CRC success with rotor angle, number of rotations and CRC stats printed in the terminal. |