The problems with monitoring positions from 2 motors

Not yet, I will try it later but I don’t think that will make any difference because I am currently getting unstable values even from the Dynamixel Wizard.

Seeing the pinout diagram that you shared, I can see the cause of the issue. Even though the ESP32 uses the same physical pin arrangement to the Arduino Uno, the pin definitions are incompatible. In order to use the shield you would need to redefine the pin assignments to match with the different pin layout.

Regarding your DYNMIXEL Wizard graph results, was the DYNAMIXEL connected directly to the U2D2 without the ESP32? The graph outputs don’t look valid to me, so I’m wondering what the issue might be there.

Thank you for pointing out the pin layout issues.

Basically, my setup was as follows:

Within the setup, I got the graphs above. If I don’t pin any tasks to ESP 32 or I disconnect the Shield and ESP32, the graphs will be normal ones with stable values.

With the shown setup, packets sent from the DXL Wizard on the PC via U2D2 can interfere with packets sent from the ESP 32 as you use the DXL shield as a common communication node and when both comm. lines are used at the same time, these packets will corrupt each other before they reach the DXLs or when the packets come from the DXLs.

I don’t think that the PC’s DXL Wizard and the ESP32’s Arduino Sketch (or any other Arduino Controller) are meant to be used at the same time.

When the EXP32 is running its program, have you tried to monitor the DXLs by “printing” the various DXL Present Positions (best with SyncRead) to the Arduino’s Serial Plotter tool via USB Port?

Thank you for pointing that out.

I have not tried that yet. but the problem is: I will also get unstable values without the u2d2 connection to the PC. Therefore, the estimated Serial plotter results of DXL’s Present Positions will be the same as the plots I demostrated above.

I also tried the position reading commands (reading 3 motors’s values without delay command) on arduino uno, it delivered stable values of DXL’s Present Positions.

As per your second paragraph, if the UNO can receive stable position values then the Arduino serial plotter ought to provide stable plots also. If not then something happens with communications between UNO and PC then?

I tried the serial plotter on both esp32 and uno yesterday, I was getting unstable values on esp32 while I was getting stable values on uno. I think there are certain communication or connection problems between esp32 and shield. Do you know the correct way of connecting and communicating the esp32 (i.e. wemos d1 r32) with dynamixel shield? I am not able to find information useful online.

Unfortunately, I have no experiences in using the UNO and ESP32. I have only used the MKR DXL Shield with MKR ZERO and PORTENTA H7 Lite, or the OpenRB-150. It looks like that the Arduino2Dynamixel library may not be optimized for the EXP32?

Perhaps you should look at switching entirely to OpenRB-150? which has a very reasonable cost at present.

I’m not sure exactly what pin definitions that you will need for this connection, but this older community page post may have some information that might help you figure out what changes you need to make.

Thank you for sharing me with it.

Plus: I just noticed that I forgot to mention 2 points in the previous replies:

  1. The motors are actually connected by the so-called “daisychain” method:

  2. The other 2 pins: 5v and GND on the left side of dynamixel shield are connected to the same pin positions on the left side of wemos d1 r32.

Just wondering if there are things to be noticed within the 2 points addressed above.

Thank you for sharing the device. I am also thinking about changing to better devices.

Regarding the “daisy chain” hook up, I use that topology all the time so there is no issue there.

Regarding the 5V Pin that you tapped from the Wemos D1 R32 to drive the DXLs and as I don’t use this board, you will have to check this issue yourself:

  1. If this 5V Pin is just a tap into your 5V external power supply (which is rated at 2A or 3A probably) then you should be fine.

  2. If this 5V Pin is somehow regulated by the Wemos, then you’ll need to make sure that the Wemos can output enough current to drive your DXLs. If this turns out to be in the case, then it would be better to reroute the DXL 5V pin directly to your external power supply as per item 1), or via the DXL Shield Power Pins.

Also, from I read via the web, the Wemos D1 R32 is compatible with 3.3V shield and modules only, and here you are, trying to use it with 5V DXLs?

Thank you for your reply.

The Dynamixel shield itself is already powered by an 5v external power supply through the power connector shown in the Dynamixel shield pinmap above. So it seems just to be a tap into my 5v external.

Also when I disconnect the 5v pins and the gnd pins, I will not get any values from the dynamixel shield.

Also from I read via the web, the Wemos D1 R32 is compatible with 3.3V shield and modules only,

Thank you for pointing that out. I do not have the other 5v compatible boards allow me to do multithreading now. So maybe connecting the 3.3v pins on the wemos and shield is a good idea?

ROBOTIS eManual says this

So the XC-330 needs 5V to move the Motor: i.e. VDD pin of the TTL 3-pin connector.
But the DATA Pin prefers 3.3V but is 5V tolerant. And Wemos TX/RX lines are at 3.3 V. So it looks like that you need a Level Shifter between Wemos (3.3V) and DXL Shield (5V)

Thank you for pointing that out.

I am just wondering how I can implement this. Can I just simply use the 3.3v pin and ground pin on DXL shield and connect them to the corresponding 3.3v pin and ground pin on Wemos? If not, I am wondering if the level shifter is used directly on the rx/tx pins or the 5v and ground pins on DXL shield.

Like I said before I don’t use your hardware (DXL Shield & Wemos), and the ROBOTIS e-manual does not carry the complete schematic of the DXL Shield, so I can only provide a best guess from the TTL Comm. Circuit that is provided. @Jonathon may have access to more info than me, so he can check on this too.

According to that TTL circuit, the DXL shield expects 5V on its TX, RX and TX_enable (meaning DIR PIN) and your Wemos most likely provides only 3.3 V on its UART Pins. So a Level Shifter module needs to be used between the DXL Shield and Wemos. Adafruit sells one with some tutorial videos too

According to the above warning, hopefully your Wemos UART device is still operational.

Sparkfun also sells similar products:

https://www.sparkfun.com/products/19626

or

https://www.sparkfun.com/products/12009

@gchen Happy New Year!

Today I thought of another solution for you to consider, but it requires you to ditch that UNO DXL Shield that you already have, and get the MKR DXL SHIELD instead:

First, it is obvious that the headers won’t match with your Wemos D1 R32 as the MKR DXL Shield is designed to sit on top of a MKR ZERO or PORTENTA H7. However, because it is designed to work with a MKR ZERO, the MKR DXL SHIELD is already made to accept UART Inputs at 3.3V and send out DXL packets at TTL 5V levels, so you won’t have to fool with a Level Shifter anymore. I don’t have the needed hardware to test out this idea yet, until a couple of weeks from now. So maybe @Jonathon and @willson can chime in if they think that this approach is feasible or not. I know that Will has a Feather ESP32 but I don’t know if he has time to get into this test or not.

Thank you very much for your reply and information! I will take your suggestion into consideration and see if I can implement them with my toolbox. Happy New Year!

@gchen

Bad news! I could not make my Feather ESP32 V2 to work with a DXL MKR shield.

See my post at

@gchen - UPDATE - Feb. 4 2023

I finally got ny AdaFruit Feather ESP32 V.2 to work with the MKR DXL shield, but with some caveats. See my post at

Thus, in theory, you should be able to use your Wemos ESP32 with the old UNO DXL Shield if you also incorporate Level Shifter PCB between the Wemos and UNO DXL Shield.

Pololu also sells them at