Skip to content

PNDEncoderR

Introduction to ABS_EncoderR Parameters

Introduction

The ABS_Encoder is a module that provides end position detection for PNDbotics robot joint actuators. It has a series of functions such as Ethernet or Wi-Fi communication configuration and obtaining absolute angles, providing absolute position information at the joint end for the robot main control.

工程图

Application Scenarios

  • Scenario 1: End position detection of robotic arms.

  • Scenario 2: End output shaft position detection of parallel actuators.

  • Scenario 3: End position detection of knee joints of bionic biped robots.

Interface Specifications

接口规格

Serial Number Interface Description
A1, A12, B1, B12 GND
A4, A9, B4, B9 VBUS
A6, B6 USB differential signal D+, internally connected to USB-to-serial chip
A7, B7 USB differential signal D-, internally connected to USB-to-serial chip
A10 Ethernet receiving differential signal RX-
A11 Ethernet receiving differential signal RX+
B2 Ethernet sending differential signal TX-
B3 Ethernet sending differential signal TX+

Advanced Features

  • Supports the JSON-RPC framework for remote function calls.
  • Flexible configuration allows the selection of Ethernet or Wi-Fi communication, with Ethernet communication preferred.
  • One Type-C USB interface realizes Ethernet and serial communication.
  • OTA upgrade.

Interface Definition

Name Specs
Physical Layer 10/100Mbps Ethernet or 2.4GHz Wi-Fi
Transport Layer Protocol TCP/UDP
Communication Port (service) 2334
IP Acquisition Method DHCP/Static IP
Application Layer Protocol JSON-RPC

Indicator Status Description

Serial Number Blinking Mode Meaning
1 Fast purple breathing blinking Wired Ethernet connection in progress
2 Slow purple breathing blinking Wired Ethernet connection successful
3 Fast cyan-blue breathing blinking Wi-Fi connection in progress
4 Slow cyan-blue breathing blinking Wi-Fi connection successful
5 Fast red breathing blinking Error
6 Fast emerald green breathing blinking OTA upgrade in progress

JSON-RPC Protocol Framework

JSON-RPC is a stateless and lightweight remote procedure call (RPC) transmission protocol, with JSON as the main format of the transmitted content.

The JSON-RPC protocol framework in this article can use wired 10/100Mbps Ethernet or 2.4GHz Wi-Fi for communication at the physical layer. It supports DHCP function and can automatically obtain IP when connected to a router. Data is communicated using TCP or UDP connection, and the service port is 2334.

In the protocol, the "id" field specifies the sequence number of the call, the "method" field specifies the called method, the "params" field specifies the call parameters, and the "result" field specifies the returned results and parameters.

json-rpc Request Data Frame

Field Type Description
"id" Integer Each request must specify a request frame ID, otherwise it will not be executed.
"method" String Specifies the called method.
"params" Object Call parameters. For each called method, the specific parameter list will be expanded.

json-rpc Response Data Frame

Field Type Description
"id" Integer The request frame ID specified in each request is returned in the response.
"result" Object Response parameters. For each called method response, the response parameters will be expanded.

Communication Process

Here, the client represents the user's control computer (such as Raspberry Pi, PC, Mac, etc.), and the server represents the ABS encoder.

Step 1: Obtain device information by broadcasting within the local area network through UDP. After all ABS encoders are connected to the local area network. UDP broadcasting can be used first to obtain the device information of the encoders. The device information contains the IP address of the encoder. The broadcast address is 255.255.255.255 to query all devices within the local area network. After broadcasting, all online devices will return basic device information to the client.

Taking two devices in the local area network as an example:

