• No results found

Anthropomorphic Robot Arm

N/A
N/A
Protected

Academic year: 2021

Share "Anthropomorphic Robot Arm"

Copied!
42
0
0

Loading.... (view fulltext now)

Full text

(1)

DEGREE PROJECT IN MECHANICAL

ENGINEERING, FIRST CYCLE, 15

CREDITS

STOCKHOLM, SWEDEN 2020

Anthropomorphic Robot Arm

ALEXANDER WALLÉN KIESSLING

NICLAS MÄÄTTÄ

KTH ROYAL INSTITUTE OF TECHNOLOGY

(2)
(3)

Anthropomorphic

Robot Arm

Alexander Wallén Kiessling

Niclas Määttä

Bachelor’s Thesis at ITM Supervisor: Nihad Subasic Examiner: Nihad Subasic

(4)
(5)

Abstract

Robot manipulators are commonly used in today's industrial applications. In this report a 3D-printed anthropomorphic robot arm with three degrees of freedom was constructed. The robot arm operates with the use of a microcontroller and servomotors. Through utilizing the Denavit-Hartenberg method and inverse kinematics the robot’s end effector is able to reach a specified point in space. This report has found that the accuracy of the constructed robotic manipulator reaching a specific coordinate depends on the distance of the end effector from its base. The relative error of the constructed robot’s positioning falls within 1.3-6.9%, with a 99% confidence.

(6)

Referat

Antropomorf Robotarm

Robotmanipulatorer är idag vanligt förekommande i industriella applikationer. I denna rapport konstrueras en 3D-printad antropomorf robotarm med tre frihetsgrader. Robotarmen styrs med hjälp av en mikrokontroller och servomotorer. Baserat på Denavit-Hartenberg metoden och inverskinematik kan robotens ändpunkt ta sig till en specificerad punkt i rummet. Vidare har rapporten funnit att den konstruerade robotens exakthet beror på avståndet emellan robotens manipulator och dess bas. Det relativa felet av robotens positionering ligger inom intervallet 1.3-6.9% med en 99% konfidens.

(7)

Acknowledgements

We would like to thank Nihad Subasic for the support throughout this project, and for his valuable feedback and input. Furthermore, thank you to

Seshagopalan Thorapalli Muralidharan for his help in evaluating our solutions. Finally, we would also like to thank Staffan Qvarnström and Tomas Östberg for their assistance in procuring materials for the project.

(8)

Contents

List of Figures 1 List of Tables 2 List of Abbreviations 3 1 Introduction 4 1.1 Background ... 4 1.2 Purpose ... 4 1.3 Scope ... 4 2 Theory 5 2.1 Mechanics ... 5 2.1.1 Forward Kinematics... 5 2.1.2 Denavit-Hartenberg Method... 7 2.1.3 Inverse Kinematics ... 8

2.2 Programming and Control ... 9

2.3 Electronics ... 11

2.3.1 Motor Sizing ... 11

2.3.2 Pulse Width Modulation (PWM) ... 11

2.4 Accuracy and Repeatability ... 12

3 Method 13 3.1 Computer Aided Design (CAD) ... 13

3.2 Controller ... 13 3.3 Construction ... 15 3.4 Testing ... 17 4 Results 18 5 Discussion 21 5.1 Future work ... 21 5.2 Conclusion ... 22 References 23 Appendices 25

A Servo data sheet 25

B Formulas and data 28

(9)

1

List of Figures

Figure 1: Relative coordinate frames (Created in Microsoft Powerpoint), p. 5. Figure 2: Kinematic diagram of 3-DOF anthropomorphic manipulator [1], p. 7. Figure 3: Visualization of inverse and forward kinematics [3], p. 8.

Figure 4: Control modules (Created in Microsoft Powerpoint), p. 9.

Figure 5: Programming flowchart for control of robot (Created in Microsoft Powerpoint), p. 10.

Figure 6: Pulse width modulation for a servo [6], p. 11.

Figure 7: Rendering of the complete robot manipulator (Created in Keyshot 7), p. 13.

Figure 8: Electric circuit (Created in Microsoft Powerpoint), p. 14.

Figure 9: Custom made roller bearing. Allowing for smooth movements and stabilization around the robot waist (Created in Keyshot 7), p. 15.

(10)

2

List of Tables

Table 1: Denavit-Hartenberg parameters for an anthropomorphic robot arm, p. 7. Table 2: Parts used for construction, p. 16.

