Type3 ping error for XM430 & open rb 150

I’m using an XM430 W350T in combination with the openRB 150 and a solid power supply with 12V 5Amp output. When connecting the motor the led blinks and when the code upload is finished it blinks also

When running the provided ping example code in the Arduino IDE I recieve the following output in the serial monitor:
PROTOCOL 2.0, ID 1: ping failed!, err code: 3
Try Protocol 2 - broadcast ping:
Broadcast returned no items : 3

Thanks in advance for the help

There are currently some issues with ping() and scan() with the current Dynamixel2Arduino Library, see post:

Fortunately, ping() and scan() are not needed to control your Dynamixels.

Thanks for your response, however following you advice I uploaded the example position_control sketch. This one didn’t run either

/*******************************************************************************

  • Copyright 2016 ROBOTIS CO., LTD.
  • Licensed under the Apache License, Version 2.0 (the “License”);
  • you may not use this file except in compliance with the License.
  • You may obtain a copy of the License at
  • http://www.apache.org/licenses/LICENSE-2.0
    
  • Unless required by applicable law or agreed to in writing, software
  • distributed under the License is distributed on an “AS IS” BASIS,
  • WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  • See the License for the specific language governing permissions and
  • limitations under the License.
    *******************************************************************************/

#include <Dynamixel2Arduino.h>

// Please modify it to suit your hardware.
#if defined(ARDUINO_AVR_UNO) || defined(ARDUINO_AVR_MEGA2560) // When using DynamixelShield
#include <SoftwareSerial.h>
SoftwareSerial soft_serial(7, 8); // DYNAMIXELShield UART RX/TX
#define DXL_SERIAL Serial
#define DEBUG_SERIAL soft_serial
const int DXL_DIR_PIN = 2; // DYNAMIXEL Shield DIR PIN
#elif defined(ARDUINO_SAM_DUE) // When using DynamixelShield
#define DXL_SERIAL Serial
#define DEBUG_SERIAL SerialUSB
const int DXL_DIR_PIN = 2; // DYNAMIXEL Shield DIR PIN
#elif defined(ARDUINO_SAM_ZERO) // When using DynamixelShield
#define DXL_SERIAL Serial1
#define DEBUG_SERIAL SerialUSB
const int DXL_DIR_PIN = 2; // DYNAMIXEL Shield DIR PIN
#elif defined(ARDUINO_OpenCM904) // When using official ROBOTIS board with DXL circuit.
#define DXL_SERIAL Serial3 //OpenCM9.04 EXP Board’s DXL port Serial. (Serial1 for the DXL port on the OpenCM 9.04 board)
#define DEBUG_SERIAL Serial
const int DXL_DIR_PIN = 22; //OpenCM9.04 EXP Board’s DIR PIN. (28 for the DXL port on the OpenCM 9.04 board)
#elif defined(ARDUINO_OpenCR) // When using official ROBOTIS board with DXL circuit.
// For OpenCR, there is a DXL Power Enable pin, so you must initialize and control it.
// Reference link : OpenCR/port_handler_arduino.cpp at master · ROBOTIS-GIT/OpenCR · GitHub
#define DXL_SERIAL Serial3
#define DEBUG_SERIAL Serial
const int DXL_DIR_PIN = 84; // OpenCR Board’s DIR PIN.
#elif defined(ARDUINO_OpenRB) // When using OpenRB-150
//OpenRB does not require the DIR control pin.
#define DXL_SERIAL Serial1
#define DEBUG_SERIAL Serial
const int DXL_DIR_PIN = -1;
#else // Other boards when using DynamixelShield
#define DXL_SERIAL Serial1
#define DEBUG_SERIAL Serial
const int DXL_DIR_PIN = 2; // DYNAMIXEL Shield DIR PIN
#endif

const uint8_t DXL_ID = 1;
const float DXL_PROTOCOL_VERSION = 2.0;

Dynamixel2Arduino dxl(DXL_SERIAL, DXL_DIR_PIN);

//This namespace is required to use Control table item names
using namespace ControlTableItem;

