ROBOTIS DYNAMIXEL Shield for Arduino MKR Series Examples

From Lofaro Lab Wiki
Revision as of 22:06, 21 April 2021 by Dlofaro (Talk | contribs)

Jump to: navigation, search

Prerequisites

This tutorial assumes that you have the following:

  • 1x DYNAMIXEL Shield for Arduino MKR Series
  • 1x Arduino MKR compatible device. Note: This tutorial uses the Arduino MKR1000
  • 1x Compatible 1S LiPo battery with a JST2.0 connector. (Please check for proper polarity)
  • Nx DYNAMIXEL XL330-M288-T ROBOTIS actuators where N >= 1

Examples

This shows examples on how to use the DYNAMIXEL Shield for MKR with the DYNAMIXEL XL330-M288-T ROBOTIS actuators.

Ping

The first step is to make sure you can ping your actuator. This will let you know if you can connect to your actuator.

Wiring

Do the following steps to hook up the system for this test:

  1. Firmly place the DYNAMIXEL Shield on top or below the Arduino MKR1000. Note there may be about 0.5cm (0.2in) of headers still showing.
  2. Attach one end of the wire that came in the XL330's box wo one of the three ports on the shield that it fits into. Please noted that it is keyed. If it does not fit in easily you may be trying it backwards.
  3. Attach the other end of the wire from the previous step to the XL330 actuator.
  4. Attach the fully charged 1S battery to the JST2.0 battery port on the MKR shield. This will power the actuator. Do NOT hook it up to the JST2.0 port on the Arduino MKR1000. Please note that if you hook it up to the battery port on the Arduino side it will NOT power the actuator.
  5. If the actuator has factory setting it will blink one when it is powered on. Additionally it will have the following attributes:
ID: 1
Protocol: DYNAMIXEL Protocol 2.0
BAUD: 57600

To program the device you need to plug in the USB cable into your computer.

Code

Setup your serial ports:

 #define DXL_SERIAL   Serial1
 #define DEBUG_SERIAL Serial
 const uint8_t DXL_DIR_PIN = A6; // DYNAMIXEL Shield DIR PIN 

Note that the DXL_DIR_PIN is on pin A6, this allows the system to turn the full-duplex communication of the Arduino into the required half-duplex of the actuator.