First Look at Arduino UNO R4 and Dynamixel2Arduino

Arduino released UNO R4 back in July 2023, and I got interested in it, because finally the UNO R4 has a separate hardware UART for Serial Monitor (now as Serial()) and another hardware UART for DXL Control (now as Serial1() still via D0 and D1). So in theory it should be compatible with the DXL Shield (which was designed for UNO R3 and earlier).

I got my UNO R4 WiFi yesterday and I just got through my first tests with it and some 2XL-430 (see my setup below).

IMG_026866

  1. I got COMPILE errors due to Variable Naming conflicts between the RENESAS Library and the Dynamixel2Arduino library regarding Control Items LED_RED, LED_BLUE, and LED_GREEN - which were easily fixed as LED-REDD, LED_BLUEE, and LED_D_GREENN.

  2. Next test with simple Position Control using position_mode.ino modified for UNO R4, i.e.

#include <Dynamixel2Arduino.h>

#define DXL_SERIAL Serial1  // for UNO R4 Wifi
#define DEBUG_SERIAL Serial
const int DXL_DIR_PIN = 2; // DYNAMIXEL Shield DIR PIN
 
const uint8_t DXL_ID = 1;
const float DXL_PROTOCOL_VERSION = 2.0;

Dynamixel2Arduino dxl(DXL_SERIAL, DXL_DIR_PIN);

It compiled and downloaded OK, but no response from the ID=1 servo at all at run time:

image

  1. Next I tried Velocity Control mode with velocity_mode.ino. Compiled and downloaded OK. But still no response at run time

imagstrong texte

  1. Lastly, I tried my favorite test using SyncWriteRead to 4 DXLs, 2 set up in Position Control and 2 set up in Velocity Control. And unexpectedly, it “kind of” worked: all 4 DXLs seemed to be doing their “randomized” motions during run time (but their motions were not as “crisp” as if I were using an OpenRB-150). Present Positions were coming in “slower” (as compared to OpenRB-150), and very strangely NO PRESENT VELOCITY packets were received!

image

This is a video clip of the SyncWriteRead test:

In conclusion, Serial() and Serial1() do work independently on the UNO R4 Wifi, but some updating, hardware and software wise, are still needed from ROBOTIS, so I would not recommend folks to rush out and buy the UNO R4 right now, if your main objective is to use DXLs.

1 Like

UPDATE 4/3/2024

I picked up an UNO R4 Minima today and ran it through the previous tests as for the WiFi, and the results were same as I reported in the previous post.

UPDATE 4/4/2024

Just found this report on ROBOTIS GITHUB since July 2023

So it looks like that ROBOTIS is aware of this issue, but nobody is working on it!

@willson It looks like that there is an issue with the timing of the switching for TX & RX when sending/receiving DXL packets. Because SyncWriteRead did work sometimes, but regular setGoalPosition(0 and getPresentPosition() don’t work. Can you suggest the “coding areas” where I can try to adjust?