User Tools

Site Tools


dynamixel_modification

This is an old revision of the document!


How To Modify Dynamixel SDK code

Author: Yunki hong(05/2019), Myong Geon Kim(07/2019), Brandon Seo(Current) Email: [email protected]
Date: Last modified on <06/20/19>
Keywords: Tutorial, how to, step-by-step, dynamixel-sdk


This tutorial is an exercise session which means not only reading this session, please trying to write your own code.

Motivation and Audience



Readers of this tutorial assumes the reader has the following background and interests:


* Basic background of CPP * Full understanding of dynamixel set up : Dynamixel Set Up

The rest of this tutorial is presented as follows:



Wheel mode



Default setting of dynamixel has CCW angle limitation.
If we want to actuate dynamixel both CW and CCW, we need to unlock that limitation.
We call it “Wheel mode”.
For unlock CCW limitation, We will use

dxl_comm_result = packetHandler→write1ByteTxRx(portHandler, DXL1_ID, ADDR_CCW_LIMIT_ANGLE, 0, &dxl_error);

function.

Here we can find an address for CCW Limit angle.


=======================================================================================================

Exercise. Make the code for two Dynamixels to actuate in wheel mode on the same speed via Input speed.

Here is an answer

======================================================================================================= \\



Control actuating time



For controlling actuating time, we will use “sleep” function in “window.h” header file.
Search on Google if you have no idea about sleep function.
function is

Sleep(time)

In this function, Time is millisecond(1/1000 second).

=======================================================================================================

Exercise. Modify previous code for Dynamixels to actuate during input time
Here is answer

======================================================================================================= \\



Direction Change



Know how to change the direction of rotation is important for controlling Dynamixel.
Dynamixel speed has its own speed scale.
Read e-manual http://emanual.robotis.com/docs/en/dxl/mx/mx-28/#control-table-data-address

As you can see,

CW speed + 1024 = CCW speed

Now you know how to change direction.

=======================================================================================================

Exercise. Modify previous code for two Dynamixels to rotate on different direction.

Answer :
dxl_comm_result = packetHandler→write2ByteTxRx(portHandler, DXL1_ID, ADDR_MOVING_SPEED, spd, &dxl_error);
dxl_comm_result = packetHandler→write2ByteTxRx(portHandler, DXL2_ID, ADDR_MOVING_SPEED, spd + 1024, &dxl_error);

======================================================================================================= \\

Multiple Dynamixel Control

when you understand all above of the code, you can finally control each dynamixel.


\\Here is theanswer

Now you know how to move gantry.

Final Words

For questions, clarifications, etc, Email: [email protected]

dynamixel_modification.1562878565.txt.gz · Last modified: 2019/07/11 13:56 by bradseo