void setup() {
// put your setup code here, to run once:

// Use UART port of DYNAMIXEL Shield to debug.
DEBUG_SERIAL.begin(115200);
while(!DEBUG_SERIAL);

// Set Port baudrate to 57600bps. This has to match with DYNAMIXEL baudrate.
dxl.begin(57600);
// Set Port Protocol Version. This has to match with DYNAMIXEL protocol version.
dxl.setPortProtocolVersion(DXL_PROTOCOL_VERSION);
// Get DYNAMIXEL information
dxl.ping(DXL_ID);

// Turn off torque when configuring items in EEPROM area
dxl.torqueOff(DXL_ID);
dxl.setOperatingMode(DXL_ID, OP_POSITION);
dxl.torqueOn(DXL_ID);

// Limit the maximum velocity in Position Control Mode. Use 0 for Max speed
dxl.writeControlTableItem(PROFILE_VELOCITY, DXL_ID, 30);
}

void loop() {
// put your main code here, to run repeatedly:

// Please refer to e-Manual(DYNAMIXEL Shield) for available range of value.
// Set Goal Position in RAW value
dxl.setGoalPosition(DXL_ID, 1000);

int i_present_position = 0;
float f_present_position = 0.0;

while (abs(1000 - i_present_position) > 10)
{
i_present_position = dxl.getPresentPosition(DXL_ID);
DEBUG_SERIAL.print("Present_Position(raw) : ");
DEBUG_SERIAL.println(i_present_position);
}
delay(1000);

// Set Goal Position in DEGREE value
dxl.setGoalPosition(DXL_ID, 5.7, UNIT_DEGREE);

while (abs(5.7 - f_present_position) > 2.0)
{
f_present_position = dxl.getPresentPosition(DXL_ID, UNIT_DEGREE);
DEBUG_SERIAL.print("Present_Position(degree) : ");
DEBUG_SERIAL.println(f_present_position);
}
delay(1000);
}

@jduv

There is a good chance that your XM-430 is set at 1 Mbps, but your sketch sets your DXL comm. rate at 57.6 Kbps, so not much is going to work for you.

As you have an OpenRB-150, have you tried to run the sketch named usb_to_dynamixel and then use the tool called Dynamixel Wizard 2 with it? This will allow you to see what baud rate is yours XM430 is set at (and other parameters too).

Also you probably can benefit from a more extensive tutorial about the OpenRB-150 for beginners, you can read the free Kindle sample of my Arduino book:

https://www.amazon.com/Using-ARDUINO-ROBOTIS-Systems-Ngoc-ebook/dp/B0BPXGQ6YX

I definitely going to read the book thanks for the suggestion. For the baudrate however I am sure it i on 57600bps. Using th R+ manager software I get connection and I can manipulatie the motor. I also checked the ID & protocol type.

Using the wizard I also dont get conection. I upload the arduino sketch usb_to_dynamixel to the OpenRB and scan then using the wizard2.0 on the same COM-port for all baudrates, but it doesn’t connect.

I’m really thankfull for your help!

Can you take and share a picture of the bottom side of the OpenRB-150? I need to see the QA sticker and also the revision level of your board.

I have the same version B also, and I do not have any problem running usb_to_dynamixel for my two 2XL430s:

When I switched to the Robotis-provided position_mode example, I could compile it OK, but it did not work for me at run time (see picture below):

So I cleaned out that big chunk of definition statements designed for different kind of boards, and just keep only the definitions pertinent to the OpenRB-150, and this cleaned-up version worked fine for me (see lines 19 through 21):

You can try my cleaned-up version below, and hopefully it will work for you too:

#include <Dynamixel2Arduino.h>

// my modifications
#define DXL_SERIAL Serial1
#define DEBUG_SERIAL Serial
const int DXL_DIR_PIN = -1;

const uint8_t DXL_ID = 1;
const float DXL_PROTOCOL_VERSION = 2.0;

Dynamixel2Arduino dxl(DXL_SERIAL, DXL_DIR_PIN);

//This namespace is required to use Control table item names
using namespace ControlTableItem;

