PROGRAMMING ENGINEERING IN MECHATRONICSTOPIC DESIGN AND CONTROL OF 4-DEGREE-OF-FREEDOM ROBOT ARM Teacher: TS.. Bảng phân chia công việcLập trình thiết kế giao diện, lập trình điều khiển
Trang 1PROGRAMMING ENGINEERING IN MECHATRONICS
TOPIC DESIGN AND CONTROL OF 4-DEGREE-OF-FREEDOM ROBOT ARM
Teacher: TS Dương Văn Lạc
TS Bùi Đình Bá
Nhóm thực hiện: Dương Văn Thịnh
Nguyễn Trung Đức
Trang 2SUMMARY OF MAJOR EXERCISES
1 Summary of the topic
2 How to control the robot
I PROBLEM STATEMENT
1 Reasons
2 Purpose
II PRODUCTS
1 Overview of main components
1.1 Arduino Uno R3
1.2 Động cơ servo SG90
1.3 Circuit diagram
2 Block diagram and algorithm diagram
2.1 Block diagram
2.2 Calculation direct and inverse kinematic for robot arm
III CONCLUSION
1 Advantages
2 Disadvantages
3 Development direction
IV REFERENCES
Trang 3Bảng phân chia công việc
Lập trình thiết kế giao diện, lập trình điều khiển arduino, làm báo cáo, tổng hợp và sửa báo cáo
Lập trình thiết kế giao diện, lậptrình điều khiển arduino, làm slide, làm báo cáo
Trang 4SUMMARY OF MAJOR EXERCISES
1 Summary of the topic
Product: 4-degree-of-freedom robot arm controlled via Winform interface withbasic functions:
- Moving the links with 4 given rotation angles
- Inverse kinematics problem with coordinates and angles of the last link
- Automatically moving between saved positions.
2 How to control the robot
The robot arm uses an Arduino controller to adjust the rotation angle of the links;data is sent to Arduino from the Winform interface via Serial Port communication.The robot arm can be controlled in three ways:
- Use the sliders on the Winform interface to adjust the rotation angle of thelinks
- Directly enter the coordinates and rotation angle of the last link on theWinform interface
- Move between saved positions
Trang 5I PROBLEM STATEMENT
1 Reasons
As society develops, human life is increasingly improved both materially andspiritually With modern technology, human labor is liberated with the advent ofautomatic machines, especially robotic arms In industry, it can performoperations such as picking, placing, welding or assembling components Inmedicine, it can support surgery, rehabilitation as well as patient care Forservice industries, robotic arms can perform tasks such as cleaning, serving ortransporting goods With wide application and flexibility, robotic arms helpimprove work efficiency, minimize errors and increase productivity At the sametime, with complex structures and movements, research and development ofrobotic arms can contribute to the development of technology and create newpotential applications in the future
II PRODUCTS
1 Overview of main components
Trang 6STT Linh kiện Số lượng
Trang 7Số chân Analog (độ phân giải 10 bit) 6
Để lập trình cũng như gửi lệnh và nhận tín hiệu từ mạch Arduino, ta
sử dụng môi trường Arduino IDE, ngôn ngữ Arduino bắt nguồn từ C/C++.
Trang 8Servo motors are designed as closed-loop feedback systems The motor output is connected to
a control circuit As the motor rotates, the speed and position are fed back to the controlcircuit If for any reason the motor does not rotate, the feedback mechanism senses that theoutput has not reached the desired position The control circuit continues to correct the erroruntil the motor reaches the correct position Servo motors controlled by radio communicationare called RC (radio-controlled) servo motors In fact, the servo motor itself is not controlled
by radio, it is only connected to a radio receiver on an airplane or car The servo motorreceives the signal from this receiver
Trang 92 Block diagram and algorithm diagram
Khối điều khiển
- Arduino Uno R3
Khối chấp hành
- Động cơ servo MG996R, SG90
Trang 10a) Input
Toàn bộ hệ thống sẽ được cung cấp nguồn bằng máy tính thông qua dâycáp USB B, đồng thời arduino cũng nhận tín hiệu từ phần mềm trên máytính thông qua dây cáp trên
- Computer interface
QT PROGRAMMING
Widget.h:
Trang 13Widget.cpp:
Trang 20- The interface will rely on sliders or buttons to send data (motorrotation angle, function signal of a button, ) via Serial Port toArduino.
b) Control block
Trang 21signals and transmit them to control the servo motors in the form ofPWM pulses.
- The actuator block will receive the control signal from Arduino UnoR3 and rotate to the angle transmitted by the interface
2.1.1 Algorithm
Trang 23rightServo.write(rightAngle); leftServo.write(leftAngle);
gripperServo.write(gripperAngle); }
void loop() {
Trang 24void parseCommand(String command) {
int angles[4]; // giá trị mặc định
int index = 0;
int start = 0;
command += ','; // thêm dấu phân cách cuối
for (int i = 0; i < command.length(); i++) {
Trang 262.2 Calculation direct and inverse kinematic for robot arm
2.2.1 Động học thuận
2.2.1.1 Đầu vào: Biết q1, q2, q3, q4
2.2.1.2 Đầu ra: Tính tọa độ khâu cuối 𝑝𝑥, 𝑝𝑦, 𝑝𝑧
Từ hình trên ta lập được bảng Denavit-Hartenberg:
Trang 311 Advantages
- Assemble and complete the robot arm
- Design and program the visual interface
- Connect the control from the Arduino control interface and the actuator
- Use basic commands, understand the programming object, program the GUI interface
- Understand the forward and inverse kinematics problems, apply the above problems to the programming control of the robot arm.
2 Disadvantages
- The joints and links do not operate smoothly
- The mechanical part has not been focused on, so the product's rigidity is still low.
bang https://howtomechatronics.com/category/projects/