Skip to content

Latest commit

 

History

History
35 lines (20 loc) · 2.99 KB

README.md

File metadata and controls

35 lines (20 loc) · 2.99 KB

Pincher and Dynamixel Demos

Basic movement scripts for a PincherX robot arm and a single Dynamixel motor, using Matlab.

These scripts run the PincherX100 robot arm from Interbotix, which uses five Dynamixel XL430 smart servos.

Setup

To run these files, you will first need to download the DynamixelSDK from: https://github.com/ROBOTIS-GIT/DynamixelSDK as a .zip file (see image below)

image

You will then need to extract the files and add them to your Matlab path, following the instructions here: https://emanual.robotis.com/docs/en/software/dynamixel/dynamixel_sdk/library_setup/matlab_windows/#building-and-running-the-sample-code

Note when you reach the step "Select [DynamixelSDK folder]/c/build/win32/output", you will need to select the 'win64' directory rather than win32, if your computer is 64bit.!

You only need to complete steps "4.14. 3. 1 Import Libraries" and "4. 14. 3.2 Import function reference" (i.e. you do not need to "Run example").

You may need to add a compiler to your matlab install. Click on 'Add-Ons' and search for MinGW, then install it: addonsmatlab

Code Usage

Once the steps above are completed, you can download and run this code in Matlab. DynmixelStartup.m defines the variables needed to control the motor and needs to be in the same directory for the other scripts to run.

Reach_Grab.m and Read_Positions.m are for the PincherX robot arm (exercise 5), Reel_Datalogger.m is for the Dynamixel motor attached to a spool (exercise 4).

Reach_Grab.m, Read_Positions.m and Reel_Datalogger.m require you to set the correct COM port number. You can find this by connecting the arm/motor to the computer and to power, opening device manager and checking 'Ports (COM & LPT)'. There should be a COM port present (e.g. 'COM21' in the image below). Use this as the variable 'DEVICENAME' in the Matlab code on line 8.

image

Reach_Grab.m will move the robot between two preset positions, based on user input in the Matlab command line. The preset positions, as well as the arm's speed and gripper force are defined on lines 32-42 in the code.

Read_Positions.m will read the arm's current joint angles and print them to the command line. You can use this function to manually set the arm into a position, then read the joint angles to use as input for Reach_Grab.m

Reel_Datalogger.m is for the Dynamixel motor attached to a spool. The code will rotate the motor a specified number of revolutions (defined on line 33), then produce a graph of velocity vs time.