void setup() {
  // put your setup code here, to run once:
  
  // Use UART port of DYNAMIXEL Shield to debug.
  DEBUG_SERIAL.begin(115200);
  while(!DEBUG_SERIAL);

  // Set Port baudrate to 57600bps. This has to match with DYNAMIXEL baudrate.
  dxl.begin(1000000);  // I use 1 Mbps for my XL430s
  // Set Port Protocol Version. This has to match with DYNAMIXEL protocol version.
  dxl.setPortProtocolVersion(DXL_PROTOCOL_VERSION);
  // Get DYNAMIXEL information
  dxl.ping(DXL_ID);

  // Turn off torque when configuring items in EEPROM area
  dxl.torqueOff(DXL_ID);
  dxl.setOperatingMode(DXL_ID, OP_POSITION);
  dxl.torqueOn(DXL_ID);

  // Limit the maximum velocity in Position Control Mode. Use 0 for Max speed
  dxl.writeControlTableItem(PROFILE_VELOCITY, DXL_ID, 30);
}

void loop() {
  // put your main code here, to run repeatedly:
  
  // Please refer to e-Manual(http://emanual.robotis.com/docs/en/parts/interface/dynamixel_shield/) for available range of value. 
  // Set Goal Position in RAW value
  dxl.setGoalPosition(DXL_ID, 1000);

  int i_present_position = 0;
  float f_present_position = 0.0;

  while (abs(1000 - i_present_position) > 10)
  {
    i_present_position = dxl.getPresentPosition(DXL_ID);
    DEBUG_SERIAL.print("Present_Position(raw) : ");
    DEBUG_SERIAL.println(i_present_position);
  }
  delay(1000);

  // Set Goal Position in DEGREE value
  dxl.setGoalPosition(DXL_ID, 5.7, UNIT_DEGREE);
  
  while (abs(5.7 - f_present_position) > 2.0)
  {
    f_present_position = dxl.getPresentPosition(DXL_ID, UNIT_DEGREE);
    DEBUG_SERIAL.print("Present_Position(degree) : ");
    DEBUG_SERIAL.println(f_present_position);
  }
  delay(1000);
}

I tried both methods:
For the cleaned up sketch I get this:

For the wizard method:

Finaly a picture from my setup:

Is there a method of procedure so I can systematically check components and debug the setup?

Thanks for sharing your setup.

One thing that I forgot to mention is about your USB C cable. I am assuming that it is of a good quality capable of “data transfer” and not just only good for power charging?

Yes, I also start to think that there is something amiss with your OpenRB-150, may be Serial1 or the DXL connectors are bad?

Anyhow, if you can get a U2D2 module, then you can test your DXL independently of the OpenRB-150.

The “weird” thing is that you were capable of controlling your DXL from MANAGER (when the usb_to_dynamixel sketch was running on the 150), but at the same time, Dynamixel Wizard 2 could not connect! This is so odd, because if it was a question of bad USB cable/port (or Windows Serial Driver) both MANAGER and DXL WIZARD should both “non-function”.

Another thought is that can you try to use the old Arduino IDE version 1 instead?

image

I had some issues with IDE V2 when I wrote my Arduino book, so I am still not using Arduino IDE 2 that much.

Finally, in my Arduino book free Kindle sample and in Section 2.3, I had to add one statement in the “variant.h” file for the 150. Did you do that step yet?

When working with the manager I use a the xm430 in combination with a power supply board and the following USB dongle: USB2AX for Dynamixel
So maybe the OpenRB is indeed malfunctioning.
I’ll try the older arduino IDE and another usb-c cable

Can I maybe use the serial 3 with same diy connectector to connect to the motor. In order to check if the serial 1 isn’t the problem?

Thank you very much for sharing the crucial information that you were using USB2AX when you used MANAGER to connect to your XM-430. In short, via this test, we now know for sure that your XM-430 works fine.

Going back to the OpenRB-150, so far your results showed that Serial works fine as you could download your Arduino sketch and all your Serial.println() commands worked fine.

But any time that you wanted to communicate with your DXL via Serial1, this is when/where you are getting problems. Right now, we don’t know if the issue is with Serial1 per se or with the TTL Communication Circuitry (Half-Duplex) that comes after it (XM430-W350-T/R). So my recommendation is to start an RMA process with the ROBOTIS dealer where you purchased the OpenRB-150 from, if your product is still under warranty.