Client broadcast content is:
1
2
3
4
5
{
  "id": 0, 
  "method": "Device.Info", 
  "params": 
}
Server reply content format is as follows: In UDP communication, the socket interface usually automatically returns the server address and port
Server received from ('192.168.11.114', 2334):
{
  "id":0,
  "result":
  {
    "serial_number":"10B6D825754C",
    "dev_model":"ABS_EncoderT",
    "dev_name":"ABS_Encoder0001",
    "Hw_version":"1.0.0",
    "fw_version":"1.0.3",
    "manufacturing_date":"20210308",
    "hostname":"ABS_encoderT",
    "connect_mode":"Wi-Fi",
    "DHCP_enable":false,
    "staticIP":"192.168.11.114",
    "RSSI":-48,
  }
}

Server received from ('192.168.11.115', 2334):
{
  "id":0,
  "result":
  {
    "serial_number":"10B6D825755D",
    "dev_model":"ABS_EncoderT",
    "dev_name":"ABS_Encoder0002",
    "Hw_version":"1.0.0",
    "fw_version":"1.0.3",
    "manufacturing_date":"20210308",
    "hostname":"ABS_encoderT",
    "connect_mode":"Wi-Fi",
    "DHCP_enable":false,
    "staticIP":"192.168.11.115",
    "RSSI":-48,
  }
}

Step 2: After obtaining the IP address of the ABS encoder, perform data transmission. After obtaining the IP address, you can establish a connection for communication through TCP or maintain UDP communication.

Obtain configuration information

Client sends to the Service port (2334) of the server
1
2
3
4
5
{
  "id": 0, 
  "method": "Config.Info", 
  "params": 
}
Server returns as follows
{
    "id":0,
    "result":          
    {      
        "dev_name":"ABS_EncoderT0002",
        "SSID":"abs",
        "password":"12345678",
        "hostname":"abs",
        "DHCP_enable":false,
        "staticIP":"192.168.11.119",
        "gateway":"192.168.11.1",
        "subnet":"255.255.255.0",
        "primaryDNS":"114.114.114.114",
        "secondaryDNS":"8.8.8.8"
    }
}

Obtain the absolute angle of the ABS encoder

Client sends to the Service port (2334) of the server
1
2
3
4
5
{
  "id": 0, 
  "method": "Encoder.Angle", 
  "params": 
}
Server returns as follows
1
2
3
4
5
6
7
8
{
  "id":0,
  "result":
  {
    "angle":130.715, //Angle value
    "radian":2.28141 //Radian value
  }
}

Set configuration information

The configuration information of the device includes device name, model, production date, hardware version number, Wi-Fi name, Wi-Fi password, host name, whether to enable DHCP, static IP, gateway, DNS, etc. The client can set a certain item individually or set multiple items at the same time. Takes effect after restarting the device.

Client sends to the Service port (2334) of the server
{
    "id": 0, 
    "method": "Set.Config", 
    "params": 
    {
        "dev_name":"ABS_EncoderT012",
        "ssid":"myssid",
        "password":"mypassword",
        "hostname":"abs",
        "DHCP_enable":true,
        "staticIP":"192.168.11.119",
        "gateway":"192.168.11.1",
        "subnet":"255.255.255.0",
        "primaryDNS":"114.114.114.114",
        "secondaryDNS":"8.8.8.8"
    }
}
Server returns as follows
1
2
3
4
5
6
7
{
  "id":0,
  "result":
  {
    "set config ok"
   }
}

OTA

After the device receives the OTA instruction, it starts the http upgrade firmware.

Client sends to the Service port (2334) of the server
1
2
3
4
5
{
  "id": 0, 
  "method": "OTA.Update", 
  "params": 
}
Server returns as follows
1
2
3
4
5
6
7
{
  "id":0,
  "result":
  {
    “recive ota update ok”
  }
}

Set configuration information

Restart the device

After the device receives the reset request and responds, it waits for one second and then restarts.

Client sends to the Service port (2334) of the server
1
2
3
4
5
{
  "id": 0, 
  "method": "reboot", 
  "params": 
}
Server returns as follows
1
2
3
4
{
  "id":0,
  "result":{"set reboot ok"}
}