Skip to main content
Version 0.1

NCoder CAN

Version:

The NCoder is a modular encoder system that combines high-resolution angular position encoder unit with user-friendly software tools, enabling precise motion tracking and simplified integration into a wide range of control applications. With a built-in CAN interface, the NCoder connects seamlessly to the NLink Adapter, providing full control and effortless configuration through our intuitive Software SDKs.

Specifications

  • 12-48 V DC Input Voltage
  • External SPI Interface to connect the encoder module.
  • External encoder board provides more flexible mounting options for encoder.
  • Can output various encoder data points such as Position.
  • Flexible support for multiple SPI-based encoder modules such as NCoder 732 & NCoder 600.
  • CAN 2.0B @500kbps (1Mbps Comming soon).
  • Has Daisy Chainable CAN Bus Interface. Provides hassle free connection with other CAN components including our NMotion Components.
  • Can be easily configured & controlled by using our Python / C++ SDKs and NMotion CLI Tool.

Two-Part Architecture

The NCoder system consists of two main hardware components, designed to offer flexible mounting options for a wide range of applications:

  • Sensor Element – A high-resolution external magnetic encoder responsible for precise position measurement.
  • Control Shield – A power and communication interface that manages configuration, transmits data over CAN, and handles control and position data processing.

Hardware

LED Status Indications​

The NCoder device incorporates three LEDs to indicate various operational states:

  • Power LED: Turns ON when the board is powered ON.
  • CAN Communication LED: Flashes to signify ongoing CAN bus communication (both incoming and outgoing data).
  • Error LED: Turns ON when an error is encountered, and turns OFF when the errors are cleared.

Power Interface

The board supports a wide input voltage range of 12–48 V and uses terminal blocks for power connection.

danger
  • DC power input pins can't tolerate reverse polarity, please verify all power connections before energizing the NCoder
  • DC power supply line can't tolerate voltages above 56 V.
  • Never hot plug the NCoder, make sure that the power connections are connected before turning on the power.

Absolute Encoder Interface

The board supports an external absolute encoder with an SPI interface. To utilize this feature, connect the encoder's MOSI, MISO, CLK, and CS pins to the corresponding pins on the board. The encoder can be powered using the 3.3 V and GND pins available on the board.

A 6-pin JST connector with a 1.25 mm pitch is suitable for connecting the absolute encoder.

danger

Ensure that the connected absolute encoder's current consumption does not exceed 150mA.

CAN Bus Interface

The board features a daisy chainable CAN bus interface with two CAN ports. One port is designated for incoming CAN bus connections from the main device, while the other port is intended for connecting to the subsequent device in the bus chain.

A 2-pin JST PH connector with a 2mm pitch is suitable for both CAN ports.

warning

If the NCoder is the last component in the CAN bus chain, ensure that the termination resistor is in ON position to enable the termination resistor. Failure to do so may result in communication errors.

Drawing

All dimensions are in mm

Configuration

The NCoder can be controlled via a CAN bus interface. When connected through the NLink Adapter, it also supports USB communication, enabling configuration and control using the NMotion CLI Tool and the NMotion Transport Library.

API functions for interacting with the NCoder are available in the NCoder API Documentation.

CAN Bus Configuration

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.

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 resolution. For the absolute encoder, the resolution value in 2bits value must be configured.

The configuration for different encoders are as follows:

encoder_type valueEncoder TypeDescription
0TYPE_NONEUsing no encoder
4TYPE_SPI_ABS_MAXXXUsing MAXXX series absolute encoders from Monolith Power Systems (Tested with MA732, MA600)

The API functions involved in this configuration are as follows:

Operation

Getting Datapoints

The NCoder provides real-time access to key motion parameters such as raw position 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:

API Reference

C/C++ API Reference

NCoder.NCoder()

NCoder::NCoder(uint32_t device_id, Interface *interface);
Description

Construct a new NCoder object

Parameters
DatatypeVariableDescription
uint32_tnode_idCAN Node ID of NCoder
Interface *interfaceInitialised CAN Interface object for the interface to which the NCoder is connected

NCoder.getNodeId()

ret_status_t NCoder::getNodeId(uint32_t *node_id)
Description

Get current CAN Node ID of NCoder.

Parameters
DatatypeVariableDescription
uint32_t *node_idPointer to the variable to which the current CAN Node ID of the NCoder is to be saved.
Returns
DatatypeDescription
ret_status_tReturn Status

NCoder.setNodeId()

ret_status_t NCoder::setNodeId(uint32_t id)
Description

Set the node id for the NCoder.

Parameters
DatatypeVariableDescription
uint32_tidCAN Node ID of the NCoder
Returns
DatatypeDescription
ret_status_tReturn Status

NCoder.configureEncoder()

ret_status_t NCoder::configureEncoder(uint8_t encoder_type, int32_t resolution_param)
Description

Configure the encoder parameters

encoder_type valueEncoder TypeDescription
0TYPE_NONEUsing no encoder
4TYPE_SPI_ABS_MAXXXUsing MAXXX series absolute encoders from Monolith Power Systems (Tested with MA732, MA600)
Parameters
DatatypeVariableDescription
uint8_tencoder_typetype of encoder used
int32_tresolution_paramResolution value in 2bits
Returns
DatatypeDescription
ret_status_tReturn Status

NCoder.getAbsoluteAngle()

ret_status_t NCoder::getAbsoluteAngle(float *abs_angle)
Description

Get the current absolute angle measurement from the encoder (in degrees)

Parameters
DatatypeVariableDescription
float *abs_anglePointer to the variable where the absolute angle value is to be saved
Returns
DatatypeDescription
ret_status_tReturn Status

NCoder.getEncoderCount()

ret_status_t NCoder::getEncoderCount(int32_t *encoder_count)
Description

Get the current encoder count (angular Increment)

Parameters
DatatypeVariableDescription
int32_t *encoder_countPointer to the variable where the encoder count value is to be saved
Returns
DatatypeDescription
ret_status_tReturn Status

NCoder.getEncoderRawData()

ret_status_t NCoder::getEncoderRawData(uint32_t *abs_position)
Description

Get the raw absolute position data directly from encoder hardware

Parameters
DatatypeVariableDescription
uint32_t *abs_positionPointer to the variable where the raw data value is to be saved
Returns
DatatypeDescription
ret_status_tReturn Status

NCoder.getEncoderConfiguration()

ret_status_t NCoder::getEncoderConfiguration(uint8_t *encoder_type, int32_t *resolution_param)
Description

Retrieve the current encoder configuration parameters

Parameters
DatatypeVariableDescription
uint8_t *encoder_typePointer to the variable where the encoder type value is to be saved
int32_t *resolution_paramPointer to the variable where the encoder resolution is to be saved
Returns
DatatypeDescription
ret_status_tReturn Status

Python API Reference

NCoder.__init__()

__init__(id: int, interface: USBInterface) 
Description

NCoder class constructor.

Parameters
DatatypeVariableDescription
intidCAN Node ID of NCoder
USBInterfaceinterfaceInitialised CANInterface or USBInterface object

NCoder.getNodeId()

getNodeId() ->  'tuple[int, int]'
Description

Get current CAN Node ID of the NCoder.

Returns
DatatypeDescription
'tuple[int,int]'Tuple containing return status and the current CAN Node ID.

NCoder.setNodeId()

setNodeId(id: int) -> int
Description

Set the node id for the NCoder.

Parameters
DatatypeVariableDescription
intidCAN Device ID of the NCoder
Returns
DatatypeDescription
intReturn Status

NCoder.configureEncoder()

configureEncoder(encoder_type: int, resolution_param: int = 4096) -> int
Description

Configure motor side encoder.

encoder_type valueEncoder TypeDescription
0TYPE_NONEUsing no encoder
4TYPE_SPI_ABS_MAXXXUsing MAXXX series absolute encoders from Monolith Power Systems (Tested with MA732, MA600)
Parameters
DatatypeVariableDescription
intencoder_typeType of encoder used
intresolution_paramResolution value in 2bits. This is set to 4096 by default.
Returns
DatatypeDescription
intReturn Status

NCoder.getEncoderRawData()

getEncoderRawData() -> tuple[int, int]
Description

Get the raw absolute position data directly from encoder hardware

Returns
DatatypeDescription
tuple[int, int]Tuple containing return status and the raw data value from the encoder

NCoder.getEncoderCount()

getEncoderCount() -> tuple[int, int]
Description

Get the current encoder count (angular Increment)

Returns
DatatypeDescription
tuple[int, int]Tuple containing return status and the encoder count value

NCoder.getAbsoluteAngle()

getAbsoluteAngle() -> tuple[int, float]
Description

Get the current absolute angle measurement from the encoder (in degrees)

Returns
DatatypeDescription
tuple[int, float]Tuple containing return status and the absolute angle value

NCoder.getEncoderConfiguration()

getEncoderConfiguration() -> tuple[int, int, int]
Description

Retrieve the current encoder configuration parameters.

Returns
DatatypeDescription
tuple[int, float]Tuple containing return status, encoder type and resolution parameter value
  NMotionTM  is a sub-brand of Nawe Robotics
Copyright © 2025 Nawe Robotics Private Limited