Motor not moving after code is uploaded

Hi everyone! I'm currently facing some issues with my project. I'm using an Arduino mega ADK which is connected to a RS 485 board for communication with my dynamixel RX64 motor. After successfully uploading the code below to the Arduino mega (when everything is powered), the motors do not move at all. Not too sure where the issue is as i've checked the connections between the components. Got the code from following this link:Arduino Dynamixel Library – Savage Electronics Blog

#include <DynamixelSerial.h>

void setup() {
  Serial.begin(9600); // Initialize the serial communication
  while(!Serial);     // Wait until the serial port is ready
  Dynamixel.setSerial(&Serial1); // &Serial - Arduino UNO/NANO/MICRO, &Serial1, &Serial2, &Serial3 - Arduino Mega
  Dynamixel.begin(1000000,2);  // Initialize the servo at 1 Mbps and Pin Control 2
  delay(1000);
}

void loop() {
  int position = random(200, 800);
  int speed = random(200, 800);

  Serial.print("Sending move command to servo 1, position: ");
  Serial.println(position);
  Dynamixel.move(1, position);  // Move the Servo randomly from 200 to 800
  delay(1000);

  Serial.print("Sending moveSpeed command to servo 1, position: ");
  Serial.print(position);
  Serial.print(", speed: ");
  Serial.println(speed);
  Dynamixel.moveSpeed(1, position, speed);
  delay(2000);

  Serial.println("Sending setEndless command to servo 1");
  Dynamixel.setEndless(1, ON);
  delay(1000);

  Serial.println("Sending turn command to servo 1, direction: RIGTH, speed: 1000");
  Dynamixel.turn(1, RIGTH, 1000);
  delay(3000);

  Serial.println("Sending turn command to servo 1, direction: LEFT, speed: 1000");
  Dynamixel.turn(1, LEFT, 1000);
  delay(3000);

  Serial.println("Sending setEndless command to servo 1");
  Dynamixel.setEndless(1, OFF);

  Serial.println("Sending ledStatus command to servo 1, status: ON");
  Dynamixel.ledStatus(1, ON);

  Serial.println("Sending moveRW command to servo 1, position: 512");
  Dynamixel.moveRW(1, 512);
  delay(1000);

  Serial.println("Sending action command to servo 1");
  Dynamixel.action();

  Serial.println("Sending ledStatus command to servo 1, status: OFF");
  Dynamixel.ledStatus(1, OFF);

  delay(1000);
}

Hello snoopy_makes

Welcome to the worldbest Arduino forum ever.

Use a logic analyzer to see what happens.

Insert Serial.println()´s at points of interrest.

Have a nice day and enjoy coding in C++.

Have You wired it up?
If You have, please post schematics showing how.

Yup have wired it according to this image. I'm using this RS485 board instead of the one in the image. RS485 Breakout Board,

If it were an annotate schematic as you wired it and not a frizzy we could determine if you have actually connected the grounds.

Hi,
Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?
Hand drawn and photographed is perfectly acceptable.
Please include ALL hardware, power supplies, component names and pin labels.

What are you using to power the motor?

Thanks.. Tom.. :smiley: :+1: :coffee: :australia:

And interfaces used.

Is this schematic enough? I'm not too sure if this is correct

Using the following hardware.
Arduino Mega ADK
RS485 sparkfun board / superdroid robots RS485 converter
Dynamixel RX64 motor
Power supply supplying 12.8V to power the motor
Connections made with wires via a breadboard

I tried using serial print between the code and I'm able to see this in my serial monitor


but the motor is still unable to move.

Hi,
Thanks for the diagram, just you forgot to add the power supply.

What are the specs of the power supply?
What model motor do you have?

Thanks.. Tom.. :smiley: :+1: :coffee: :australia:

Hi Tom,
I'm using the topward dual tracking dc power supply 6303d 6303D-10 Topward 205 W 30 V 3 A DC Power Supply Used
the motor i'm using is the Dynamixel RX-64 motor https://emanual.robotis.com/docs/en/dxl/rx/rx-64/#control-table-description

Thanks for the quick replies~

Additionally, I tested the motors using the Dynamixel Wizard software and the motor is able to move when i change the red line's position at the top right of the image

Hi everyone! i managed to get the motors to move! the issue was with the RS485 board that i was using. After changing the RS485 board with another one it works! i think the IC on the previous board may have been spoilt anyways thank you everyone for your help!

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.