Table 3: Single axis test results, p. 18. Table 4: Single axis data spread, p. 18. Table 5: Dual axis test results, p. 19. Table 6: Dual axis data spread, p. 19. Table 7: Triple axis test results, p. 19. Table 8: Triple axis data spread, p. 19.

Table 9: Relative error of the robot arm p. 20.

(11)

3

List of Abbreviations

(12)

4

Chapter 1

Introduction

This chapter prefaces the report with an introduction for the background, purpose and scope of the project.

1.1 Background

This project concerns constructing a robot arm for interaction with its

surrounding environment, using mechanical and electrical components as well as a microcontroller. Robot manipulators are used extensively in today’s industrial applications. This usage only continues to grow as the technology improves, and as such, increases in relevancy as an area of research.

1.2 Purpose

The purpose of this project is to create and control a robot arm which can move its endpoint to any specified point in space using inverse kinematics.

Furthermore, the construction and programming should be robust, efficient and make use of simple kinematic modeling methods as a means of control.

This essay will also answer the following research questions:

• What are the challenges in using kinematic control for a robotic arm? • What factors affect accuracy in robotic manipulators?

1.3 Scope

(13)

5

Chapter 2

Theory

This chapter focuses on a theoretical discussion of the various areas of engineering which were involved in this project.

2.1 Mechanics

This project relies heavily on the motion of rigid bodies, more specifically the study of kinematics. In the area of robotics this is often subdivided into two components, forward kinematics and inverse kinematics. The former is the translation of motion from the immobile base of the robot to the actuator of the robot which can move freely. The latter concerns the translation of spatial coordinates from the actuator into variables of movement for the robot, such as rotation and translation. Such variables dictate how movement can be

coordinated between the robot's electronic components.

2.1.1

Forward Kinematics

A robot manipulator is constructed of joints and links, where joints can be revolute or prismatic, whereas the links rigidly connect the joints. A revolute joint is able to rotate, whilst a prismatic joint can move linearly. Each joint should be considered belonging to its own inherent coordinate system. For example, the base is often considered as the 𝟎: 𝒕𝒉 system, and following joints are the 𝒏 − 𝟏: 𝒕𝒉 system. These systems are also known as a coordinate frames. The frames can then be described in relation to adjacent frames, allowing any frame to be sequentially translated from the base frame. This in turn means that any movement or position of the system frames is possible to describe mathematically. Below follows a mathematical description following from [1].

(14)

6

In Figure 1, frame O' is moving relative to frame O. To describe the motion that a coordinate system experiences in relation to another, linear motion needs to be described. This can be done in the form of a displacement vector

'

'

'

x

d

y

z

 

 

=  

 

 

, (1)

where each entry describes the relative position of the 𝒏: 𝒕𝒉 coordinate system in relation to the 𝒏 − 𝟏: 𝒕𝒉.

In addition to linear translation, rotational motion also needs to be described. This can compactly be achieved by applying the rotation matrix. Expressing the rotation of one frame relative to another is done by deriving the projection of the 𝒏: 𝒕𝒉 frame on the 𝒏 − 𝟏: 𝒕𝒉 frame. In Figure 1, the projection of frame O'-x'y'z' can be projected onto the frame O-xyz by the following equations

' 'x 'y 'z x = x x+x y+x z, (2) ' 'x 'y 'z y = y x+ y y+ y z, (3) ' 'x 'y 'z z = z x+x y+z z. (4)

When combined, equations 2-4 form the rotation matrix

'

'

'

'

'

'

'

'

'

x x x y y y z z z

x

y

z

R

x

y

z

x

y

z

= 

. (5)

By also using a homogenous transformation matrix, the rotational and linear translations between frames can both be described simultaneously in the 4x4 matrix 1 1 1

0

1

n n n n n n T

R

d

H

− − −

= 

.

(6)

Furthermore, a sequence of coordinate transforms can be described using a compound matrix, which is the result of the multiplication of all the individual frame transformations

0 0 1 2

3 1 2 3

H = H H H . (7)

This compound matrix allows for the complete description of the forward

kinematics between the base and the end effector frames, effectively allowing for calculation of the coordinate of the end effector when given the angle and

(15)

7

2.1.2

Denavit-Hartenberg Method

There is a general method available for computing the homogenous

transformation matrix for an open chain robot manipulator. It is somewhat less intuitive than the method described in section 2.1.1 but requires fewer steps. It is called the Denavit-Hartenberg (DH) method, which this project utilizes. Below follows a short description.

Figure 2: Kinematic diagram of 3-DOF anthropomorphic manipulator [1]. To begin with, the frames of each joint in the robot were set according to the four rules inherent to this method which are described in [1]. Following this, the four DH parameters were obtained through use of Figure 2, which describes the position of frame 𝒏 with respect to frame 𝒏 − 𝟏 and put into a parameter table.

Table 1: DH parameters for an anthropomorphic robot arm. Link i

a

i

d

i

i 1 0 2

0 1

2 2

a

0 0

2 3 3

a

0 0

3

The four parameters are rotary joint angle 𝝑𝒊, sliding joints variables 𝒅𝒊, joint

offset distance 𝒂𝒊, and the angle between the two neighboring z axes 𝜶𝒊 [2]. Each

(16)

8 1

c

0

0

0

0

1

i i i i i i i i i i i i i i i i n n i

s

c

s

s

a c

s

c

c

c

c

a s

H

s

c

d

              −

− 

− 

= 

. (8)

The complete transformation matrix from frame 3 to frame 0 was then computed in the same way as in equation 7, resulting in

1 23 1 23 1 1 2 2 3 23 1 23 1 23 1 1 2 2 3 23 0 0 1 2 3 1 2 3 23 23 2 2 3 23

(

)

(

)

0

0

0

0

1

c c

c s

s

c

a

c

a

c

s c

s s

c

s

a

c

a

c

H

H H H

s

c

a

s

a

s

− 

 +

− 

 +

=

=

 +

. (9)

2.1.3

Inverse Kinematics

One of the most important problems in robot control is inverse kinematics. It involves finding the values of joint angles 𝜽𝟏, 𝜽𝟐, … , 𝜽𝒏 which allows the robot

arm to reach a given location in space, with a specific orientation of the end effector. The robot of this project has three rotational joints, which for an open kinematic chain such as an anthropomorphic arm translates to three degrees of freedom. As such, the robot can reach any given point in its workspace, but with no control over the orientation of the robot’s end effector.

Inverse kinematics is essentially the inverse calculation of forward kinematics, see Figure 3. These calculations are generally more complex, as there are often multiple possible solutions, and sometimes no analytical solutions.

Figure 3: Visualization of inverse and forward kinematics [3].

For this project, the inverse problem remains to solve equation 9. This problem could be solved with a number of methods. Traditionally, the method of solving inverse kinematics has been through analytical, geometric and numerical methods. However, with the advent of soft computing methods there are other possibilities, such as neural networks discussed in [3]. Normally, the

disadvantage of the analytic method remains a dependency on the existence of closed form solutions. With a restriction of three joints, the analytical solution remains mathematically feasible. As such, in order to limit the computational power required, this was the method selected for this project. The problem then becomes as follows from equations 10-12

1

(

2 2 3 23

)

(17)

9

1

(

2 2 3 23

)

Y

= 

s

a c

 + 

a c

(11)

2 2 3 23

Z

=

a

 + 

s

a s

.

(12)

From equations 10-12, it is possible to solve for 𝜽𝟏, 𝜽𝟐, 𝜽𝟑. The existence of

solutions is guaranteed only if the given end-effector position belongs to the manipulator workspace [1]. This requires in turn that the coordinates of the end effector position are constricted by

2 2 2

2 3 2 3

a

a

X

+

Y

+

Z

a

+

a

(13)

which in turn defines the workspace of the robot arm.

2.2 Programming and Control

Controlling a robot requires some form of basic computational ability, relating inputs to desired outputs. For this project, the robot needs the ability to transform user defined coordinate points into angular movement, using servo motors as actuators. This level of functionality would allow the robot to interact with its surroundings. To achieve that whilst retaining a structured code,

modularizing into different functions can be helpful, see Figure 4. This allows for a more structured and intuitive code, which helps supporting future

maintenance.

Figure 4: Control modules for robot program. Arrows indicate communication. Created using Microsoft Powerpoint.

(18)

10

of the states, which defines what actions are possible next.

Figure 5: Programming flowchart for control of robot (Created in Microsoft Powerpoint).

As shown in Figure 5, the robot boots up into a ready state as soon as it is powered on by setting all servo motors to a known state, which is also known as homing. At this stage, a set of user specified coordinates as well as robot

(19)

11

2.3 Electronics

In order to achieve motion of the robotic joints, there is a choice of implementation between hydraulics, pneumatics and electromechanical components. However, hydraulics require larger components, and pneumatic components suffer from a lack of position control at other positions than the end points. As such, electric actuators are easier to implement for the purposes of this construction. The project required relatively precise rotational control, which could be achieved by feedback. These requirements were met by using servo motors, which unlike stepper motors are pre-factured to include motor encoders and continuous feedback control [4]. As such, no additional control system needed to be implemented.

2.3.1

Motor Sizing

The process of sizing the motor involves finding a suitable motor for a given application. The criteria of suitability can depend on many factors. However, for this project the main factors were torque as well as cost, whilst limiting the selection to servo motors.

Furthermore, due to the thermal nature of electronic motors, without use of counterbalancing they need to be sized by their continuous rating rather than their instantaneous rating [5]. This restriction is in order to maintain safety of extended operation of the robot.

2.3.2

Pulse Width Modulation (PWM)

In order to control the servos, pulse width modulation (PWM) was used. PWM is a technique which allows variation of power through a digital signal and does so by repeatedly pulsing the signal high and low, outputting an effective average voltage [6]. The servos used in this project can turn 90◦ in either direction which

(20)

12

Figure 6: Pulse width modulation for a servo [6].

The angle of the servo shaft is determined by the duration of the pulse received by the servo's control wire. A pulse of 1.5 ms would rotate theservo shaft to the 90◦ position whilst a shorter pulse would turn it counterclockwise, and a wider

pulse would turn it clockwise. Typically, servos have a pulse width between 0.9-2.1 ms which can be seen in Figure 6. The servo expects a new pulse every 20 ms, and in order to maintain a certain position of the servo shaft the same signal needs to be received repeatedly [6].

2.4 Accuracy and Repeatability

Accuracy and repeatability are two central concepts in robotics. Accuracy relates to a robot's ability to reach a specified position with minimal error. Repeatability refers to a robot's ability to return to a previous state. Because of the inherent inaccuracy in actuation, it is not possible to place the end effector exactly [7]. In practice, both of these measures are affected by backlash, friction, link

compliance, encoder resolution, joint wobble, and manufacturing errors in formulating a kinematic robot model [8]. These factors can be divided into static errors and random errors [7]. Static errors do not change over time, and as such can effectively be approximated offline with enough testing and calculation. For this project an important concept is identifying sources of error which may affect the accuracy and repeatability. From defining the coordinates of specified movement to the actual positioning of the robot, there are several potential sources which may be discussed:

• Parameter uncertainty and offsets. These are static errors.

• Errors could originate from the Arduino communicating with servo motors. Controlling multiple servos with one Arduino may sometimes result in slight angular distortion, in the range of 1 to 2 degrees [4]. This is a random error.

• Imprecision in the encoder resolution of the servo. This is a random error. • Defects in the construction of the robot arm, resulting in joint wobble as

well as unaccounted friction. This is a static error. • Gear backlash in the motors. This is a random error.

(21)

13

Chapter 3

Method

This chapter details the implementation of ideas in a topological order, finishing with the combined ideas into a construction plan as well as testing procedures.

3.1 Computer Aided Design (CAD)

Initially, a 3D model was constructed using Solid Edge [9]. This model allowed 3D printing methods to be utilized for construction of some component parts. In order to properly model the robot arm, the parts which came off the shelf also needed to be incorporated into the model. These parts were the static

components, as their dimensions had no room for change. Instead, everything else needed be modeled flexibly to fit these parts. As such the servo motors were modeled in Solid Edge, following measurements with calipers of uncertainty ±0.05 𝑚𝑚. The other static components were roller bearings, whose models came from [10]. A rendering of the resultant model can be seen in Figure 7.

Figure 7: Rendering of the complete robot manipulator (Created in Keyshot 7). The 3D printed parts were created out of polylactic acid (PLA). In order to simplify the manufacturing, most parts were designed to be thin and flat. This speeds up the printing process quite noticeably, and removed the need for many of the supporting print structures.

3.2 Controller

(22)

14

cheaper, but has less processing power and memory. The Raspberry Pi is an alternative candidate, with more processor capacity, but at a higher cost. Furthermore, the Arduino model Uno has twelve digital gates. A servo motor requires three cables, one for power, one for ground, and one for communication with the controller [4]. As such, these twelve gates are sufficient for the three servo motors that are used to run the robot, as well as some further other

hardware. In order to reduce costs, the project therefore utilized an Arduino Uno microcontroller. However, for any projects using more computationally intensive inverse kinematic methods, a Raspberry Pi or similar would definitely be more suitable.

The use of electric motors necessitated an increase in power, as the Arduino Uno could not supply enough current by itself. To solve this problem, an additional power source was introduced into the circuit.

Figure 8: Circuit diagram, red = power, black = ground, orange = signal. Note that some simplifications have been made of the Arduino in this diagram

(Created using Microsoft Powerpoint).

(23)

15

3.3 Construction

The construction utilizes rigid links to follow the movement of the motors, connecting motion between joints into a longer flexible arm. Similarly to a tower crane, a robot arm requires a stable base. The requirement of stability on the base occurs due to the shifting center of mass, which at times of heavy load or extension could be outside the robot base’s supporting surface area. To simplify this problem, the base of the robot was rigidly fixed to a larger flat surface area, removing the problem of stability and any necessity to implement a

counterweight system or equivalent support.

To house the servo motors, several small housing constructs were created which could attach to link arms on both sides. To allow rotation of the dual links, they were connected rigidly on one side by the servo motor, and on the other side by a ball bearing. This allowed rotation to occur freely during the motion of the motors, and for a stationary pose to be held due to the force of the halted motors. One challenge was the connection of the first servo motor in the base to the rest of the arm. This connection was a single axis in the middle, which would need to hold the entire rest of the arm in place during movement. This could result in wobble and reduced performance, as well as wearing heavily on the servo motor's axle. In order to distribute force more equally along the base, a large roller bearing was required. However, as roller bearings increase in cost rapidly with increased dimensions, this project utilized a custom construction of roller bearing, see Figure 9.

(24)

16

Table 2: Parts used for construction

Part name Amount used Cost per unit (if applicable)

FS5115M Servo 3 249 SEK

Roller bearings (15.9, 6.35, 5) 4 N/A

Servo screws (varying sizes) 21 N/A

Arduino Uno 1 N/A

Breadboard (small) 2 N/A

Power supply (5V, 3A) 1 N/A

Metal balls 20 N/A

All of the parts utilized for construction purposes are listed in Table 2. The datasheet for the FS5115M servo can be seen in Appendix A. Parts which were granted from the school instead of purchased are listed as having no applicable cost attached. Other unlisted miscellaneous materials were also used, such as wiring cable and soldering equipment.

The full constructed robot arm can be seen below in Figure 10.

(25)

17

3.4 Testing

Initially, a test script in the analytical language Matlab was written to confirm the results of the inverse kinematics. The results were used to model diagrams to test if the robot arm would match the given coordinates, using the resulting angles.

As testing proceeded to the controller, the Matlab script was also used to double check results from the C-based kinematics programs. This helped remove certain errors throughout the early phases of programming.

Moreover, as the robot arm was constructed, testing moved to practical

(26)

18

Chapter 4

Results

The total size of the robot's control program is approximately 5500 bytes, and global variables use up 260 bytes of dynamic memory. This is well under the total capacity of the Arduino Uno, leaving 83% and 88% remaining capacity, respectively. The time required for the controller to calculate the inverse

kinematics resulted in four microseconds. The uncertainty of this measurement is due to the fact that the Uno measures time in segments of four microseconds, and as such the real time taken could be anywhere from four to seven

microseconds, due to integer division.

For the single axis analysis, the first test used the coordinate vector of (20, 0, 0) whilst the second test used (30, 0, 0). These translate to 20 and 30 cm extensions in the x-direction, respectively. These coordinates were forwarded to the robot, and its resultant position was measured and recorded. The results of the measurements are presented in Table 3-4.

Table 3: Single axis test results.

Test ID Absolute distance (cm) Number of data points Average (cm) 1 20.00 10 20.56 2 30.00 10 29.95

Table 4: Single axis data spread.

Test ID Variance Standard

deviation

99% Confidence interval

1 0.736 0.858 (19.87, 21.25)

2 0.224 0.473 (29.75, 30.15)

(27)

19

Table 5: Dual axis test results.

Test ID Absolute distance (cm) Number of data points Average (cm) 3 28.28 10 28.77 4 35.36 10 35.46

Table 6: Dual axis data spread.

Test ID Variance Standard

deviation

99% Confidence interval

3 0.641 0.800 (28.13, 29.41)

4 0.984 0.992 (34.67, 36.25)

For the triple axis analysis, the coordinate vectors of (20, 10, 20) as well as (20, 15, 25) were used for tests five and six respectively. The results of the

measurements are presented in Table 7-8.

Table 7: Triple axis test results.

Test ID Absolute distance (cm) Number of data points Average (cm) 5 30.00 10 30.62 6 35.36 10 35.76

Table 8: Triple axis data spread.

Test ID Variance Standard

deviation

99% Confidence interval

5 0.736 0.858 (29.94, 31.30)

