Programming Servo Motions with DynamixelSDK in Matlab on a Personal Computer
Last updated
Last updated
This guide only covers using Protocol 2.0 with Windows
Download the DynamixelSDK from Robotis' website, then unpack it to a location you will remember later. I personally chose my Documents folder.
Essentially this boils down to adding the locations of the libraries to your MATLAB path so MATLAB can find them.
Robotis provides a guide for installing the DynamixelSDK libraries that is 90% accurate. The only inaccuracy is you should also "Add with Subfolders" the path:
[DynamixelSDK folder]/c/build/win32/output
Once you've completed these steps, the list of paths you added should look something like this:
Connect the servo(s) you would like to control to the U2D2 and connect that to a USB port on your computer. Also ensure each servo has power.
This process does not have to be done for X series Dynamixels, as they already ship with Protocol 2.0 installed.
Ensure that only one servo is plugged into the U2D2 and power for this process. Changing Protocols must be done one servo at a time.
This tutorial requires Protocol 2.0, and MX series Dynamixels are shipped running Protocol 1.0. To switch them to Protocol 2.0, open the Dynamixel Wizard.
Use the scanning function of the Dynamixel Wizard to find your servo. Then, select the Recovery icon. This will open the Firmware Management window.
Click Next to click through the warnings, then choose the model of servo you have connected with (2.0) at the end. An image of the servo should come up when you click on it. Then click Next.
Select the latest latest version of the firmware if it isn't selected already, then click Next.
Select the COM port that your U2D2 is connected to, then click Next again.
You will then be prompted to disconnect power to the servo, wait a few seconds, then plug it back in again. I generally disconnect the barrel jack from the power shield, wait approx. 3 seconds, then plug it back in. The window will respond once power is reconnected and install the new firmware.
Once the installation is complete, click Next, then click Finish. You can now use the Scan tool to find your servo on Protocol 2.0.
All other control parameters (ID, Return Delay Time, Shutdown, etc.) will have been reset during the firmware installation, so you will need to set them to your liking before continuing.