Quick Start for Dynamixel Pro v1.00b
vii. Operating Dynamixel PRO in various speeds
-
To control the movement speed in Joint Mode change the Goal Velocity.
-
There are two methods in changing the Goal Position and Goal Velocity of
Dynamixel PRO.
-
First, implement dxl_write_dword function twice to change the values.
Second, implement dxl_write function to simultaneously change the Goal
Position and Goal Velocity (see 2.44).
-
Since we have gone over dxl_write_byte, dxl_write_word, and
dxl_write_dword, please try the second method to change the Goal Position
and Goal Velocity of Dynamixel PRO.
-
Goal Position and Goal Velocity both use 2 bytes each (or 1 word each).
-
Thus, in order to simultaneously change the Goal Position and Goal Velocity, 8
bytes of fata needs to be transferred. You need to modify the data accordingly.
-
The data can be written like the example below.
int
position, velocity;
position = 100000;
velocity = 10000;
//Make a tx data
unsigned char
data[0] = DXL_LOBYTE(DXL_LOWORD(position));
data[1] = DXL_HIBYTE(DXL_LOWORD(position));
data[2] = DXL_LOBYTE(DXL_HIWORD(position));
data[3] = DXL_HIBYTE(DXL_HIWORD(position));
data[4] = DXL_LOBYTE(DXL_LOWORD(velocity));
data[5] = DXL_HIBYTE(DXL_LOWORD(velocity));
data[6] = DXL_LOBYTE(DXL_HIWORD(velocity));
data[7] = DXL_HIBYTE(DXL_HIWORD(velocity));
-
The goal position and goal velocity values are entered into the
type array implementing DXL_LOWORD, DXL_HIWORD, DXL_LOBYTE, and
DXL_HIBYTE functions.
-
Next, use dxl_write function to send the configured data to Dynamixel PRO.
dxl_write(Port, ID, P_GOAL_POSITION, 8, data, &ErrorStatus);
-
To simultaneously change the Goal Position and Goal Velocity implement
dxl_write function to modify 8 bytes of memory.
-
The program's entire source is shown below.
main.cpp
#include
<stdio.h>
#include
<conio.h>
#include
"dynamixel.h"
#define
COM_PORT_NUM
#define
BAUD_RATE_NUM
data[8];
17
3
//Comport Number of USB2DXL
//Baudrate Number of Dynamixel PRO
unsigned char
Page 60 / 139
Need help?
Do you have a question about the Dynamixel Pro and is the answer not in the manual?