Closed WilliamH07 closed 3 years ago
Hi @WilliamH07
Have you set the 2nd DYNAMIXEL ID to 10
as shown in your code?
DYNAMIXEL works with digital packets and each DYNAMIXEL should be properly assigned with non-duplicated ID.
Also, the default baudrate of XL430 is 57600bps while XL-320 is 1Mbps, so you need to use an identical baudrate for using these two DYNAMIXEL at the same time.
And the most important thing is the power. XL430 runs off of 11.1V while XL-320 runs with 7.4V.
In order to configure the DYNAMIXEL, I recommend to use DYNAMIXEL Wizard 2.0 with U2D2.
Thanks.
Hello @ROBOTIS-Will thanks for the reply,
I use the U2D2 with DYNAMIXEL Wizard 2.0 in order to configure the Dynamixel, I set all dynamixels at the same time Baud rate (1 Mbps
).
For the first XL430 I put the id 10
and for the second XL430 I put the id 11
.
And for the first XL320 I put the id 1
and the second XL320 I put the id 2
, all dynamixels work well separately.
But I would like to control all Dynamixel at the same time and thats the problem went I put my code only 1 dynamixel move (XL320ID1
) and the XL430 not react at all.
For the power supply I use the robotics starter kit power supply (12v 5a), but XL320 only uses 7.5v for that I put a voltage step-down module to convert 12v to 7.5v.
Thank you,
WilliamH07
Hello, I checked if all ID are the same in my code and my Dynamixel, I checked if my baudrate and everything is exactly the same. Everything is ok, I don’t understand why my code isn’t working
Hi @WilliamH07 Sorry about the late response. Last but not least, could you tell us which controller do you use? DYNAMIXEL2Arduino library and its example will work with OpenCR1.0 or OpenCM9.04. If you are using DYNAMIXEL Shield with Arduino boards, you should use DYNAMIXEL Shield library. Thank you.
Hello @ROBOTIS-Will thank for the reply,
I use a DynamixelShield with an Arduino Mega, I can control very Dynamixel independently with the library Dynamixel2Arduino.
I try the new library and I do like i already do in my old code. But like the first code, only one dynamixel works (XL320 id1
) but not the (XL430 id10
)
My put my code below :
#include <DynamixelShield.h>
#if defined(ARDUINO_AVR_UNO) || defined(ARDUINO_AVR_MEGA2560)
#include <SoftwareSerial.h>
SoftwareSerial soft_serial(7, 8); // DYNAMIXELShield UART RX/TX
#define DEBUG_SERIAL soft_serial
#elif defined(ARDUINO_SAM_DUE) || defined(ARDUINO_SAM_ZERO)
#define DEBUG_SERIAL SerialUSB
#else
#define DEBUG_SERIAL Serial
#endif
const uint8_t DXL_ID2 = 10;
const uint8_t DXL_ID = 1;
const float DXL_PROTOCOL_VERSION = 2.0;
DynamixelShield dxl;
//This namespace is required to use Control table item names
using namespace ControlTableItem;
void setup() {
// put your setup code here, to run once:
// For Uno, Nano, Mini, and Mega, use UART port of DYNAMIXEL Shield to debug.
DEBUG_SERIAL.begin(115200);
// Set Port baudrate to 57600bps. This has to match with DYNAMIXEL baudrate.
dxl.begin(1000000);
// Set Port Protocol Version. This has to match with DYNAMIXEL protocol version.
dxl.setPortProtocolVersion(DXL_PROTOCOL_VERSION);
// Get DYNAMIXEL information
dxl.ping(DXL_ID);
dxl.ping(DXL_ID2);
// Turn off torque when configuring items in EEPROM area
dxl.torqueOff(DXL_ID);
dxl.torqueOff(DXL_ID2);
dxl.setOperatingMode(DXL_ID, OP_POSITION);
dxl.setOperatingMode(DXL_ID2, OP_POSITION);
dxl.torqueOn(DXL_ID);
dxl.torqueOn(DXL_ID2);
}
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, 512);
dxl.setGoalPosition(DXL_ID2, 512);
delay(1000);
// // Print present position in raw value
// DEBUG_SERIAL.print("Present Position(raw) : ");
// DEBUG_SERIAL.println(dxl.getPresentPosition(DXL_ID));
// delay(1000);
// Set Goal Position in DEGREE value
dxl.setGoalPosition(DXL_ID, 5.7, UNIT_DEGREE);
dxl.setGoalPosition(DXL_ID2, 5.7, UNIT_DEGREE);
delay(1000);
// Print present position in degree value
// DEBUG_SERIAL.print("Present Position(degree) : ");
// DEBUG_SERIAL.println(dxl.getPresentPosition(DXL_ID, UNIT_DEGREE));
delay(1000);
}
Thank you, WilliamH07
Hi @WilliamH07
I tested your code and it worked well with my setting.
Please double check each DYNAMIXEL Configuration and UART-DYNAMIXEL switch
on DYNAMIXEL Shield.
The switch should be on the DYNAMIXEL
side when running the code.
Also, if you did not disconnect the VDD pin of XL-320, you might sharing the VDD for XL430 with XL-320 which will cause voltage error for XL-320.
Hello @ROBOTIS-Will , I use a step down voltage module to convert le 12v input to a 7.5v output for my XL320, I have 3 dynamixel already connected and ready to use. My XL430 are connected in chain, and my xl320 is on a connection direct to the board. I try to connect the XL430 without the chain, but only the XL320 works, I try the other one XL430 but only the XL320 works. For the vdd I use the power DC jack input of the Arduino (12V), like I said before I use a step down voltage module to convert the 12v to a 7.5v for the xl320. (I'm working on a Niryo one Project)
You can see on this photo my dynamixel (XL430 in chain) and a XL320 on a direct connection to the board:
On this photo you can see my board and the hardware I use:
(In the white box there is the step down module) with the cable from the XL320 and on the right there is the cable from the Xl430
I use the dc jack port of the arduino to power on everything, I connected the pin 5V and GROUND of the connector (XL320) on the board to the step down module and the data pin I connected to the cable.
I don't know why it's not working. Thank you, WilliamH07
For me everything seems right.
Could you connect the U2D2 to one of the TTL port of DYNAMIXEL Shield and try scan?
During this scan, you should put UART switch to Upload
side so that DYNAMIXEL wouldn't communicate with the Arduino board.
You may start scanning DYNAMIXEL with 2 XL430 and 2 XL-320.
If they are not detected, repeat the scan after removing one of them from the link.
Hello @ROBOTIS-Will, I do the manipulation with the U2D2 like you said, every dynamixel works. DYNAMIXEL XL430 in link are recognized and the XL320 also. I'm actually working with one XL320, and two XL430. I use the DYNAMIXEL Wizard 2.0 for the software with the U2D2. I power up my dynamixel with the alimentation of the Arduino Mega.
I post below my hardware: Thank you, WilliamH07
@WilliamH07 , if your Arduino doesn't do anything but supplying power, I don't see a reason for attaching DYNAMIXEL Shield to your Arduino board. You can simply connect the SMPS to U2D2 PHB while leaving all the connection on the DYNAMIXEL Shield the same. In this case, you should connect U2D2 and U2D2 PHB with a short 3 pin cable, and connect U2D2 PHB with DYNAMIXEL Shield with another 3 pin cable.
Hello @ROBOTIS-Will,
I try again to connect my DynamixelShield with the Arduino Board, to recognize the Dynamixel on the U2D2.
I power up my Dynamixel with the Power Hub PCB U2D2, very Dynamixel are recognized.
I can control very Dynamixel with the Dynamixel Wizard 2.0
perfectly.
Like you said my code is working in your setting, you use a OPENCM 9.04 with two LBS-04 battery to do 7.5v for the XL320 and for the XL430 you use the DynamixelShield to power the XL430 with 12v.
I use the 12v input from the DynamixelShield, then I convert it to 7.5v for the XL320 and 12v for the Xl430, normally it's the exacly same configuration for me and you ?
Thank you, WilliamH07
I don't see anything wrong with your setting. Please check if your DYNAMIXEL2Arduino and DYNAMIXEL Shield libraries are up to date and if possible, try supplying 7.5V from other source such as 2S Li-Po/Li-Io battery as I cannot assume that your voltage regulator works properly under all condition.
Hello @ROBOTIS-Will,
I try to connect the power of the XL320 to an other source of power, I connect the ground and data to the DynamixelShield
and disconnect the VDD like you do.
After that I connect the XL430 in link and connect to the board, I put the 12V input for the XL430.
Everything power up perfectly, but only the DXL_ID
works.
const uint8_t DXL_ID = 1; const uint8_t DXL_ID2 = 11;
Because when I put the ID1 or ID11 on the DXL_ID
it's working, but when I put ID1 or ID11 on the DXL_ID2
nothing works.
This is my hardware (a little messy ) but its exacly what you do before in your post :
Blue Green and Yellow cable are the ground. Orange cable is the Data. The blue cable on the left is for the 7.5v Data and Ground are connected to the DynamixelShield.
The XL320 and the XL430 are on different power circuit. Thank you, WilliamH07
Sorry, but I still cannot replicate your issue. Could you please confirm below information?
Hello @ROBOTIS-Will, I check everything you tell me to do :
ID 001 1000000bps
ID10 ID11 1000000bps
I try also to connect only the Xl430 and try to control them but it’s not working. I think it’s coming from the code and not the hardware
The default baudrate of XL430 is 57600 so in order to use with XL-320, you should set it to 1000000bps.
The Xl430 and Xl320 are on the same baudrate (1000000bps)
Very ID are correctly set on the Dynamixel
If you only connected XL430 to the DYNAMIXEl Shield(without the XL-320 regulator) and commented out the unused XL-320 sections, but the code didn't work, your XL430 could be damaged. It is not clear to identify your problem. I'd recommend to uninstall and reinstall the libraries and reset all the hardware to factory setting, then try one at a time.
Hello @ROBOTIS-Will,
Thank you for the reply,
I test what you said to me, I factory reset the Dynamixel and reinstall the library on an other PC to test if its not coming from my computer. The Dynamixel works one at a time, but went I try to move very Dynamixel at the same time, only one Dynamixel works.
I'm pretty sure its coming for the code, because went I put the XL430 ID10
on the DXL_ID
its working, but when I put the same Dynamixel on the DXL_ID1
the same Dynamixel won't move.
The Dynamixel are correctly set on the same baudrate for the communication and the ID match between the code and the reality.
Thank you,
WilliamH07
Hi @WilliamH07 Could you also try with the baudrate of 57600 bps instead of 1Mbps? I haven't heard any issue with XL430 and XL-320, but it looks like some Arduino boards have slight margin of error for 1Mbps. If you can also take the screenshot of transmitted / received packets with DYNAMIXEL Wizard 2.0 through U2D2, it would be helpful to figure out the issue. https://emanual.robotis.com/docs/en/software/dynamixel/dynamixel_wizard2/#packet
Open
I'm expecting to see something similar to below image.
Hello @ROBOTIS-Will ,
I try the code but I change the baudrate to 57600bps
, the XL430 works at the same time.
But when I add to the code the XL320, only the XL320 works, I change the XL320 baudrate to 57600bps
.
The XL430 who works at the beginning stop working with the XL320.
For the screenshot I don't understand, I connect the Dynamixel on the U2D2 and I can read the packages but how I can run the arduino example when my motor are connected on the U2D2 ?
Thank you,
WilliamH07
In the previous comment, I used U2D2 to read the communication on DYNAMIXEL TTL line and used Packet feature of DYNAMIXEL Wizard 2.0. You can follow the steps below to read the packet with U2D2.
Packet
window and select the U2D2 port and DYNAMIXEL Baudrate(57600, in your most recent setup)ON
, UART sw to Dynamixel
side)Hello @ROBOTIS-Will, Sorry for the late reply, Thank you so much for your help all of this month, now everything is working perfectly fine XL320 and XL430 at the same time. If you want I can provide you the output of the packet. Thank you so much for your help, WilliamH07
Hi @WilliamH07 I'm so glad to hear that your system works well :) Could you share the cause of the issue for future customer support with similar case? Thank you and wish the best for you.!
Hello @ROBOTIS-Will, I don't now exactly what is the issue but I can provide a little tutorial to correct this problem :
Do this step :
1- Connect the U2D2 on the Dynamixel shield with the Dynamixel connected
2- Plug in the power supply for the Dynamixel into the Arduino with the correct alimentation for the Dynamixel and connect the Arduino on the PC
3- Open the Dynamixel Wizard 2.0 and connect the U2D2
4- Start the scan to recognize every Dynamixel
5- Make sure every Dynamixel are updated on the last version
6- Make sure every Dynamixel are correctly set on the correct ID (Corresponding with the code)
7- Make sure every Dynamixel are set on the exactly same baudrate (put the Dynamixel on 57600bps
)
Next set to make sure everything is okay,
Open a new Arduino project, reinstall the Dynamixel2Arduino library
, and paste your code on the new Arduino project.
Make sure everything is corresponding between the U2D2 and the Arduino Project (ID, Baudrate).
Compile the code and upload it on the Arduino board, with the Dynamixel Shield switch set on UPLOAD and the Dynamixel Shield turn off.
Next when the code is uploaded on the Arduino board , on the Dynamixel Shield switch the switch on Dynamixel and turn on the Dynamixel Shield.
And last, click on the button reset
Normally everything is going to works fine but it's not working try the steps of @ROBOTIS-Will in the previous messages.
Thank you so much for your help, WilliamH07
Thank you very much for the detailed step by step instruction. We'll review your solution and see if we can find any bugs or issues in the code and trouble shooting process. Appreciate your patience and hope you are safe from the Covid-19. Thanks!
Hello everyone, I'm starting to code a code with Dynamixel2Arduino library to control multiple xl430 and x320 (2x xl430 2x x320). I use : position_mode to control my dynamixels, it works fine with only 1 dynamixel but I want to control 4 dynamixels in all. To control another dynamxiel I duplicate the code (I post the code I modified below). But with this only 1 dynamixel works (DXL_1). I don't understand why, can someone please help me? Thank you, WilliamH07