6 0.224 0.473 (35.38, 36.14)

(28)

20

Table 9: Relative error of the robot arm. Test ID Relative error (%)

1 6.90 2 1.33 3 4.53 4 4.47 5 4.53 6 2.15

(29)

21

Chapter 5

Discussion

From Table 9 it is possible to see that the error of the robot is within the range of 1.33-6.9%. These percentages are based on an interval estimation with 99% certainty. As such, the results suggest that the robot's position will fall within 6.9% from the given position, with 99% confidence.

Additionally, the variance results presented in Tables 4,6 and 8 display signs of heteroscedasticity. This indicates a certain lack of independence between the absolute distance of the coordinate given, and the error of the robot's positioning. However, overall the variance results are better than expected as these are always less than one. This shows a useful level of repeatability of the robot. The challenges that this project has experienced with using inverse kinematics has been to model the robot accurately. There are numerous ways to solve a kinematic model as discussed in 2.1.3, however none of these methods can make up for erroneous parameters or a misaligned model. Initially the robot struggled with changing the active quadrant it was moving in, due to such a

misalignment. As a result, the robot's workspace was reduced.

As outlined in Section 2.4, there are various reasons for the errors of the results. The one that this project struggled with the most was material irregularities and defects which resulted in small mismatching of parts. This is to be expected, as the robot was constructed from mostly 3D-printed polymers. Any

improvements of the kinematic model employed should be considered negligible until construction flaws with such high error impact have been eliminated.

5.1 Future work

An initial improvement could be to change the plastic in the construction for a more rigid material, such as aluminum. Machining aluminum parts for a build would allow for smaller tolerances between parts, yielding a much more accurate robot. However, an increased weight would necessitate greater torque from the motors and/or a counterweight implementation. Such an improvement would make possible heavier payloads, such as a gripper with a lifted load.

Furthermore, adding an additional three degrees of freedom of wrist mobility to allow for arbitrary orientation of the gripper would also enable greater

(30)

22 metal might be more suitable however.

Moreover, changing the Arduino Uno for a more powerful processor such as a Raspberry Pi 4 Model B would facilitate a use of more advanced inverse

kinematic solution techniques, as well as any form of intelligent decision making of the robot.

Future work to follow up on this project could tentatively be to build an

improved version of the robot as mentioned above, and to use it for researching more advanced algorithms. Alternatively, a ready produced robot could be purchased with similar reasoning, where the software and mathematics is the main focus of the research.

5.2 Conclusion

(31)

23

References

[1] B. Siciliano, L. Sciavicco, L. Villani, and G. Oriolo, Robotics: Modelling, Planning and Control. London: London: Springer London, 2009. doi: 10.1007/978-1-84628-642-1

[2] Y. J. Cui and J. N. Hua, "Kinematics Analysis and Simulation of a 4-DOF Manipulator," Applied Mechanics and Materials, vol. 44-47, pp. 656-660, 2011, doi: 10.4028/www.scientific.net/AMM.44-47.656.

[3] A. El-Sherbiny, M. A. Elhosseini, and A. Y. Haikal, "A comparative study of soft computing methods to solve inverse kinematics problem.(Report)(Author abstract)," Ain Shams Engineering Journal, vol. 9, no. 4, p. 2535, 2018, doi: 10.1016/j.asej.2017.08.001.

[4] J. A. Langbridge, "Servo," pp. 241-252, 2015, doi: 10.1002/9781119183716.ch14.

[5] J. P. Whitney, "A passively safe and gravity-counterbalanced

anthropomorphic robot arm," J. K. Hodgins, Ed., ed. IEEE International Conference on Robotics and Automation (ICRA) , Hong Kong, 2014, pp. 6168-6173. doi: 10.1109/ICRA.2014.6907768

[6] N. Pinckney, "Pulse-width modulation for microcontroller servo control," IEEE Potentials, vol. 25, no. 1, pp. 27-29, 2006, doi:

10.1109/MP.2006.1635026.

[7] A. Sinha and N. Chakraborty, "Computing Robust Inverse Kinematics Under Uncertainty," 2019. Arxiv ID: 1910.10852.

[8] H. W. Stone, Kinematic Modeling, Identification, and Control of Robotic Manipulators, 1st ed. 1987.. ed. New York, NY : Springer US : Imprint: Springer, 1987. ISBN : 1-4613-1999-4

[9] S. E. S. 2019. "Solid Edge ST10 2019." https://solidedge.siemens.com/en/

(accessed 2020-05-08, 2020).

