1

I have been playing around with this shield for a couple of days now and I have to agree with some statements made in the comments that the "library" lacks many functions.

However I have discovered the following library which was built for the Dynamixel shield: https://github.com/zcshiner/Dynamixel_Serial

I wanted to know since I am using an Arduino Uno, which parameters I would have to change to make it work.

Sorry I am not very fluent in C++. I have tried just changing the direction pin to 10 but it's obviously not sufficient.

Shield to be dealt with: https://dfrobot.com/index.php?route=product/product&product_id=958

The following code should work afterwards:

#include <dynamixel_serial.h> // Library needed to control Dynamixel servo
#define SERVO_ID 0x01 // ID which we will set Dynamixel to
#define SERVO_ControlPin 0x0A // Control pin of buffer chip, NOTE: this does not matter because we are not using a half to full control buffer.
#define SERVO_SET_Baudrate 57600 // Baud rate speed which the Dynamixel will be set to (57600)
#define CW_LIMIT_ANGLE 0x001 // lowest clockwise angle is 1, as when set to 0 it sets servo to wheel mode
#define CCW_LIMIT_ANGLE 0xFFF // Highest anti-clockwise angle is 0XFFF, as when set to 0 it sets servo to wheel mode
void setup() {
 delay(1000); // Give time for Dynamixel to start on power-up
 Dynamixel.begin(SERVO_SET_Baudrate); // We now need to set Arduino to the new baud rate speed
 Dynamixel.setDirectionPin(SERVO_ControlPin); // Optional. Set direction control pin
 Dynamixel.setMode(SERVO_ID, SERVO, CW_LIMIT_ANGLE, CCW_LIMIT_ANGLE); // set mode to SERVO and set angle limits
 Serial.begin(115200);
 Serial.println("Setup Done!");
 pinMode(13, OUTPUT);
}
void loop() {
 digitalWrite(13, HIGH);
 Dynamixel.servo(SERVO_ID,0x001,0x100); // Move servo to angle 1(0.088 degree) at speed 100
 delay(4000);
 Dynamixel.servo(SERVO_ID,0xFFF,0x3FF); // Move servo to max angle at max speed (1023)
 delay(4000);
}
per1234
4,2782 gold badges24 silver badges43 bronze badges
asked Jan 6, 2017 at 17:47

1 Answer 1

1

You are setting the baudrate to 57.6K however, you need to communicate with the Dynamixel at the baudrate it is set to. I believe the Dynamixel comes with a preset baudrate of 1Mbs. The first thing thing I would do is to change your 57.6K to 1Mbs and try that. This is assuming the ID is actually 1 (also a default)

Here are two links for info on Arduino baud rates and Dynamixel serial communications.

Controlling AX-12 Servos

How high of a baud rate can I go (without errors)?

answered Jan 10, 2017 at 20:26
1
  • Thank you very much I am going to try as soon as I have got the possiblitiy Commented Jan 12, 2017 at 10:30

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.