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
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:
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);
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
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.
In this function, Time is millisecond(1/1000 second).
Exercise. Modify previous code for Dynamixels to actuate during input time
Here is answer
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.
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);
when you understand all above of the code, you can finally control each dynamixel.
Here is theanswer
Now you know how to move gantry.
For questions, clarifications, etc, Email: [email protected]