[10] A. B. LLC. "AST ® Bearings LLC." https://www.astbearings.com/ (accessed

2020-05-07, 2020).

(32)
(33)

25

Appendices

Appendix A

(34)
(35)
(36)

28

Appendix B

Formulas and data

In order to calculate the absolute sum of coordinate lengths, the following formula was used

‖𝑥1+ 𝑥2+ ⋯ + 𝑥𝑛‖ = √𝑥12+ 𝑥22+ ⋯ + 𝑥𝑛2,

where n is the number of variables used. Furthermore, in order to procure the average 𝑥̅ of a set of data, the following calculation was used

𝑥̅ =∑ 𝑥 𝑛 .

Also, variance (V) could be calculated using the below equation

𝑉 = ∑(𝑥𝑖− 𝑥̅)

2

𝑛 ,

and standard deviation (𝜎 ) can be calculated by taking the square root of the variance as follows

𝜎 = √𝑉.

Moreover, in order to estimate the interval of the expected value 𝜇, it is assumed that the spread of the results are normally distributed, and that the results are independent of each other. Following those assumptions, then an interval can be written as

𝜇 − 𝜆𝛼/2𝐷 < 𝑥̅ < 𝜇 + 𝜆𝛼 2⁄ 𝐷,

where 𝜆𝛼/2 is a constant associated with the confidence interval's length, and 𝐷 = 𝜎 √𝑛⁄ .

This equation can be rewritten as

𝑥̅ − 𝜆𝛼/2𝐷 < 𝜇 < 𝑥̅ + 𝜆𝛼/2𝐷,

which is in interval bounded by

𝐼𝜇= (𝑥̅ − 𝜆𝛼/2𝐷, 𝑥̅ − 𝜆𝛼/2𝐷).

This expression describes the two-sided confidence interval of 𝜇 with likelihood 1 − 𝛼. With a confidence of 99%, 𝜆𝛼/2= 2.52 [11].

(37)

29

Appendix C

Code

/* KEX6

* Anthropomorphic Robot Arm * Antropomorf Robotarm * Date: 2020-05-29

* Authors: Alexander Wallén Kiessling & Niclas Määttä * Examiner: Nihad Subasic

* TRITA-nr: 2020:26 * Course: MF133X *

* Bachelor's work at KTH within mechatronics *

* Description: This is the main module of the program, intended to act as driver code. */

//Import necessary packages #include <Servo.h>

#include <stdio.h> #include <math.h>

#include "parameterFile.h" //custom C file, intended for user specified data #include "bootup.h" //custom C file

#include "kinematics.h" //custom C file #include "movementControl.h" //custom C file void setup()

