Report Finale
Report Finale
Report Finale
Contents
1. Introduction
1.1. Motivation
1.2. Available product
1.3. Overview
2. System Design
2.1. Mechanical Design
2.1.1. 3D Modelling
2.1.2. Material and Manufacturing
2.1.3. Assembly
2.2. Electrical Design
2.2.1. Microcontroller
2.2.2. Actuator
2.2.3. Power
2.3. Control Design
2.3.1. Embedded programming
2.4. User Interface (UI) Design
2.4.1. About Qt5
2.4.2. Implementation
3. Conclusion
3.1. Comment
3.2. Limitation and Development
1. Introduction
1.1 Motivation.
- In today's fast-paced and technologically driven world, the integration of robotics into various industries has
become more prevalent than ever before. Among these remarkable advancements, the robot arm stands tall as
one of the most versatile and transformative inventions of our time. With the ability to replicate human arm
movements and perform a wide range of tasks, robot arms have revolutionized the way we approach
manufacturing, assembly, and automation processes.
- With the development of science and technology, an increasing number of types of robotic arms are being
developed and manufactured to meet the needs of the factories. We can see them in manufacturing facilities.
- Being students on the Mechatronics course, we have seen and approached some kinds of robot arms. And for
this project we will design a small robot arm that has 2 degrees of freedom.
2.1.3. Assembly
The last job is to assemble all the parts along with servos together to form the whole structure of the robot arm.
Our final prototype is shown below.
Figure 7. PWM
- From the picture we can understand that the PWM signal produced should have a frequency of 50 Hz,
that is the PWM period should be 20ms. Out of which the On-Time can vary from 1ms to 2ms. So, when
the on-time is 1ms the motor will be in 0° and when 1.5ms the motor will be 90°, similarly when it is
2ms it will be 180°. So, by varying the on-time from 1ms to 2ms the motor can be controlled from 0° to
180°
- This project's circuit diagram is quite simple. This project's circuit diagram is quite simple. We just need
an Arduino board and 2 MG996R Servo motors and we communicate with the computer through USB
ports. The control pins of the 2 servo motors are connected to 2 digital pins of the Arduino board.
Figure 8. 2 DOF Robot arm circuit
2.2.3. Power
- To power the servos, we need 5V, but this must come from an external power source because the
Arduino is not able to handle the amount of current that all of them can draw.
- There is also a point-to-point motion function. Where we can save positions to some arrays and push the
Run button to implement those steps.
2.3.1. Embedded programming
- In this project we will use a program to control the robot arm using Arduino Uno R3 board. Below is the
program that we write to control it.
#include <Servo.h>
Servo servo01;
Servo servo02;
Servo servo03;
void setup () {
servo01.attach(5);
servo02.attach(6);
servo03.attach(7);
Serial.begin(38400);
Serial.setTimeout(1);
delay (20);
// Robot arm initial position
servo1PPos = 90;
servo01.write(servo1PPos);
servo2PPos = 150;
servo02.write(servo2PPos);
servo3PPos = 35;
servo03.write(servo3PPos);
}
void loop () {
// Check for incoming data
if (Serial.available() > 0) {
//Serial.println("Connected");
dataIn = Serial.readString(); // Read the data as string
Serial.print(dataIn);
// Move Servo 2
if (dataIn.startsWith("s2")) {
String dataInS = dataIn.substring(2, dataIn.length());
servo2Pos = dataInS.toInt();
if (servo2PPos > servo2Pos) {
for (int j = servo2PPos; j >= servo2Pos; j--) {
servo02.write(j);
delay (50);
}
}
if (servo2PPos < servo2Pos) {
for (int j = servo2PPos; j <= servo2Pos; j++) {
servo02.write(j);
delay (50);
}
}
servo2PPos = servo2Pos;
}
// Move Servo 3
if (dataIn.startsWith("s3")) {
String dataInS = dataIn.substring(2, dataIn.length());
servo3Pos = dataInS.toInt();
if (servo3PPos > servo3Pos) {
for (int j = servo3PPos; j >= servo3Pos; j--) {
servo03.write(j);
delay (30);
}
}
if (servo3PPos < servo3Pos) {
for (int j = servo3PPos; j <= servo3Pos; j++) {
servo03.write(j);
delay (30);
}
}
servo3PPos = servo3Pos;
}
}
// If button "SAVE" is pressed
if (dataIn.startsWith("SAVE")) {
servo01SP [index] = servo1PPos; // save position into the array
servo02SP [index] = servo2PPos;
servo03SP [index] = servo3PPos;
- At the top portion of UI, it is the connection part, we can choose which port to connect to, which baud
rate to work with along with Connect and Disconnect button to control the connection.
- At the middle portion, there are sliders used to control the position of the arms.
- At the bottom portion, there are three buttons for point-to-point motion.
3. Conclusion
3.1 Comment
- After launching the course work, first, we have learnt to do the teamwork, and how to apply various
mechatronics knowledge we have learnt before to do the project, such as mechanical design, electrical
component selection, along with the knowledge we have just gained from this course like embedded
programming and user interface programming.
- The project was going through a lot of changes during the implementation, we encountered some issues
and had to change the initial design so that we could complete the project.
Reference:
1. Howtomechatronics.com
2. Lecture notes from Programming in Mechatronics course
3. Qt.io
4. Wikipedia.com
5. Arduino.cc