Configuration & Operation
The NCoder can be controlled via either the CAN bus interface or the onboard USB-C port. USB communication for configuration and control using the NMotion CLI Tool and the NMotion Transport Library is supported both through the NLink Adapter, enabling multi-device management, and directly via the onboard USB-C port for standalone operation with a single device.
API functions for interacting with the NCoder are available in the NCoder API Documentation.
CAN Bus Configuration
This is not necessary when NCoder is connected via USB-C and used as a standalone device.
The NCoder device utilizes a daisy chainable CAN bus for control. If multiple devices are present on the CAN bus, ensure that a unique CAN Node ID is assigned to the device. The allowable values of CAN Node ID is in the range of 0 to 127. The default CAN Node ID is 0 and must be modified to avoid communication conflicts.
Setting the CAN Node ID causes the driver to automatically disconnect and reconnect, and to retain the new ID after a device reboot, you must save the configuration.
The API functions involved in this configuration are as follows:
Encoder Configuration
Connect the external encoder (MA732 or MA600) to the control shield using the SPI interface. The encoder configuration inputs two values, encoder type and resolutions. For the absolute encoder, the resolution value in 2bits value must be configured.
The configuration for different encoders are as follows:
encoder_type value | Encoder Type | Description |
---|---|---|
0 | TYPE_NONE | Using no encoder |
2 | TYPE_INCREMENTAL | Using incremental Encoder (Tested) |
3 | TYPE_SPI_ABS_AMS | Using AS5047P absolute encoder from AMS (Tested) |
4 | TYPE_SPI_ABS_MAXXX | Using MAXXX series absolute encoders from Monolith Power Systems (Tested with MA732, MA702) |
5 | TYPE_SPI_ABS_MUXXX | Using MU series absolute encoders from iC-Haus (Tested with MU150, MU200) |
6 | TYPE_SPI_ABS_CUI | Using AMT 203 absolute encoder from CUI |
7 | TYPE_SPI_ABS_AEAT | Using AEAT absolute encoders from Broadcomm |
8 | TYPE_SPI_ABS_RLS | Using RLS absolute encoders from Renishaw |
9 | TYPE_SPI_ABS_MA600 | Using MA600 absolute encoder from Monolith Power Systems |
The API functions involved in this configuration are as follows:
Encoder Direction
Configuration parameter used to define the counting orientation of the encoder. Set to 0
or 1
depending on the spatial mounting position, ensuring that position and velocity values increment in the desired direction.
The API functions involved in this configuration are as follows:
SPI Register Settings
The register value of an externally connected MAxxx-series magnetic encoder module can be set as per application requirements. This operation writes a specified value to a control register of the encoder, such as the MA732 or MA600, using the SPI interface. The register_address
parameter identifies the target register, while the data
parameter specifies the value to be written. Writing to control registers enables direct configuration and tuning of the encoder’s internal settings through SPI communication.
Saving Configuration
Upon completing the configuration process, the settings can be saved to the NCoder’s non-volatile memory. This ensures that the configurations are retained even after a power cycle or device restart. Saving the configuration will trigger an automatic device reboot. The following configurations in the driver are saved:
- CAN Bus Configuration : CAN Node ID of the device.
- Encoder Configuration : Encoder parameters (type & resolution parameter).
- Encoder Direction : Value of direction parameter.
- Zero Position : Angle at which zero position was set to.
- Filter Window Length : Filter window length parameter of the velocity and acceleration filter.
- Scaling Factor: Scaling parameter of the velocity and acceleration.
The configuration data is stored in the microcontroller's onboard EEPROM memory. To prolong the memory's lifespan, it is recommended to limit the frequency of configuration updates, as EEPROMs have a finite number of write cycles.
The API functions involved with saving configuration are as follows:
Operation
Zero Position
The device supports zero position setting, allowing its current position to be defined as zero for precise position calculation.
Saving the configuration is required to preserve this zero position setting and retain it after power loss.
The API functions involved with this are as follows:
Setting Linear Count
The user can set the linear count by manually assigning a specific value to the encoder count, thereby defining a custom reference point for position measurements. Once configured, all subsequent position values are calculated relative to this assigned count, ensuring alignment with a known physical position or an application-specific reference.
Saving the configuration is required to preserve this linear count value and retain it after power loss.
The API functions involved with this is as follows:
Position Datapoints
The NCoder provides real-time access to key motion parameters such as raw position data, velocity data, acceleration data, encoder count data and absolute angle. These values can be retrieved using dedicated API functions or via the NMotion CLI Tool. Data is continuously updated and transmitted over the CAN bus, enabling integration with control systems and logging tools.
The API functions involved with getting various data points are as follows:
Velocity and Acceleration Datapoints
Filtering
While calculating velocity and acceleration, the device can apply a digital moving average filter with a rectangular window to the raw velocity and acceleration data, effectively reducing high-frequency components. The filter length, configurable within an inclusive range of 1 to 100, determines the degree of smoothing applied—longer lengths provide greater smoothing but reduce system responsiveness. This setting allows fine-tuning of the balance between noise reduction and real-time response for optimal system performance.
The API functions involved with this setting are:
Scaling
While calculating velocity and acceleration, the device can apply a scaling factor to produce scaled outputs. The scaled velocity or acceleration is obtained by dividing the raw value by the specified scaling factor.
scaled_output = raw_value / scaling_parameter
The API functions involved with this setting are:
Getting Processed and Raw Datapoints
The user can retrieve velocity and acceleration data from the device in scaled, filtered, or raw form.
The API functions involved with getting these datapoints are: