Table of Contents
How To Move Gantry Using Visual Studio C++
Author: Yunki Hong and Myong Geon Kim Email: m.geon.kim@gmail.com
Date: Last modified on <06/20/19>
Keywords: Tutorial, how to, step-by-step, gantry, CPP, intern
Motivation and Audience
This tutorial offers you the step-by-step method to control DASL Gantry crane with modifying Dynamixel SDK in Windows environment.
Readers of this tutorial assumes the reader has the following background and interests:
* Basic background of CPP
* Full understanding of Dynamixel tutorial : Dynamixel tutorial
* Full understanding of Modifying Dynamixel SDK code : Modifying Dynamixel SDK code
The rest of this tutorial is presented as follows:
- Final Words
Gantry Set Up
First of all, Dynamixels installed in DASL Gantry are MX-106 model. You should check control table for MX-106.
Here is the link. http://emanual.robotis.com/docs/en/dxl/mx/mx-106/
You would find that there is no address or parameter difference between MX-28, Fortunately.
We are going to use this power supply for Gantry because we can switch off the power when we need an emergency stop.
Just turn the switch backward for an emergency stop
The photo below is the basic structure of gantry system.
You need to measure some dimensions of this system for distance control.
This photo will help you to understand the system.
Moving X axis
For moving gantry to x axis, we will use Dynanixel #1,2
In gantry system, rotation angle of Dynamixel during sleep time will be changed to displacement of belt.
So we need to do measurement and calculation to move gantry.
If we know exact distance between each teeth in the belt and gear,
we can calculate displacement of belt accurately.
- Measurement
G1 = 28 teeth , G2 = 14 teeth, G3 = 24 teeth
Distance between teeth = 5mm = 0.5 cm
1 dynamixel speed unit = 0.11445 rpm
- Calculation
Now we know sleep time we need.
=======================================================================================================
Exercise. Using only Gantry Dynamixel #1 and #2, make Dynamixels actuate until they reach to desired distance.
Set the moving speed value as 200 (Gantry will not work if the moving speed is too high).
Here is an answer
=======================================================================================================
Moving Backward
Problem of previous code is that gantry can not move backward.
How can we modify code to move backward?
Discover the method in this code.
Moving backward
Moving All axis
Now you know everything to move all axis.
=======================================================================================================
Exercise. Move gantry along all axis.(X,Y,Z axis)
Here is an answer
=======================================================================================================
How to go back home
After moving it, gantry need to go back to home position for next use.
If we know current position of gantry, going back to home position is easy.
=======================================================================================================
Exercise. Lets make it go back to home location after we move gantry.
Here is an answer
=======================================================================================================
Accuracy
Now you are ready to check the accuracy of your code.
There is a plate where the 10cm by 10cm grid is drawn.
Try setting the origin at any intersecting point and run your code at 10cm resolution.
If it is accurate enough, try narrowing down the resolution at 5cm.
If not, find out the problems by yourself.
The reason would be poor measurement or hardware out of work.
Checking the tension of the threads would help you finding problems.
Final Words
For questions, clarifications, etc, Email: m.geon.kim@gmail.com