Demo 1
I decided to create a wall following robot, with 2 wheels and 2 distance measuring sensors I bought from ROBOTIS.
Here is the electrical design of the robot’s system:
And here is the mechanical design of the robot:
The system design of the robot is shown below:
And here is the software design or the flowchart of the codes inside OpenCM (microcontroller):
And here is the pseudo code for the robot:
Initialize Dynamixel XL-320 on Serial Port (USART) OpenCM 9.04 |
Initialize the first Dynamixel XL-320 |
Initialize the second Dynamixel XL-320 |
Include OLLO library for DMS-80 |
Initialize dynamixel bus with baudrate: 1 Mbps |
wheelMode on Dynamixel 1 |
wheelMode on Dynamixel 2 |
DMS Module must be connected at port 1. |
DMS Module must be connected at port 3. |
Initialize robot’s movement (turning right) |
If distance of front DMS is less than 10 cm |
If distance of right DMS is less than 14 cm |
Robot turns left |
Else |
Robot turns right |
Else |
If distance of right DMS Is less than 14 cm |
Robots moves forward |
Else |
Robot turns right |
And here is the source code using the ROBOTIS compiler application for OpenCM 9.04:
https://github.com/alfredogotama/Demo-1—Maze-Solving-Robot/blob/master/demo_1_wheelspin_DMS
Calibration for DMS-80:
0 cm – 3 cm = 1900 – 2900 units of distance
3 cm – 10 cm = 2900 units of distance
10 cm – 70 cm = 2900 – 300 units of distance
This is the final design of the robot:
This is the video of the robot: