User Tools

Site Tools


dbkim_ballbeam

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
dbkim_ballbeam [2019/06/02 04:41] dongbinkimdbkim_ballbeam [2019/06/02 14:05] (current) dongbinkim
Line 40: Line 40:
 To complete this tutorial, you'll need the following items <!-- in table below, replace ??? with relevant information and add additional lines if necessary --> To complete this tutorial, you'll need the following items <!-- in table below, replace ??? with relevant information and add additional lines if necessary -->
 <!-- Alternatively create: (1) a Google XLS document that's publicly viewable and provide link; and (2) a PDF version of the Google XLS, store the PDF file in your site, and provide link to it --> <!-- Alternatively create: (1) a Google XLS document that's publicly viewable and provide link; and (2) a PDF version of the Google XLS, store the PDF file in your site, and provide link to it -->
 +\\
 \\ \\
  
Line 50: Line 51:
 | Power Supply| Amazon          | https://www.amazon.com/COOLM-Adapter-100-240V-Doorbell-5-5X2-5MM/dp/B07D5B5Q28/ref=sr_1_3?crid=2G1KDMA9S5IYC&keywords=12v+2a+5.5+2.5&qid=1558564688&s=gateway&sprefix=12v+2a+5.5+%2Caps%2C185&sr=8-3            | 6.99 |  1   | | Power Supply| Amazon          | https://www.amazon.com/COOLM-Adapter-100-240V-Doorbell-5-5X2-5MM/dp/B07D5B5Q28/ref=sr_1_3?crid=2G1KDMA9S5IYC&keywords=12v+2a+5.5+2.5&qid=1558564688&s=gateway&sprefix=12v+2a+5.5+%2Caps%2C185&sr=8-3            | 6.99 |  1   |
  
 +\\
 \\ \\
   * For dynamixel motor control, the following article should be downloaded [[http://emanual.robotis.com/docs/en/software/dynamixel/dynamixel_sdk/overview/| Dynamixel SDK]]   * For dynamixel motor control, the following article should be downloaded [[http://emanual.robotis.com/docs/en/software/dynamixel/dynamixel_sdk/overview/| Dynamixel SDK]]
Line 55: Line 57:
   * 3D printing is required for the connector that links the dynamixel and the beam. (Ask dongbin.kim@unlv.edu for the CAD file. Wiki wasn't able to upload here)   * 3D printing is required for the connector that links the dynamixel and the beam. (Ask dongbin.kim@unlv.edu for the CAD file. Wiki wasn't able to upload here)
  
-==== Hardware Construction ====+===== Hardware Construction =====
  
 {{ bandb:bb_2.jpg?500 |}} {{ bandb:bb_2.jpg?500 |}}
Line 65: Line 67:
 \\ \\
 **Step 1** **Step 1**
-\\ +  * 8020 Aluminum Build : Connect 8020 Aluminum beams like the hardware setup above
-\\ +
-8020 Aluminum Build : Connect 8020 Aluminum beams like the hardware setup above +
-\\ +
-\\+
 **Step 2** **Step 2**
-\\ +  * The Foam Board : Cut the board 48cm by 10cm. In 10cm area, slice a little bit 3 cm from both edges, so you can fold to the create a semi-triangle shape. It will be the beam that will support the hallow ball
-\\ +
-The Foam Board : Cut the board 48cm by 10cm. In 10cm area, slice a little bit 3 cm from both edges, so you can fold to the create a semi-triangle shape. It will be the beam that will support the hallow ball +
-\\ +
-\\+
 **Step 3** **Step 3**
-\\ +  * Dynamixel MX-28 : Mount the 3D-Printed connector on Dynamixel MX-28, then connect with the beam.
-\\ +
-Dynamixel MX-28 : Mount the 3D-Printed connector on Dynamixel MX-28, then connect with the beam. +
-\\ +
-\\+
 **Step 4** **Step 4**
 +  * Sony Camera : Mount the camera on top border of the aluminum frame. 
 +  * Dynamixel + Beam : Place is 36cm under the sony camera. It's because all part of the beam will be inside the camera display. Therefore the position of the ball will be achieved correctly.
 +**Step 5**
 +  * Power Supply : Place it near the dynamixel to provide the continuous power
 +  * USB Cable : Organize nicely so the cable will not touch the beam or interfere the camera.
 +
 +
 +===== Software Construction=====
 +
 +==== Prerequisites ====
 +To run this tutorial. The following should be completed
 +  * ROS Tutorial - begineer/intermediate [[http://wiki.ros.org/ROS/Installation| ROS Website]]
 +  * Dynamixel SDK tutorial -> read/write on dynamixel motor to change the position or velocity of joint [[http://emanual.robotis.com/docs/en/software/dynamixel/dynamixel_sdk/overview/| Dynamixel SDK]]
 +  * OPENCV Tutorial - Object recognition, Object position recognition [[http://www.daslhub.org/unlv/wiki/doku.php?id=opencv_tutorials|DASL OpenCV Tutorials]]
 \\ \\
 +==== MATLAB Simulation ====
 +{{ bandb:bb_3.jpg?500 |}} 
 \\ \\
-Sony Camera : Mount the camera on top border of the aluminum frame+The above describe the MATLAB code for the simulation. The code on the right identifies the hardware specification of the ball-and-beam system. The equation of motion and transfer functions are computed in the following attached PDF. (Code line could not be added on this post due to the crack that occurs when the author wrote this tutorial) 
 +{{:bandb:equationofmotion_mcode.pdf|MATLAB_CODE}} 
 \\ \\
-Dynamixel + Beam Place is 36cm under the sony cameraIt's because all part of the beam will be inside the camera display. Therefore the position of the ball will be achieved correctly.+{{ bandb:bb_4.jpg?500 |}}{{ bandb:bb_5.jpg?500 |}}
 \\ \\
 +The top above figure describes the simulink of the ball and beam system. PID compensator is used to deal with the feedback. The bottom above figure describes the simulated results. The ball should settle in desired position around 2~3 seconds. 
 +
 +==== Robot Operating System Set-up ====
 \\ \\
-**Step 5**+{{ bandb:bb_6.jpg?500 |}}
 \\ \\
 +The above figure describes ROS scheme of the final ball and beam control system. The control frequency is set to 100Hz. There are 3 nodes, Vision, PID Compensator, and the dynamixel controller. The nodes are sharing topics including position of the ball, motor position angle, and motor position angle feedback to control the ball to the desired point.
 \\ \\
-Power Supply : Place it near the dynamixel to provide the continuous power+==Finalized codes are written in Python, and it is not opened as this tutorial is built for the DASL's control class. For people outside of DASL, if you need the code. please email to the author. The author will explain more details. But prerequisites should have been done beforehand ==  
 +Email: <dongbin.kim@unlv.edu>
 \\ \\
-USB Cable : Organize nicely so the cable will not touch the beam or interfere the camera. 
  
 +===== Experiment Results =====
 +==== Trouble Shooting ====
  
-==== Software Construction====+The experiment is to target the ball to 30cm position from the motor.
  
-A link to the source code can be found <provide URL to your codeprobably saved in this DASL Wiki>.+{{youtube>3b5U8-9r9GE?large}} 
 + 
 +The Video above shows that the system is not balancing the ball at all. It also shows that there is latency from the response. 
 + 
 +{{ bandb:bb_7.jpg?500 |}} 
 + 
 +The figure above shows that there's 0.2 second latency. The motor position is not responding well the the feedback motor angle.  
 + 
 +{{ bandb:bb_8.jpg?500 |}} 
 + 
 +The author tried to take measurement of the motor response time to approximate motor transfer function. The above picture shows how slow the dynamixel is. It takes 0.06 seconds to move every 5 degrees angle. The author then assumed the motor transfer function has like a first order system with 0.06 seconds rise time. The next 3 pictures describes the final simulink blocks as well as the simulation change with and without the latency. 
 + 
 +{{ bandb:bb_9.jpg?500 |}} 
 +{{ bandb:bb_10.jpg?500 |}} 
 +{{ bandb:bb_11.jpg?500 |}} 
 + 
 +Same condition with latencyThe position of the ball shows the divergenceEven if the ball is positioned at 30cm, desired position. it will slowly rolling to get out of the beam. See the video below 
 + 
 +{{youtube>lLTkfMIeT50?Large}}
 \\ \\
-The goal of the code is <brief explanation> It works in the following way 
 \\ \\
----- +==== Solution ====
-<!- Insert a snippet of your code here.  Try to keep to less than 0.5 page long --> +
-----+
 \\ \\
-The snippet above serves to <fill in the blank>. It does this by <fill in the blank>. 
 \\ \\
----- +{{ bandb:bb_12.jpg?500 |}} 
-<!- Insert another snippet of your code here Try to keep to less than 0.5 page long --> +\\ 
----- + 
-Next, the code does <fill in the blank> It does this by <fill in the blank>  +To solve the troubleshooting described in the previous section, new gain system is added on the simulinkThe gain number will drastically increase the motor feedback angle value, so the motor position can track the feedback much quickerThe simulation result and actual result are shown in the below. Also you can check it by the video 
-<!-- Keep entering snippets of code and descriptions until you've given enough for a reader to understand how it works --> + 
-// +{{ bandb:bb_13.jpg?500 |}} 
-// +{{ bandb:bb_14.jpg?500 |}} 
-==== Final Words ====+ 
 +{{youtube>38f2m0wrlfA?large}}
  
-This tutorial's objective was to <fill in the blank>Complete <choose: construction details, source code and program descriptions> for <fill in the blank>. Once the concepts were conveyed the reader could <fill in the blank>.+The video shows the result with gain of 25You can see the ball is controlled to reach at 30cm from the motor.
 \\ \\
 \\ \\
-Speculating future work derived from this tutorial, includes <fill in the blank>. In the big picture, the problem of <fill in the blank> can be solved with this tutorial.+===== Conclusion =====
 \\ \\
 \\ \\
-For questions, clarifications, etc, Email: <paul.oh@unlv.edu>+This tutorial describes single degree of freedom ball balancing system. The main goal of this tutorial is to teach senior undergrad or above (graduate student) classical control theory as well as conversion from simulation into the real life hardware application. The Robot Operating Systems(ROS) is used as software to run the hardware system. PID Compensator is used to deal with the ball position error, and give the feedback angle to the motor. As the motor has the latency for feedback response, additional gain compensation is given to solve the problem. The future work will describe full-state feedback control with different motor selection due to the dynamixel's latency is unforgiving. For questions, clarifications, etc, Email: <dongbin.kim@unlv.edu>
  
  
dbkim_ballbeam.1559475690.txt.gz · Last modified: 2019/06/02 04:41 by dongbinkim