User Tools

Site Tools


lego_2link_arm

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
lego_2link_arm [2019/03/07 22:10] – [Theoretical Background] ntorresreyeslego_2link_arm [2019/03/08 07:14] (current) – [Theoretical Background] ntorresreyes
Line 8: Line 8:
 \\ \\
  
-{{:torres:tutorials:tutorial1.png?nolink&400|}}+{{:torres:tutorials:tutorial1.png?nolink&600|}}
  
 =====Motivation and Audience===== =====Motivation and Audience=====
Line 35: Line 35:
   *[[lego_2link_arm#runningtestingandanalysis|Running, Testing and Analysis]]   *[[lego_2link_arm#runningtestingandanalysis|Running, Testing and Analysis]]
   *[[lego_2link_arm#conclusions|Conclusions]]   *[[lego_2link_arm#conclusions|Conclusions]]
-  *[[lego_2link_arm#finalwords|Final Words]] 
- 
- 
  
 ====Parts List==== ====Parts List====
Line 46: Line 43:
  
 ====Theoretical Background==== ====Theoretical Background====
 +{{:torres:tutorials:2_link_tutorial_14.png?nolink&500|}}
 +\\
 The theoretical background needed for this tutorial can be fully covered [[2_link_kinematics|here]]. In short, it covers the kinematics of a 2-link arm using using three different methods: Matrix algebra, Geometry, and computational tools. Additionally, it provides an introduction into Matlab simulation of the 2-link arm. The link length values in the tutorial can be easily replaced by the actual link values which are found in the code below. The theoretical background needed for this tutorial can be fully covered [[2_link_kinematics|here]]. In short, it covers the kinematics of a 2-link arm using using three different methods: Matrix algebra, Geometry, and computational tools. Additionally, it provides an introduction into Matlab simulation of the 2-link arm. The link length values in the tutorial can be easily replaced by the actual link values which are found in the code below.
  
Line 66: Line 65:
 {{:torres:solidworksbuildplans.mp4|Assembly Video}} {{:torres:solidworksbuildplans.mp4|Assembly Video}}
 ====NXT Brick Code==== ====NXT Brick Code====
-'Bricx Command Center' is the software used to program the NXT Brick. The software is C-based and has many different functions for interfacing with the Brick. The code used to program the robot arm can be downloaded below along with an explanation:+'Bricx Command Center' is the software used to program the NXT Brick. The software is C-based and has many different functions for interfacing with the Brick. The code used to program the robot arm can be downloaded below. The code uses the geometric solution of the inverse kinematic equations to solve for the joint angles. A gear ratio for each link is determined first to get proper movement. The link lengths are defined using variables L1 and L2 respectively. Next, the desired end point of the arm is chosen with variables 'px' and 'py' with respect to the base reference system.
 \\ \\
 ---- ----
Line 198: Line 197:
  
 ====Running, Testing and Analysis==== ====Running, Testing and Analysis====
 +===Running the Code===
 +[[https://youtu.be/BTd6KNX8ujg|Video of Operation]] 
 +\\
 +If the code is compiled and uploaded to the brick successfully, it will be necessary to use a way of measuring the end point coordinates with respect to the base. This is done by attaching a studded base that is parallel to the plane of movement of the arm. Each stud represents 8mm distance and can therefore be used to judge the accuracy of the arm. Each motor has different PID and acceleration parameters that can be tuned heuristically to obtain better arm operation.
 +\\
 +===Testing and Analysis===
 +The best way to test the arm is to use the studded wall as a reference. When the code is ran, the initial position of the arm is regarded as the zero angle position. With this in mind, it is important to have the arm as level as possible. Testing several points allows you to better see the response of the arm. Friction and slop in the arm will be the biggest factors in accuracy. This is where tuning the parameters will help.
 +\\
 +<code>
 +
 +     PosRegEnable(JNT1,PID_1,PID_2,PID_3); // Defines PID control values
 +     PosRegSetMax(JNT1, 1.0*FULL_SPEED, 10); // Set Port A speed limit and acceleration
 +
 +     PosRegEnable(JNT2,PID_1,PID_2,PID_3); // Define PID control values
 +     PosRegSetMax(JNT2, 1.0*FULL_SPEED, 5); // Set Port B speed limit acceleration
 +</code>
 +\\
 +PosRegEnable() first defines the port (doesn't have to change). The last 3 parameters are P,I,D parameters respectively.
 +\\
 +PosRegSetMax() also defines port, maximum full speed, and max acceleration.
 +\\
 +Changing the values will allow you to fine tune the arm.
 +\\
  
 ====Conclusions==== ====Conclusions====
 +In conclusion, it was found that it is possible to create a successful 2-link robot arm using LEGO and to control the arm using analytical solutions to the inverse kinematics. It is also possible to tune the arm to achieve better accuracy. Possible future iterations may include improving the mechanical stiffness of the arm to reduce the error in the final position. It is also possible to add a third link as an end-effector for practical uses of the arm. These can include various sensors or grippers. Solidworks can also be used to run simulations or test different iterations of the arm. As long as the parts are properly defined, it is possible to obtain moments of inertia and centers of gravity for each link. This can be used for further dynamic calculations.
  
-====Final Words==== 
lego_2link_arm.1552025414.txt.gz · Last modified: 2019/03/07 22:10 by ntorresreyes