Difference between revisions of "ROBOTIS DYNAMIXEL XL330 Current Based Position Mode (Compliant Mode)"

From Lofaro Lab Wiki
Jump to: navigation, search
(Prerequisites)
(Overview)
Line 35: Line 35:
 
physically for a better understanding of what the final
 
physically for a better understanding of what the final
 
outcome should look like.
 
outcome should look like.
 +
 +
 +
=Tutorials w/Code=
 +
==Wiring Setup==
 +
To review, we must first ping the actuator so that can
 +
properly connect to it and continue with the tutorial.
 +
First we must properly wire and connect all
 +
components for this to happen.
 +
The following steps provide how to properly connect
 +
all components together:
 +
 +
===MKR Hookup Part 1===
 +
Connect the DYNAMIXEL Shield on top or
 +
below the Arduino MKR of your choosing.
 +
The header pins will show slightly. DO
 +
NOT TRY TO FORCE THE PINS ALL
 +
THE WAY DOWN OR YOU WILL
 +
DAMAGE YOUR COMPONENTS.
 +
 +
[[File:mkr-side.jpg|300px|Because Robots are People Too]]
 +
 +
 +
===MKR Hookup Part 2===
 +
Attach the female to female end wire to the
 +
shield in any of the 3 ports. Notice that the
 +
wire is keyed so that is inserted in a certain
 +
way.
 +
 +
===MKR Hookup Part 3===
 +
Attach the other female end of that same
 +
wire to one of the actuators.
 +
 +
[[File:mkr-hookup.jpg|300px|Because Robots are People Too]]
 +
 +
===MKR Hookup Part 4===
 +
Attach your battery to the JST2.0 battery
 +
port on the Shield so that the actuator can be
 +
powered. Do not connect the battery to the
 +
MKR or the actuator will not power
 +
 +
[[File:mkr-battery.jpg|300px|Because Robots are People Too]]
 +
 +
NOTE: If the actuator is running in factory settings, it
 +
will blink once when it is powered and will have the
 +
following attributes:
 +
 +
[[File:mkr-baud.jpg|300px|Because Robots are People Too]]
 +
 +
 +
===MKR Hookup Part 5===
 +
The final step is to take the USB device that
 +
came with the Arduino MKR and connect it
 +
to your computer and Arduino MKR series
 +
device. The final setup is shown as:
 +
[[File:mkr-hookup2.jpg|300px|Because Robots are People Too]]
 +
 +
 +
=Code=
 +
To continue on, make sure you have downloaded the
 +
DYNAMIXEL Protocol Headers for Arduino. You
 +
can find a tutorial here at this link.[https://emanual.robotis.com/docs/en/parts/interface/mkr_shield/]
 +
 +
Now that the header files are downloaded, I
 +
recommend look over the examples to familiarize
 +
yourself with the other modes. For this tutorial, I will
 +
be referencing the Dynamixel2Arduino
 +
current_based_position example provided.
 +
 +
We will begin by setting up the header files and teh
 +
global variables that we will be using throughout the
 +
code. To call the header file, we will type in the the
 +
phrase below:

Revision as of 21:24, 16 September 2021

Prerequisites

For this tutorial it is required to have the following items:

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

Examples

Current Based Position, also known as Torque Based Position, uses the concepts of Position and Current Control modes together to get an actuator to move to a goal position at a certain speed. This mode also helps identify if there is an object in the way of the actuators moving component and can trigger a stop function or a function to add more torque to move the object out of the way. This is a key mode for automated robots that move in a dynamic area where there are obstacles to move around or move entirely.

Overview

This tutorial will also go over how to program the physical XL330 actuator in Current Based Position mode using the DYNAMIXEL Shield with an Arduino MKR. We will begin with how to wire and power the components together to begin programming the actuator. We will then go over the breakdown of the code to have a clear understanding of what each line does and then examine the code as whole. During this tutorial, we will observe how the current and torque are plotted with and without and obstructions to the goal position path. At the end of these tutorials, there will be a link that briefly go over how these concepts are applied physically for a better understanding of what the final outcome should look like.


Tutorials w/Code

Wiring Setup

To review, we must first ping the actuator so that can properly connect to it and continue with the tutorial. First we must properly wire and connect all components for this to happen. The following steps provide how to properly connect all components together:

MKR Hookup Part 1

Connect the DYNAMIXEL Shield on top or below the Arduino MKR of your choosing. The header pins will show slightly. DO NOT TRY TO FORCE THE PINS ALL THE WAY DOWN OR YOU WILL DAMAGE YOUR COMPONENTS.

Because Robots are People Too


MKR Hookup Part 2

Attach the female to female end wire to the shield in any of the 3 ports. Notice that the wire is keyed so that is inserted in a certain way.

MKR Hookup Part 3

Attach the other female end of that same wire to one of the actuators.

Because Robots are People Too

MKR Hookup Part 4

Attach your battery to the JST2.0 battery port on the Shield so that the actuator can be powered. Do not connect the battery to the MKR or the actuator will not power

Because Robots are People Too

NOTE: If the actuator is running in factory settings, it will blink once when it is powered and will have the following attributes:

Because Robots are People Too


MKR Hookup Part 5

The final step is to take the USB device that came with the Arduino MKR and connect it to your computer and Arduino MKR series device. The final setup is shown as: Because Robots are People Too


Code

To continue on, make sure you have downloaded the DYNAMIXEL Protocol Headers for Arduino. You can find a tutorial here at this link.[1]

Now that the header files are downloaded, I recommend look over the examples to familiarize yourself with the other modes. For this tutorial, I will be referencing the Dynamixel2Arduino current_based_position example provided.

We will begin by setting up the header files and teh global variables that we will be using throughout the code. To call the header file, we will type in the the phrase below: