TRƯỜNG ĐẠI HỌC BÁCH KHOA HÀ NỘI VIỆN ĐIỆN BÁO CÁO BÀI TẬP LỚNMÔN KỸTHUẬT ROBOT NHÓM 10 TÌM HIỂU ROBOT OMRON VIPER 650 Giảng viên hướng dẫn PGS TS Nguyễn Phạm Thục Anh Sinh viên thực hiện 1 Vũ Văn Tú 20181810 2 Vũ Mạnh Thọ 20181770 3 Bùi Quang Minh 20181644 4 Phạm Duy Thi 20181765 5 Vũ Huy Hùng 20181512 6 Phạm Văn Đồng 20181397 7 Đặng Đình Dũng 20181418 8 Trương Thanh Hằng 20181459 9 Vũ Văn Long 20181633 10 Trần Văn Dương 20181442 11 Đoàn Đức Anh 20181315 Hà Nội – 012022 Mục Lục CHƯƠNG I GIỚI TH.
GIỚI THIỆU ROBOT OMRON VIPER 650
Giới thiệu về hãng Omron
Omron là một công ty của Nhật Bản đứng hàng đầu thế giới về công nghệ tự động hóa, được thành lập vào năm 1933
Các thiết bị tự động của Omron chất lượng cao được sản xuất bằng công nghệ hiện đại rất đa dạng với hơn 100.000 mặt hàng
Nhiều sản phẩm chiếm thị phần đứng đầu trên thế giới như Biến tần, Rơ le, Điểu khiển nhiệt, Công tắc hành trình, Cảm biến quang…
Vào ngày 01/04/2016, Omron Adept đã cho ra mắt robot công nghiệp mới nhất, đáp ứng đầy đủ các tiêu chuẩn vệ sinh của Bộ Nông nghiệp Hoa Kỳ nhằm phòng chống ô nhiễm sản phẩm.
Giới thiệu về Robot Omron Viper 650
Robot Viper 650 là giải pháp lý tưởng cho dây chuyền lắp ráp và đóng gói sản phẩm, nhờ vào thiết kế nhỏ gọn giúp hoạt động hiệu quả trong không gian hạn chế Robot này đặc biệt phù hợp cho việc lắp ráp các linh kiện nhỏ trong ngành sản xuất ô-tô và xe máy, đồng thời còn có khả năng phân loại và kiểm định chất lượng sản phẩm.
Robot khớp nối để gia công, lắp ráp và xử lý vật liệu
Khả trình thông qua phần mềm ACE và ngôn ngữ eV+ hoặc thông qua IEC 61131-3 quen thuộc khi sử dụng kết nối ePLC
Hiển thị chẩn đoán cho phép xử lý sự cố nhanh hơn
Encoder tuyệt đối, độ phân giải cao để cung cấp độ chính xác, theo dõi tốc độ chậm và dễ dàng hiệu chỉnh
Hiệu suất cao, hộp số Harmonic quán tính thấp và cánh tay nhẹ cho phép thực hiện chuyển động với gia tốc tối đa
Tải trọng tối đa: 5kg
CHƯƠNG I GIỚI THIỆU ROBOT OMRON VIPER 650
2.2 Kích thước và vùng làm việc
2.4 Hình ảnh Robot Omron Viper 650
1 Xác định các khớp quay và trục tọa độ
Hình 1 Xác định các gốc tọa độ tại các khớp Bảng1 Bảng DH
ĐỘNG HỌC THUẬN ROBOT OMRON VIPER 650
Xác định các khớp quay và trục tọa độ
Hình 1 Xác định các gốc tọa độ tại các khớp Bảng1 Bảng DH
CHƯƠNG II ĐỘNG HỌC THUẬN ROBOT OMRON VIPER
Xác định các ma trận A
>> A1=[cos(i1) -0*sin(i1) -1*sin(i1) a1*cos(i1); sin(i1) 0*cos(i1) 1*cos(i1) a1*sin(i1); 0 -1 0 d1; 0 0 0 1]
>> A2=[cos(i2) -1*sin(i2) 0*sin(i2) a2*cos(i2); sin(i2) 1*cos(i2) -0*cos(i2) a2*sin(i2); 0 0 1 d2; 0 0 0 1]
>> A3=[cos(i3) -0*sin(i3) 1*sin(i3) a3*cos(i3); sin(i3) 0*cos(i3) -1*cos(i3) a3*sin(i3); 0 1 0 d3; 0 0 0 1]
>> A4=[cos(i4) -0*sin(i4) -1*sin(i4) a4*cos(i4); sin(i4) 0*cos(i4) 1*cos(i4) a4*sin(i4); 0 -1 0 d4; 0 0 0 1]
>> A5=[cos(i5) -0*sin(i5) 1*sin(i5) a5*cos(i5); sin(i5) 0*cos(i5) -1*cos(i5) a5*sin(i5); 0 1 0 d5; 0 0 0 1]
>> A6=[cos(i6) -1*sin(i6) 0*sin(i6) a6*cos(i6); sin(i6) 1*cos(i6) -0*cos(i6) a6*sin(i6); 0 0 1 d6; 0 0 0 1]
The equation incorporates trigonometric functions involving angles i1, i2, i3, i4, i5, and i6, representing a complex relationship between these variables It combines sine and cosine components to express the interactions among the angles, highlighting their influence on the resulting values The expression also includes terms with coefficients d6, a1, a2, and a3, indicating the contributions of various parameters to the overall equation This formulation emphasizes the intricate interplay of rotational dynamics and geometric transformations in a multi-dimensional space.
The expression involves a complex combination of trigonometric functions, including sine and cosine, represented by various angles (i1, i2, i3, i4, i5, i6) It calculates the components influenced by these angles, factoring in contributions from different terms such as d6, a1, a2, and a3 The overall formula highlights how these trigonometric relationships interact to produce a result that is dependent on the specified angles and their respective sine and cosine values, emphasizing the intricate nature of the mathematical model being analyzed.
The expression involves trigonometric functions where cos(i6) and sin(i6) play crucial roles in the calculations It combines various sine and cosine terms, particularly focusing on the interactions between angles i2, i3, i4, i5, and i6 The first part of the equation emphasizes the relationship between the sine and cosine of these angles, while the second part highlights the influence of sin(i4) and cos(i4) in the overall structure This complex interplay of trigonometric functions showcases the intricacies of their relationships in a mathematical context.
The expression involves a complex combination of trigonometric functions, including cosines and sines of various angles, which are multiplied and subtracted in a series of operations It illustrates a relationship between the angles i2, i3, i4, and i5, and includes terms that account for distances d1, d4, and d6, as well as coefficients a2 and a3 The formula highlights the interaction between these angles and distances, emphasizing the significance of their sine and cosine components in determining the overall outcome.
Xây dựng phần mềm tính toán động lực học thuận
Hình 3.1 Giao diện phần mềm tính toán động học thuận
We create a callback function for the Calculate button that reads data from the input table and displays the T06 matrix The function begins by converting the input strings from six Theta fields into numerical values Each angle is then converted from degrees to radians by multiplying by π/180.
The calculations for nx, ny, nz, ox, oy, and oz are derived from trigonometric functions involving angles i1, i2, i3, i4, i5, and i6 The values are computed using a combination of sine and cosine functions, which are then converted to strings for display purposes Each variable represents a distinct mathematical expression that captures the relationships between the angles, and the results are set to their respective handles for visualization This process is essential for applications that require precise trigonometric computations and real-time data representation.
- cos(i2)*cos(i3)) - cos(i4)*cos(i5)*(cos(i2)*sin(i3) + cos(i3)*sin(i2)))); set(handles.oz,'string',oz); ax= num2str(cos(i5)*(cos(i1)*cos(i2)*sin(i3) + cos(i1)*cos(i3)*sin(i2)) - sin(i5)*(sin(i1)*sin(i4)
The calculations for the 3D coordinates involve trigonometric functions of angles (i1, i2, i3, i4, i5) and parameters (d1, d4, d6, a1, a2, a3) The x-coordinate (px) is derived from a combination of cosine and sine functions, incorporating the influence of the angles and parameters Similarly, the y-coordinate (py) is calculated using trigonometric relationships, reflecting the interaction between the angles and parameters Lastly, the z-coordinate (pz) accounts for the geometric relationships between the angles and the parameters, ensuring accurate representation in the 3D space Each coordinate is then set to the respective GUI elements for display.
- Từ phần động học thuận, ta tính được ma trận T bằng cách sử dụng đoạn code matlab như sau:
%% Ma tran dong hoc thuan
A1 = [cos(t1) 0 sin(t1) a1*cos(t1); sin(t1) 0 -cos(t1) a1*sin(t1); 0 1 0 d1 ; 0 0 0 1]; A2 = [cos(t2) -sin(t2) 0 a2*cos(t2); sin(t2) cos(t2) 0 a2*sin(t2); 0 0 1 0; 0 0 0 1];
A3 = [cos(t3) 0 -sin(t3) a3*cos(t3); sin(t3) 0 cos(t3) a3*sin(t3); 0 -1 0 0; 0 0 0 1]; A4 = [cos(t4) 0 sin(t4) 0; sin(t4) 0 -cos(t4) 0; 0 1 0 d4; 0 0 0 1];
- Từ đó ta tìm được các ma trận T 5 6 , T 4 6 ,… bằng cách:
- Để thuận tiện cho việc tính toán, ta sử dụng đoạn code trên matlab m.file như sau:
%% Tinh toan ma tran Jacoby
- Theo lý thuyết, ta có thể tìm ma trận J H theo công thức sau:
XÂY DỰNG MA TRẬN JACOBY
Xác định ma trận T i n
- Từ phần động học thuận, ta tính được ma trận T bằng cách sử dụng đoạn code matlab như sau:
%% Ma tran dong hoc thuan
A1 = [cos(t1) 0 sin(t1) a1*cos(t1); sin(t1) 0 -cos(t1) a1*sin(t1); 0 1 0 d1 ; 0 0 0 1]; A2 = [cos(t2) -sin(t2) 0 a2*cos(t2); sin(t2) cos(t2) 0 a2*sin(t2); 0 0 1 0; 0 0 0 1];
A3 = [cos(t3) 0 -sin(t3) a3*cos(t3); sin(t3) 0 cos(t3) a3*sin(t3); 0 -1 0 0; 0 0 0 1]; A4 = [cos(t4) 0 sin(t4) 0; sin(t4) 0 -cos(t4) 0; 0 1 0 d4; 0 0 0 1];
- Từ đó ta tìm được các ma trận T 5 6 , T 4 6 ,… bằng cách:
- Để thuận tiện cho việc tính toán, ta sử dụng đoạn code trên matlab m.file như sau:
%% Tinh toan ma tran Jacoby
Xác định ma trận J H
- Theo lý thuyết, ta có thể tìm ma trận J H theo công thức sau:
CHƯƠNG III XÂY DỰNG MA TRẬN JACOBY
Các phần tử ở cột thứ i+1 sẽ được tính theo ma trận Ti như tính toán ở trên
Khi khớp thứ i+1 là khớp trượt thì:
Khi khớp thứ i+1 là khớp quay thì:
- Theo lý thuyết, ta có thể xây dựng đoạn code trên matlab m.file để tính toán như sau:
Xác định ma trận J
- Sau khi tìm được ma trận JH, ta tìm được ma trận J theo công thức:
- Đoạn code trên matlab m.file:
J = simplify([R,zeros(3,3);zeros(3,3),R]*J_h);% ma tran Jacoby
Xây dựng giao diện
- Sử dụng công cụ Guide trên matlab, ta xây dựng được giao diện như sau:
- Code giao diện trên matlab (code phần tính toán để hiển thị kết quả sau khi tính toán trên giao diện): function tinhtoan_Callback(hObject, eventdata, handles)
% hObject handle to tinhtoan (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
The code snippet retrieves values from multiple sliders in a user interface, converting these values from degrees to radians by multiplying by π/180 Specifically, it captures values from sliders one through six for angles (t1 to t6) and gathers additional parameters from sliders seven to twelve, including distances (d1, d4, d5) and angles (a1, a2, a3) This structured approach allows for efficient handling of user input data within the application.
The calculation for \( a_{11} \) involves multiple trigonometric functions and parameters, expressed as \( a_{11} = d_5 \cos(t_1) \cos(t_4) - a_1 \sin(t_1) - a_2 \cos(t_2) \sin(t_1) - a_3 \cos(t_2) \cos(t_3) \sin(t_1) + d_4 \cos(t_2) \sin(t_1) \sin(t_3) + d_4 \cos(t_3) \sin(t_1) \sin(t_2) + a_3 \sin(t_1) \sin(t_2) \sin(t_3) - d_5 \cos(t_2) \cos(t_3) \sin(t_1) \sin(t_4) + d_5 \sin(t_1) \sin(t_2) \sin(t_3) \sin(t_4) \) Additionally, the expression for \( a_{12} \) is given by \( a_{12} = -\cos(t_1) \left( \frac{d_5 \cos(t_2 + t_3 - t_4)}{2} + d_4 \cos(t_2 + t_3) + a_3 \sin(t_2 + t_3) + a_2 \sin(t_2) \right) \).
The equations presented involve various trigonometric functions and parameters, where a13 calculates the influence of angles t1, t2, t3, and t4 on a complex system The variable a14 combines cosine and sine functions to represent relationships between these angles and the distance d5 Additionally, a21 and a22 illustrate how the sine and cosine of t1 interact with other parameters, while a23 and a24 further refine these interactions The equations collectively describe the dynamics of a system influenced by rotational movements and spatial dimensions, with specific terms highlighting the contributions of each angle and distance to the overall behavior of the system.
The equations presented involve complex trigonometric calculations that incorporate multiple variables, including angles t2, t3, t4, t5, and t6 The calculations for a33 describe a function that combines cosine and sine components to derive a specific value based on the angles' relationships Similarly, a34 is defined as d5 multiplied by the sine of the sum of t2 and t3, adjusted by the cosine of t4 The other variables, such as a35 and a36, are set to zero, indicating no contribution from those terms Additionally, a42 and a43 represent the sine of angle t1, while a44 incorporates the cosine of t1 and the sine of the sum of t2 and t3 Lastly, a45 and a46 involve more intricate relationships among the sine and cosine functions, reflecting the interactions between the angles and their respective contributions to the overall calculations.
The equation involves trigonometric functions and parameters t1 through t6, with a focus on the interactions between cosine and sine terms Key components include a51 equaling zero, a52 and a53 both being negative cos(t1), and a54 representing the product of -sin(t2 + t3) and sin(t1) Additionally, a55 combines terms involving cos(t2), cos(t3), and sine functions, while a56 incorporates sin(t5) and cos(t5) with a mix of sine and cosine terms The expression for a61 highlights the squared sum of trigonometric functions, emphasizing the relationship between angles t2, t3, t4, t5, and t6.
The expression involves the calculation of a squared term, represented as \((\cos(t6) \cdot (\cos(t2 + t3) \cdot \sin(t5) + \sin(t2 + t3) \cdot \cos(t4) \cdot \cos(t5)) - \sin(t2 + t3) \cdot \sin(t4) \cdot \sin(t6))^2\) The variables \(a62\) and \(a63\) are set to zero, while \(a64\) is defined as \(\cos(t2 + t3)\), \(a65\) as \(\sin(t2 + t3) \cdot \sin(t4)\), and \(a66\) as \(\cos(t2 + t3) \cdot \cos(t5) - \sin(t2 + t3) \cdot \cos(t4) \cdot \sin(t5)\) Additionally, several variables \(a11\) through \(a66\) are converted to string format using the function \texttt{num2str}.
The code snippet demonstrates how to set string values for multiple user interface elements in a MATLAB GUI Each element, identified by its handle, is assigned a corresponding variable value, ranging from a11 to a66 This systematic approach ensures that the GUI displays the correct data, enhancing user interaction and experience By updating these string properties, developers can effectively manage the information presented in the application.
Bài toán động học ngược cho tay máy 6 khớp là một thách thức lớn, đặc biệt khi ba khớp cuối cùng đồng quy tại một điểm Tuy nhiên, chúng ta có thể chia nhỏ bài toán này thành hai phần đơn giản hơn: động học ngược vị trí và động học ngược hướng.
- Tìm vị trí giao điểm các trục cổ tay (tâm cổ tay)
- Tìm hướng của cổ tay
Chúng ta sẽ mô tả hướng và vị trí của cổ tay, sử dụng hệ tọa độ cố định bên ngoài (hệ tọa độ 𝑂 0) Nhiệm vụ của chúng ta là giải bài toán liên quan đến các biến ẩn 𝜃 1 , … , 𝜃 6.
Cơ cấu 6 khớp quay có 3 khớp cuối giao nhau có phương pháp giải như sau:
Vị trí của tâm cổ tay RC được xác định dựa trên vị trí của công cụ so với hệ tọa độ 𝑂 0 và phương của Tool pointing (Z 6) Vì vậy, vị trí của tâm cổ tay phụ thuộc vào ba biến khớp đầu tiên.
Các biến khớp 𝜃 1 , 𝜃 2 , 𝜃 3 được xác định từ ma trận định hướng cổ tay 𝑇 3 0 và ma trận định hướng công cụ 𝑇 6 0 Vị trí C so với 𝑂 0 được tính bằng cách nhân vị trí C so với hệ tọa độ 𝑂 3 với ma trận biến đổi đồng nhất của 𝑂 3 trong tọa độ 𝑂 0 (𝑃 𝑐 0 = 𝑇 3 0 𝑃 𝑐 3) Tương tự, vị trí C so với 𝑂 0 cũng được xác định từ hệ tọa độ 𝑂 6 (𝑃 𝑐 0 = 𝑇 6 0 𝑃 𝑐 6) Các biến khớp 𝜃 4 , 𝜃 5 , 𝜃 6 được xác định từ ma trận 𝑇 6 3 (𝜃 1 , 𝜃 2 , 𝜃 3).
𝑇 6 3 = 𝑇 3 0−1 (𝜃 1 , 𝜃 2 , 𝜃 3 ) ∗ 𝑇 6 0 Như vậy bài toán của chúng ta sẽ được giải quyết thông qua hai bước sau
Thiết lập ma trận vị trí 𝑃 𝑐 = cột cuối cùng của 𝑇 3 0 ( , 1 2 , 3 ) và 𝑇 6 0 để tìm ra các biến khớp 1 , 2 , 3 Tính 𝑇 6 3 = 𝑇 3 0 −1 𝑇 6 0 sau khi đã thay giá trị của các biến khớp vào
So sánh 𝑇 6 3 và 𝑇 6 3 (𝜃 4 , 𝜃 5 , 𝜃 6 ) để rút ra 4 , 5 , 6 Đưa từ ý tưởng thực hiện ta Giả sử C là điểm cổ tay máy
ĐỘNG HỌC NGƯỢC ROBOT VIPER 650
Bài toán tìm vị trí giao điểm các trục cổ tay (tâm cổ tay)
Tọa độ C trong hệ tọa độ O 6 là:
Tọa độ C trong hệ tọa độ O 0 𝑣ớ𝑖 (𝑇 𝑟𝑒𝑓 = 𝑇 6 0 đặ𝑡) là:
Ma trận biến đổi đồng nhất của O 3 trong O 0 là:
Mặt khác ta có tọa độ của C trong tọa độ O 0 là:
] (4.2) Đồng nhất 2 vế của (4.1) và (4.2) ta được hệ phương trình sau:
Ta lấy (1)𝑠 1 − (2)𝑐 1 ta thu được:
Ta lấy (1)𝑐 1 + (2)𝑠 1 và kết hợp phương trình 3 ta có hệ:
Bình phương hai vế của phương trình trên và cộng lại ta được
Ta khai triển M và N ta được hệ
Bài toán tìm hướng của cổ tay
Sau khi xác định vị trí giao điểm của các trục cổ tay, chúng ta tiếp tục với bài toán tìm hướng bằng cách sử dụng ma trận 𝑇 6 3 để thực hiện các phép tính cần thiết.
Chỉ cần quan tâm tới phần định hướng tức là ma trận [3,3] Đồng nhất 2 vế của 2 ma trận
Giải xong 2 bài toán trong động học ngược ta tìm ra các kết quả của 𝜃 1 , 𝜃 2 𝜃 3 𝜃 4 𝜃 5 𝜃 6 như sau:
Từ những kết quả trên ta thay thông số thực tế của robot VIPER 650:
Với ma trận định hướng công cụ đặt là Tref:
] ta được bảng kết quả như sau:
Góc TH1 TH2 TH3 TH4 TH5 TH6 TH7 TH8
THIẾT KẾ QUỸ ĐẠO CHUYỂN ĐỘNG CHO ROBOT VIPER 650
1 Giới thiệu và cơ sở thiết kế quỹ đạo
Thiết kế quỹ đạo chuyển động của robot là yếu tố quan trọng trong việc điều khiển robot di chuyển giữa các vị trí trong không gian làm việc Đường đi và quỹ đạo được xác định đóng vai trò chủ chốt trong hệ thống điều khiển vị trí của robot.
Do đó độ chính xác của quỹ đạo sẽ ảnh hưởng đến chất lượng di chuyển của robot
Quỹ đạo là tập hợp theo thời gian các giá trị vị trí, tốc độ, gia tốc của mỗi bậc tự do Hai dạng quỹ đạo cho Robot nDOF:
Quỹ đạo trong không gian khớp
Quỹ đạo trong không gian làm việc
Yêu cầu thiết kế quỹ đạo chuyển động của Robot là:
Khâu chấp hành phải đảm bảo đi qua lần lượt các điểm trong không gian làm việc hoặc di chuyển theo một quỹ đạo xác định
Quỹ đạo của Robot phải là đường liên tục về vị trí trong một khoảng các nhất định
Không có bước nhảy về vận tốc, gia tốc
Quỹ đạo là các đường cong có dạng:
+ Đa thức bậc 2: x t( ) a bt ct 2
+ Đa thức bậc 3: x t( ) a bt ct 2 dt 3
+ Đa thức bậc cao:x t( ) a bt ct 2 kt n
Trong bài tập này, theo yêu cầu của đề bài nhóm em sẽ xây dựng, thiết kế quỹ đạo dạng đa thức bậc 3 cho robot VIPER 650 có nDOF = 6
2 Tính toán thiết kế quỹ đạo chuyển động dạng bậc 3
Xét tổng quát cho một khớp bất kỳ:
Quỹ đạo khớp quay bậc 3 có dạng:
Với: i =1÷6 tương ứng với 6 biến khớp
Quỹ đạo của tốc độ:
Hai ràng buộc về giá trị góc khớp ban đầu và giá trị góc khớp cuối là:
Hai ràng buộc về tốc độ khớp ban đầu và tốc độ khớp cuối là:
Hệ phương trình về ràng buộc:
Giải hệ phương trình ta thu được:
Quỹ đạo bậc 3 cho từng biến khớp 𝑞 𝑖 là:
Giả sử robot VIPER 650 cần dịch chuyển từ vị trí A(điểm đầu) đến vị trí B(điểm cuối) có tọa độ khớp tương ứng như sau: điểm A(15; 0; 30; 0; 0; 0) và điểm
B(75; 30; 0; 60; 90; 180) (góc ở đây là 𝜃 𝑖 – góc quay của khớp, đơn vị ‘độ’
Chúng tôi đã phát triển một chương trình MATLAB để mô phỏng quỹ đạo chuyển động, vận tốc và gia tốc của các khớp robot Do 6 khớp đều sử dụng phương trình quỹ đạo đa thức bậc 3 giống nhau, nhóm chỉ thực hiện mô phỏng cho khớp 1 Bài toán cho khớp 1 yêu cầu chuyển động từ góc 15° đến góc 75° trong 3 giây, với tốc độ tại điểm đầu và điểm cuối bằng 0.
Phương trình của quỹ đạo cho khớp 1 (i=1) là:
Các hệ số phương trình quỹ đạo:
Khi đó ta có phương trình quỹ đạo vị trí, vận tốc, gia tốc theo thời gian:
Khai báo các điều kiện ban đầu của biến khớp:
Trong bài viết này, chúng tôi đề cập đến các điều kiện đầu vào cho một bài toán chuyển động, với các tham số như sau: góc khởi đầu (theta0) là 15 độ, góc kết thúc (thetaf) là 75 độ, tốc độ tại điểm đầu (dtheta0) là 0, tốc độ tại điểm cuối (dthetaf) cũng là 0, và thời gian di chuyển (tf) là 3 giây.
Với các biến khớp khác khi cần mô phỏng ta chỉ cần thay đổi các điều kiện đầu Khai báo các hệ số phương trình:
% Cac_He_So_Phuong_Trinh a0=theta0; a1=dtheta0; a2=(3/(tf^2))*(thetaf-theta0)-(2/tf)*dtheta0-(1/tf)*dthetaf; a3=(-2/(tf^3))*(thetaf-theta0)+(1/(tf^2))*(dthetaf+dtheta0); t=(0:0.1:tf);
Khai báo các phương trình (quỹ đạo, vận tốc, gia tốc):
% Phuong_Trinh_Van_Toc dq+2*a2*t+3*a3*t.^2;
% Phuong_Trinh_Gia_Toc ddq=2*a2+6*a3*t;
Vẽ đồ thị: sử dụng các hàm để vẽ đồ thị trong matlab:
% Do_Thi_Quy_Dao subplot(3,1,1); plot(t,q,'b','LineWidth',1); title('Quy dao'); ylabel('Position(degree)'); grid on;
% Do_Thi_Van_Toc subplot(3,1,2); plot(t,dq,'r','LineWidth',1); title('Van toc'); ylabel('Velocity(degree/s)'); grid on;
% Do_Thi_Gia_Toc subplot(3,1,3); plot(t,ddq,'g','LineWidth',1); title('Gia toc'); xlabel('Time(s)'); ylabel('Acceleration(degree/s^2)'); grid on; Đồ thị quỹ đạo chuyển động bậc 3 của khớp 1:
Hình 1.1: Đồ thị quỹ đạo góc khớp, vận tốc và gia tốc
Hình ảnh mô phỏng của mô hình trên solid work Đế Thanh nối 1
XÂY DỰNG MÔ HÌNH ĐỘNG LỰC HỌC CHO ĐỐITƯỢNG TRÊN
Mô phỏng robot trên matlab
Kéo thả các thanh để nhập góc theta sẽ tính toàn ra Px Py Pz, close: đóng giao diện, reset: đưa robot về tọa độ ban đầu
Chương trình matlab: function varargout = giaodien(varargin) gui_Singleton = 1; gui_State = struct('gui_Name', mfilename,
'gui_Callback', []); if nargin && ischar(varargin{1}) gui_State.gui_Callback = str2func(varargin{1}); end if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:}); else gui_mainfcn(gui_State, varargin{:}); end function giaodien_OpeningFcn(hObject, eventdata, handles, varargin) handles.output = hObject;
% Update handles structure guidata(hObject, handles); function varargout = giaodien_OutputFcn(hObject, eventdata, handles) varargout{1} = handles.output; function slider1_Callback(hObject, eventdata, handles) a1=0.075; a2=0.27; a3=-0.09; d1=-0.335; d4=0.295; d6=0.08;
In the model 'Assem1', global variables are utilized to retrieve values from six sliders, with each value being displayed in its corresponding edit box The values from slider one to slider six are obtained using the 'get' function and are converted to strings for display purposes Subsequently, these values are assigned as gains to specific parameters in the model, ensuring that each slider's value directly influences the gain settings of the associated components This process facilitates real-time adjustments and enhances the model's interactivity.
A1=[cosd(theta1) 0 -sind(theta1) a1*cosd(theta1) ; sind(theta1) 0 cosd(theta1) a1*sind(theta1) ; 0 -1 0 d1 ; 0 0 0 1];
A2=[cosd(theta2) -sind(theta2) 0 a2*cosd(theta2) ; sind(theta2) cosd(theta2) 0 a2*sind(theta2) ; 0 0 1 0 ; 0 0 0 1];
A3=[cosd(theta3) 0 sind(theta3) a3*cosd(theta3) ; sind(theta3) 0 -cosd(theta3) a3*sind(theta3) ; 0 1 0 0 ; 0 0 0 1];
A4=[cosd(theta4) 0 -sind(theta4) 0 ; sind(theta4) 0 cosd(theta4) 0 ;
A5=[cosd(theta5) 0 sind(theta5) 0 ; sind(theta5) 0 -cosd(theta5) 0 ;
A6=[cosd(theta6) -sind(theta6) 0 0 ; sind(theta6) cosd(theta6) 0 0 ;
In the provided code, the variable Pz is assigned the value T(3,4), and the values of Px, Py, and Pz are displayed in the respective edit fields using the set function The slider1_CreateFcn function checks if the background color of the slider matches the default UI control background color, and if so, it sets a new background color of light gray Additionally, the slider2_Callback function initializes several parameters: a1 is set to 0.075, a2 to 0.27, a3 to -0.09, d1 to -0.335, d4 to 0.295, and d6 to 0.08.
In the MATLAB model named 'Assem1', global variables are utilized to retrieve values from six sliders, which are then converted to strings and displayed in corresponding edit fields Each slider's value, represented by theta1 through theta6, is dynamically set as the gain for various components within the model, specifically 'Slider Gain' to 'Slider Gain5' This process ensures that user inputs are accurately reflected in the model's parameters, facilitating real-time adjustments and enhancing interactivity.
A1=[cosd(theta1) 0 -sind(theta1) a1*cosd(theta1) ; sind(theta1) 0 cosd(theta1) a1*sind(theta1) ; 0 -1 0 d1 ; 0 0 0 1];
A2=[cosd(theta2) -sind(theta2) 0 a2*cosd(theta2) ; sind(theta2) cosd(theta2) 0 a2*sind(theta2) ; 0 0 1 0 ; 0 0 0 1];
A3=[cosd(theta3) 0 sind(theta3) a3*cosd(theta3) ; sind(theta3) 0 -cosd(theta3) a3*sind(theta3) ; 0 1 0 0 ; 0 0 0 1];
A4=[cosd(theta4) 0 -sind(theta4) 0 ; sind(theta4) 0 cosd(theta4) 0 ;
A5=[cosd(theta5) 0 sind(theta5) 0 ; sind(theta5) 0 -cosd(theta5) 0 ;
A6=[cosd(theta6) -sind(theta6) 0 0 ; sind(theta6) cosd(theta6) 0 0 ;
The code snippet initializes the variable Pz with the value T(3,4) and updates the user interface elements by setting the strings of edit fields to the numerical values of Px, Py, and Pz In the slider2_CreateFcn function, it checks if the background color of the slider matches the default UI control background color, and if so, changes it to a light gray color The slider3_Callback function defines several parameters: a1, a2, a3, d1, d4, and d6, with assigned numerical values for further processing.
In the model named 'Assem1', global variables are utilized to retrieve values from six sliders Each slider's value is obtained using the `get` function and displayed in corresponding edit fields with the `set` function The values from sliders one through six are then converted to strings and set as the 'Gain' parameters for respective slider gain blocks within the model This process ensures that the model dynamically reflects the adjustments made through the user interface, enhancing interactivity and control.
A1=[cosd(theta1) 0 -sind(theta1) a1*cosd(theta1) ; sind(theta1) 0 cosd(theta1) a1*sind(theta1) ; 0 -1 0 d1 ; 0 0 0 1];
A2=[cosd(theta2) -sind(theta2) 0 a2*cosd(theta2) ; sind(theta2) cosd(theta2) 0 a2*sind(theta2) ; 0 0 1 0 ; 0 0 0 1];
A3=[cosd(theta3) 0 sind(theta3) a3*cosd(theta3) ; sind(theta3) 0 -cosd(theta3) a3*sind(theta3) ; 0 1 0 0 ; 0 0 0 1];
A4=[cosd(theta4) 0 -sind(theta4) 0 ; sind(theta4) 0 cosd(theta4) 0 ;
A5=[cosd(theta5) 0 sind(theta5) 0 ; sind(theta5) 0 -cosd(theta5) 0 ;
A6=[cosd(theta6) -sind(theta6) 0 0 ; sind(theta6) cosd(theta6) 0 0 ;
In the provided MATLAB code, the variable Pz is assigned the value of T(3,4), while the values of Px, Py, and Pz are displayed in the respective edit fields using the set function The slider3_CreateFcn function checks if the background color of the slider matches the default UI control background color, and if so, it sets a new background color Additionally, the slider4_Callback function initializes several parameters: a1 is set to 0.075, a2 to 0.27, a3 to -0.09, d1 to -0.335, d4 to 0.295, and d6 to 0.08.
In the model 'Assem1', global
A1=[cosd(theta1) 0 -sind(theta1) a1*cosd(theta1) ; sind(theta1) 0 cosd(theta1) a1*sind(theta1) ; 0 -1 0 d1 ; 0 0 0 1];
A2=[cosd(theta2) -sind(theta2) 0 a2*cosd(theta2) ; sind(theta2) cosd(theta2) 0 a2*sind(theta2) ; 0 0 1 0 ; 0 0 0 1];
A3=[cosd(theta3) 0 sind(theta3) a3*cosd(theta3) ; sind(theta3) 0 -cosd(theta3) a3*sind(theta3) ; 0 1 0 0 ; 0 0 0 1];
A4=[cosd(theta4) 0 -sind(theta4) 0 ; sind(theta4) 0 cosd(theta4) 0 ;
A5=[cosd(theta5) 0 sind(theta5) 0 ; sind(theta5) 0 -cosd(theta5) 0 ;
A6=[cosd(theta6) -sind(theta6) 0 0 ; sind(theta6) cosd(theta6) 0 0 ;
In the provided code snippet, the variable Pz is assigned the value T(3,4), while the user interface elements are updated with the values of Px, Py, and Pz using the set function The slider4_CreateFcn function ensures that the background color of the slider matches the default UI control color Additionally, the slider5_Callback function initializes several parameters, including a1, a2, a3, d1, d4, and d6, with specific numerical values.
In the model named 'Assem1', global variables are utilized to retrieve values from six sliders, updating corresponding edit fields with their numerical representations Each slider's value is assigned to a variable (theta1 through theta6) and displayed in the respective edit boxes Additionally, the gain parameters for various components within the model are set based on these slider values, ensuring that the model dynamically reflects user inputs for optimal performance.
A1=[cosd(theta1) 0 -sind(theta1) a1*cosd(theta1) ; sind(theta1) 0 cosd(theta1) a1*sind(theta1) ; 0 -1 0 d1 ; 0 0 0 1];
A2=[cosd(theta2) -sind(theta2) 0 a2*cosd(theta2) ; sind(theta2) cosd(theta2) 0 a2*sind(theta2) ; 0 0 1 0 ; 0 0 0 1];
A3=[cosd(theta3) 0 sind(theta3) a3*cosd(theta3) ; sind(theta3) 0 -cosd(theta3) a3*sind(theta3) ; 0 1 0 0 ; 0 0 0 1];
A4=[cosd(theta4) 0 -sind(theta4) 0 ; sind(theta4) 0 cosd(theta4) 0 ;
A5=[cosd(theta5) 0 sind(theta5) 0 ; sind(theta5) 0 -cosd(theta5) 0 ;
A6=[cosd(theta6) -sind(theta6) 0 0 ; sind(theta6) cosd(theta6) 0 0 ;
In the provided code snippet, the variable Pz is assigned the value of T(3,4), and the corresponding values of Px, Py, and Pz are displayed in the user interface through the edit fields edit7, edit8, and edit9, respectively The slider5_CreateFcn function ensures that the background color of the slider matches the default UI control background color, setting it to a light gray if necessary Additionally, the slider6_Callback function initializes several parameters, including a1, a2, a3, d1, d4, and d6, with specific numeric values to be used in further calculations or operations within the application.
In the model named 'Assem1', global variables are utilized to retrieve values from six sliders, updating corresponding edit fields with their numeric representations Each slider's value is obtained using the `get` function, and the results are displayed in the associated edit boxes through the `set` function Additionally, the slider values are assigned as gains to specific components within the model using the `set_param` function, ensuring that the parameters for 'Slider Gain' through 'Slider Gain5' reflect the current slider values accurately.
A1=[cosd(theta1) 0 -sind(theta1) a1*cosd(theta1) ; sind(theta1) 0 cosd(theta1) a1*sind(theta1) ; 0 -1 0 d1 ; 0 0 0 1];
A2=[cosd(theta2) -sind(theta2) 0 a2*cosd(theta2) ; sind(theta2) cosd(theta2) 0 a2*sind(theta2) ; 0 0 1 0 ; 0 0 0 1];
A3=[cosd(theta3) 0 sind(theta3) a3*cosd(theta3) ; sind(theta3) 0 -cosd(theta3) a3*sind(theta3) ; 0 1 0 0 ; 0 0 0 1];
A4=[cosd(theta4) 0 -sind(theta4) 0 ; sind(theta4) 0 cosd(theta4) 0 ;
A5=[cosd(theta5) 0 sind(theta5) 0 ; sind(theta5) 0 -cosd(theta5) 0 ;
A6=[cosd(theta6) -sind(theta6) 0 0 ; sind(theta6) cosd(theta6) 0 0 ;
In this article, we explore the implementation of a MATLAB GUI that manages user inputs and outputs through various edit fields and sliders The code initializes a point Pz with coordinates T(3,4) and updates the corresponding edit fields with the values of Px, Py, and Pz Each edit field's background color is set to white for Windows users, ensuring a consistent user interface Additionally, the GUI includes callback functions for each edit field and slider, allowing for dynamic interaction The push buttons are programmed to close the interface or execute specific calculations based on predefined parameters This structured approach enhances usability and functionality within the MATLAB environment.
In the Assem1 model, global variables are utilized to retrieve values from six sliders, which are then set to zero Each slider's value is displayed in corresponding edit fields, ensuring clarity for the user The gain parameters for various components within the model are updated to reflect the slider values, maintaining a cohesive link between the user interface and the model's functionality This process enhances interactivity and precision in the model's performance.
A1=[cosd(theta1) 0 -sind(theta1) a1*cosd(theta1) ; sind(theta1) 0 cosd(theta1) a1*sind(theta1) ; 0 -1 0 d1 ; 0 0 0 1];
A2=[cosd(theta2) -sind(theta2) 0 a2*cosd(theta2) ; sind(theta2) cosd(theta2) 0 a2*sind(theta2) ; 0 0 1 0 ; 0 0 0 1];