{

initialize(); //bootup the robot, see bootup.h }

/*Loop program over and over, if button is pressed then a movement command is issued to the servos from the coordinate data set. If coordinate data set is

exhausted, then reset back to first given coordinate.*/ void loop()

{

state = digitalRead(2); if(state == HIGH) {

vector angles = inversekinematics(coordinates[i], coordinates[i + 1], coordinates[i + 2]); moveTo(angles); //see movementControl.h

i = i + 3; }; if(i >= sizeof(coordinates)/4) { i = 0; }; } /* KEX6

(38)

30 * Antropomorf Robotarm

* Date: 2020-05-29

* Authors: Alexander Wallén Kiessling & Niclas Määttä * Examiner: Nihad Subasic

* TRITA-nr: 2020:26 * Course: MF133X *

* Bachelor's work at KTH within mechatronics *

* Description: This is an auxiliary program, intended to assist with bootup. It includes global variables, a struct data type, as well as functions to begin serial communication and attach servos and button.

*/

//Note: this program uses <Servo.h> commands, included by main.ino //setup global variables

int state = 0; //button state int i = 0; //counter for loop

//create structure type to hold data typedef struct vector

{

double x; double y; double z; }vector;

//initialize all four servos on a global scope Servo servo1, servo2, servo3;

//sets up communication port, as well as servo attachment pins and button input void initialize()

{

Serial.begin(9600); //output to pc for testing with baudrate 9600 servo1.attach(3); //assign digital gates to servos

servo2.attach(5); servo3.attach(6);

pinMode(2, INPUT); //assign digital gate to button };

/* KEX6

* Anthropomorphic Robot Arm * Antropomorf Robotarm * Date: 2020-05-29

* Authors: Alexander Wallén Kiessling & Niclas Määttä * Examiner: Nihad Subasic

* TRITA-nr: 2020:26 * Course: MF133X *

* Bachelor's work at KTH within mechatronics *

* Description: This is a calculation program, taking an input of coordinates (doubles) and returning angles (doubles) which can be used to power the servo motors. Currently using struct double data type to convey coordinates and angles.

*/

(39)

31 {

//Angle3 functions

double cos3 = (pow(X,2) + pow(Y,2) + pow(Z,2) - pow(l2,2) - pow(l3,2))/(2 * l2 * l3);

double sin3pos = sqrt(1 - pow(cos3,2)); double sin3neg = - sqrt(1 - pow(cos3,2)); //Angle2 functions

double cos2pos = (sqrt(pow(X,2) + pow(Y,2)) * (l2 + l3 * cos3) + Z * l3 * sin3pos)/(pow(l2,2) + pow(l3,2) +

2 * l2 * l3 * cos3);

double cos2neg = -(sqrt(pow(X,2) + pow(Y,2)) * (l2 + l3 * cos3) + Z * l3 * sin3pos)/(pow(l2,2) + pow(l3,2) +

2 * l2 * l3 * cos3);

double sin2pos = (Z * (l2 + l3 * cos3) + sqrt(pow(X,2) + pow(Y,2)) * l3 * sin3pos)/ (pow(l2,2) + pow(l3,2) + 2 * l2 * l3 * cos3); double sin2neg = (Z * (l2 + l3 * cos3) - sqrt(pow(X,2) + pow(Y,2)) * l3 * sin3pos)/ (pow(l2,2) + pow(l3,2) + 2 * l2 * l3 * cos3); //Angle1 functions

//None necessary // Angle calculations

double angle3 = 180 * (atan2(sin3pos,cos3))/3.14 - 24; double angle2 = 180 * (atan2(sin2pos,cos2neg))/3.14 - 12; double angle1 = 180 * (atan2(Y,X))/3.14;

//return formatting vector angles;

angles.x = angle1; angles.y = angle2; angles.z = angle3; return angles;

}; /* KEX6

* Anthropomorphic Robot Arm * Antropomorf Robotarm * Date: 2020-05-29

* Authors: Alexander Wallén Kiessling & Niclas Määttä * Examiner: Nihad Subasic

* TRITA-nr: 2020:26 * Course: MF133X *

* Bachelor's work at KTH within mechatronics *

* Description: An auxiliary file, including a movement command for a robot. Created to reduce code clutter and allow for easy access during maintenance.

*/

(40)

32 void moveTo(struct vector angles)

{ delay(50); servo1.write(angles.x); delay(50); servo2.write(angles.y); delay(50); servo3.write(angles.z); }; /* KEX6

* Anthropomorphic Robot Arm * Antropomorf Robotarm * Date: 2020-05-29

* Authors: Alexander Wallén Kiessling & Niclas Määttä * Examiner: Nihad Subasic

* TRITA-nr: 2020:26 * Course: MF133X *

* Bachelor's work at KTH within mechatronics *

* Description: This file is intended for handling all parameters, link lengths, coordinates. The program is the interface for the user to change.

*/

//declare globally link lengths of 20 cm for inverse kinematic parameters static double l1 = 0, l2 = 0.2, l3 = 0.2;

//declare coordinate set

(41)
(42)

34

TRITA ITM-EX 2020:26

References

Related documents

ra ejus generis funt, adhiberentur, quum homini nihil e venire poffet, nifi quod fati lege evenire deberet, Redte itaq^Parkerus,. Porticum&lt;3rHortum hoc in

Det intersektionella perspektivet och queerteorin tillsammans med förlängningen performativitet lämpar sig väl för vår studie där syftet delvis är att få

The Brazilian Portuguese version of the ASTA- symptom scale (ASTA-Br-symptom scale) was psycho- metrically evaluated regarding data quality, construct val- idity, and

• Viktigt, för att undvika packningsskador, är också att välja lämplig spridningstidpunkt, det vill säga spridning på upptorkad mark eller mellan skörd och plöjning. På lätt

Detta uppnåddes genom att ett efter- rötningssteg lades till nuvarande process och att rötslammet avvattnades till strax under 10 % TS innan pastörisering och efterrötning, samt

If vibration analysis and other similar problems are to be approached in the time sampled domain, one either has to rely on data interpolation to uniform time sampling or

However, numerous performance tests of compression algorithms showed that the computational power available in the set-top boxes is sufficient to have acceptable frame rate and

När läraren ställer en central fråga som under lektion 3 (se sid.19) ”Vad skulle hända om allt vore magnetiskt?” leder det fram till att eleverna får tänka efter och sätta in