Regarding using Serial3, this person had a similar issue with Serial1 on an OpenRB-150 and decided to dispense with using the Half-Duplex circuitry together and so he/she used Tx and Rx of Serial3 directly - see this post (it is in Korean so you’ll need to turn on Translation Service on your web browser).

So you can try this solution too - if you cannot wait for the RMA process, but make sure to use a Logic Level Shifter such as this one from Pololu - for a better long-term result:

As TX/RX from the OpenRB-150 on Pins 13-14 operate at 3.3V while the DATA Line for the DXL would kick back at 5V.

UPDATE: 4/2/2023
@jduv
As I have not yet (myself) checked out that previously posted method of using Serial3 and connecting Tx+Rx together to the DATA line of the DXLs, without the Logic Level Shifter, so I got myself a similar setup as shown below - whereas I used the OpenRB-150 DXL connector to only power the DXLs (this special RED DXL cable has its DATA line severed) and I connected Pins 13 and 14 together to the DATA Line of the WHITE DXL cable which has its VDD line cut-off. Both cables are connected to the same GROUND as the OpenRB-150.

Serial3_SetUp

But all I could do was reading Present Positions, all my Goal Position commands did not seem to go through. It looks like that, for my system, I cannot reproduce the results claimed in that previous post.

PositionMode_Serial3_1

So it looks like that you may have to go through the RMA process to let the ROBOTIS folks to look for what is really going on with your OpenRB-150.

2nd UPDATE: 4/2/2023
@jduv You are not alone anymore in getting these “strange” issues on your Open-150, because I just got the same symptoms on the Open-150 that I had been using trying to help you. It was working for more than a year now so my warranty is gone. I will contact @Jonathon separately for this.

Essentially for now, I can download any code on my OpenRB-150, and it will download with no errors OK, but my code does nothing when you look at the Arduino Serial Monitor (COM14) at run time (see picture below). However I can hook up my U2D2 at the same time to these DXLs via Dynamixel Wizard (COM15) and I can see and operate my DXLs as normal! . Basically my OpenRB-150 now has become a glorified power source for my DXLs - that is all :laughing:

OpenRB-150_Gone_2

My hunch is that the TTL Communications Circuitry somehow gave out, but Serial1 is still working.

@jduv @roboteer
This is seeming very much like something that will require some amount of investigation on our part to determine the root cause of the issue that has occurred with your OpenRB units. I would recommend submitting your units to your regional ROBOTIS representative for inspection and repair.

Thanks for the input, much appreciated. It is unfortunate that the hardware may be defective. I will start the RMA procedure.

Isn’t Arduino IDE and Wizard using the same port?
For example, if the Arduino IDE is occupying the COM port, Wizard may fail to open the COM port.
Close other programs and try Scan
The success of the search by the Manager is due to the use of a different interface called USB2AX.

When the Position_Mode example is executed, the part where the position value is 0 means a communication error.
(getPresentPosition function returns ‘0’ in case of an error)
In conclusion, communication between the controller and motor is poor, and there is a possibility of OpenRB serial failure or defective communication cable.

In my setup, COM3 on the PC is connected to the OpenRB-150 USB-C port. Next, the 2XL-430s are daisy-chained into the DXL connectors on the OpenRB-150. Lastly, the other end of the DXL daisy chain is connected to the U2D2 which is then connected to COM15 on my PC.

The picture below is for a WORKING OpenRB-150 via COM3 for Arduino, while Dynamixel Vizard is running via COM15. The DXLs would work in Sync Read/Write as normal as commanded from COM3, and I could see the RED needle on the Wizard’s window moving back and forth too.

OpenRB-150_GoodwithU2D2

But you can also see that Arduino Serial Monitor is picking up MANY incorrect Present Position and Present Velocity values, which are in a way stolen by U2D2 for Dynamixel Wizard :wink:

Next, I unplugged the USB cable from the U2D2 (COM15), which of course froze Dynamixel Wizard App and you can see that correct parameter values are starting to come back to the Arduino Serial Monitor on COM3.

OpenRB-150_GoodwithU2D2NotConnected

So definitely, on my BAD OpenRB-150 (which was using the same USB COM Port and Cable), the Serial1 and/or the TTL Communication circuitry are not working right. This particular OpenRB-150 is from an older batch which officially has some issues with the FET switch also - see this post below