+ All Categories
Home > Documents > Get a Grip - DiVA portalkth.diva-portal.org/smash/get/diva2:1373917/FULLTEXT01.pdfPID controllers...

Get a Grip - DiVA portalkth.diva-portal.org/smash/get/diva2:1373917/FULLTEXT01.pdfPID controllers...

Date post: 03-Mar-2021
Category:
Upload: others
View: 1 times
Download: 0 times
Share this document with a friend
67
IN DEGREE PROJECT TECHNOLOGY, FIRST CYCLE, 15 CREDITS , STOCKHOLM SWEDEN 2019 Get a Grip Dynamic force adjustment in robotic gripper ELLEN ANDERSON MARTIN GRANLÖF KTH ROYAL INSTITUTE OF TECHNOLOGY SCHOOL OF INDUSTRIAL ENGINEERING AND MANAGEMENT
Transcript
Page 1: Get a Grip - DiVA portalkth.diva-portal.org/smash/get/diva2:1373917/FULLTEXT01.pdfPID controllers thought to be sufficient as starting points for further testing of the complete system.

IN DEGREE PROJECT TECHNOLOGY,FIRST CYCLE, 15 CREDITS

, STOCKHOLM SWEDEN 2019

Get a GripDynamic force adjustment in robotic gripper

ELLEN ANDERSON

MARTIN GRANLÖF

KTH ROYAL INSTITUTE OF TECHNOLOGYSCHOOL OF INDUSTRIAL ENGINEERING AND MANAGEMENT

Page 2: Get a Grip - DiVA portalkth.diva-portal.org/smash/get/diva2:1373917/FULLTEXT01.pdfPID controllers thought to be sufficient as starting points for further testing of the complete system.
Page 3: Get a Grip - DiVA portalkth.diva-portal.org/smash/get/diva2:1373917/FULLTEXT01.pdfPID controllers thought to be sufficient as starting points for further testing of the complete system.

Get a Grip

Dynamic force adjustment in robotic gripper

ELLEN ANDERSON [email protected] GRANLOF [email protected]

Bachelor’s Thesis at ITMSupervisor: Nihad SubasicExaminer: Nihad Subasic

TRITA-ITM-EX 2019:21

Page 4: Get a Grip - DiVA portalkth.diva-portal.org/smash/get/diva2:1373917/FULLTEXT01.pdfPID controllers thought to be sufficient as starting points for further testing of the complete system.
Page 5: Get a Grip - DiVA portalkth.diva-portal.org/smash/get/diva2:1373917/FULLTEXT01.pdfPID controllers thought to be sufficient as starting points for further testing of the complete system.

AbstractAutonomous mobile robots are on the rise and are to beexpected on the market in about 5-10 years. Several chal-lenges need to be solved for this to happen, and the mostcrucial ones are to develop versatile and safe robots.

The Get a Grip robot is a dynamic force adjustment grip-per using inputs from two different sensory systems. Theconstruction of the robot consists of two parallel gripperplates moved by a rack and pinion gear attached to a di-rect current (DC) motor. Embedded into one of the platesis a Force Sensitive Resistor (FSR) for input of the grip-per’s exerted force. Mounted to the other plate is a selfconstructed Slip sensor used for measuring the occurrenceof slip and slip rate. A surrounding crane for mounting ofthe gripper and lifting was also constructed.

The idea of this bachelor’s thesis project is to enable liftingof objects with unknown weight without the gripper exert-ing more force than necessary. This is something that willbe useful in both industrial applications and in householdrobots in the future.In order to realize the concept two different methods for cal-culating the gripper’s applied force were tested, one usingmotor current and the other using a FSR sensor. Throughtesting it was concluded that the FSR sensor was the methodgiving better accuracy and consistency.Proportional–Integral–Derivative (PID) controllers were thentested for both setting force references for the gripper usingthe Slip sensor as input, and controlling the exerted force inthe gripper using the FSR as input. The results led to twoPID controllers thought to be sufficient as starting pointsfor further testing of the complete system.

KeywordsMechatronics, Robot Gripper, Force Control, Slip sensor,PID controller

Page 6: Get a Grip - DiVA portalkth.diva-portal.org/smash/get/diva2:1373917/FULLTEXT01.pdfPID controllers thought to be sufficient as starting points for further testing of the complete system.

ReferatDynamisk kraftsanpassning i robotklo

Mobila autonoma robotar forvantas vara pa marknaden in-om de narmaste 5-10 aren. For att det har ska ske ar detmanga utmaningar som behover losas och de mest kritiskaar att utveckla mangsidga och sakra robotar.

Get a Grip-roboten ar en dynamisk kraftanpassande ro-botklo som tar insignaler fran tva olika sensorsystem. Kon-struktionen bestar av tva parallella plattor som forflyttas avkuggstanger och kugghjul drivna av en DC motor. Inbyggti en av kloplattorna finns en tryckkanslig kraftsensor (FSR)monterad for att registrera kraften som klon genererar. Paden andra kloplattan sitter en egenkonstruerad glidsensorsom registrerar om glidning sker och sjalva glidhastighet.En kran for att montera klon och lyfta den konstrueradesaven.Iden bakom detta kandidatexamens projektet ar att klonska kunna lyfta ett objekt med okand vikt utan att anvandamer kraft an nodvandigt. Det ar nagot som kommer va-ra anvandbart bade vid industriella tillampningar och hoshushallsrobotar i framtiden.For att realisera konceptet testades tva olika metoder foratt estimera kraften klon genererar, den forsta genom mo-torstrommen och den andra genom en FSR sensor. Testergenomfordes for bada metoderna och slutsatsen blev attFSR sensorn gav bast noggranhet och var mest konsekvent.PID-regulatorn, for bestamning av kraftreferens, med in-signal fran glidsensorn och PID-regulatorn, for genereradklokraft, med insignal fran FSR:n testades separat. Resul-tatet blev tva PID-regulatorer som ansags tillrackliga forfortsatta tester med bada regulatorerna tillsammans.

NyckelordMechatronik, Robotklo, Kraftreglering, Glidsensor, PID-regulator

Page 7: Get a Grip - DiVA portalkth.diva-portal.org/smash/get/diva2:1373917/FULLTEXT01.pdfPID controllers thought to be sufficient as starting points for further testing of the complete system.

Acknowledgements

During these five months of our bachelor degree we have received loads of help fromothers whom we would like to thank.

First we would like to thank our supervisor Nihad Subasic for his feedback throughthe project and Staffan Qvarnstrom and Thomas Ostberg for providing us with thecomponents for the construction and with guidance when needed. We would like tothank the course assistants, Seshagopalan Thorapalli Muralidharan and Sresht Iyer,for their willingness to help with all sorts of problems, even outside the scheduledtime.

Secondly, we would like to thank the Prototype Center for providing us with ma-terials and help with the laser cutters and the 3D-printers when constructing thedemonstrator. We also like to thank Ulf Gustavsson for helping us chamfer ourmotor shafts.

Finally we would like to thank our fellow course mates for all the feedback andhelp during these months, both at the seminars and in the lab. We especially wantto thank Group 2 and Group 29 for their help regarding a component in the con-struction that we had a trouble with constructing.

Martin Granlof & Ellen AndersonRoyal Institute of Technology, Stockholm, May 2019

Page 8: Get a Grip - DiVA portalkth.diva-portal.org/smash/get/diva2:1373917/FULLTEXT01.pdfPID controllers thought to be sufficient as starting points for further testing of the complete system.

Contents

1 Introduction 11.1 Background . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.2 Purpose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21.3 Scope . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21.4 Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

2 Theory 52.1 Microcontroller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52.2 Robot Grippers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62.3 Force Modulation Methods . . . . . . . . . . . . . . . . . . . . . . . 7

2.3.1 Motor Current Regulation . . . . . . . . . . . . . . . . . . . . 72.3.2 FSR sensor . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

2.4 Slip sensors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92.4.1 Mechanical roller . . . . . . . . . . . . . . . . . . . . . . . . . 9

2.5 Control Theory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102.5.1 PID Controller . . . . . . . . . . . . . . . . . . . . . . . . . . 102.5.2 Cascade Controller . . . . . . . . . . . . . . . . . . . . . . . . 112.5.3 Filtering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

3 Demonstrator 133.1 Hardware and electronics . . . . . . . . . . . . . . . . . . . . . . . . 13

3.1.1 Crane . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133.1.2 Robot Gripper . . . . . . . . . . . . . . . . . . . . . . . . . . 143.1.3 Slip sensor . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143.1.4 Circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153.1.5 Motor driver . . . . . . . . . . . . . . . . . . . . . . . . . . . 163.1.6 FSR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

3.2 Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163.2.1 Control System . . . . . . . . . . . . . . . . . . . . . . . . . . 173.2.2 Crane . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

3.3 Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183.3.1 Current Regulation . . . . . . . . . . . . . . . . . . . . . . . . 183.3.2 Force Reference Regulation . . . . . . . . . . . . . . . . . . . 19

Page 9: Get a Grip - DiVA portalkth.diva-portal.org/smash/get/diva2:1373917/FULLTEXT01.pdfPID controllers thought to be sufficient as starting points for further testing of the complete system.

3.3.3 Force Regulation . . . . . . . . . . . . . . . . . . . . . . . . . 193.3.4 System Performance . . . . . . . . . . . . . . . . . . . . . . . 19

4 Result 214.1 Current Regulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214.2 Force Reference Regulation . . . . . . . . . . . . . . . . . . . . . . . 234.3 Force Regulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244.4 System Performance . . . . . . . . . . . . . . . . . . . . . . . . . . . 25

5 Discussion and conclusions 275.1 Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27

5.1.1 Current Regulation . . . . . . . . . . . . . . . . . . . . . . . . 275.1.2 Force Reference Regulation . . . . . . . . . . . . . . . . . . . 285.1.3 Force Regulation . . . . . . . . . . . . . . . . . . . . . . . . . 285.1.4 System Performance . . . . . . . . . . . . . . . . . . . . . . . 29

5.2 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29

6 Recommendations and Future work 31

Bibliography 33

A Test Results 37A.1 FSR Calibration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37A.2 Force Reference Regulation . . . . . . . . . . . . . . . . . . . . . . . 39A.3 Force Regulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42A.4 System Performance . . . . . . . . . . . . . . . . . . . . . . . . . . . 45

B Code 47B.1 Arduino Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47

Page 10: Get a Grip - DiVA portalkth.diva-portal.org/smash/get/diva2:1373917/FULLTEXT01.pdfPID controllers thought to be sufficient as starting points for further testing of the complete system.

List of Figures

2.1 Top down view of the chip-set Arduino Uno rev 3. [5] . . . . . . . . . . 52.2 Properties of different drive systems in impactive grippers [7] . . . . . . 62.3 Right: Spindle drive. Left: Rack and pinion drive [7] . . . . . . . . . . . 72.4 Torque-Current curve for a DC motor [9] . . . . . . . . . . . . . . . . . 72.5 Present resistance due to applied force. Curve in logarithmic scale [11]. 82.6 A FSR Voltage Divider [11] . . . . . . . . . . . . . . . . . . . . . . . . . 92.7 Cross sectional view of mechanical roller used in a sensory system for

measuring slip [12] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92.8 Figure of two systems in series with each other [17]. Made in Power-

point[19] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112.9 Figure of a cascade regulated system with the inner feedback loop inside

the dotted box [17]. Made in Powerpoint[19] . . . . . . . . . . . . . . . 11

3.1 Image of the crane and gripper platform. Made in Solid Edge ST10, andrendered in KeyShot [23] . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

3.2 Image of the gripper with the two plates attached through the rails inthe gripper platform to the racks on the opposite side. On one of theplates is the Slip sensor mounted and on the other the FSR sensor. Madein Solid Edge ST10 and rendered in KeyShot[23] . . . . . . . . . . . . . 14

3.3 Picture of the Slip sensor with its mounting structure attached. Madein Solid Edge ST10 and rendered in KeyShot[23] . . . . . . . . . . . . . 15

3.4 Figure of the complete circuitry of the project. Created with Fritzing[21] 153.5 Picture of the Adafruit TB6612 motor driver[22] . . . . . . . . . . . . . 163.6 Flowchart of the algorithm for the Get a Grip project. Made in draw.io[24] 17

4.1 Graph showing exerted force as a function of motor current. The bluecircles are the measured values from test 1 and the red line is the linearadaptation to these points. The equation of the linear adaptation isshown above the graph. Made in Matrix Laboratory (Matlab)[26] . . . . 21

4.2 Graph showing exerted force as a function of motor current. The bluecircles are the measured values from test 2 and the red line is the linearadaptation to these points. The equation of the linear adaptation isshown above the graph. Made in Matlab[26] . . . . . . . . . . . . . . . . 22

Page 11: Get a Grip - DiVA portalkth.diva-portal.org/smash/get/diva2:1373917/FULLTEXT01.pdfPID controllers thought to be sufficient as starting points for further testing of the complete system.

4.3 Graph showing exerted force as a function of motor current. The bluecircles are the measured values from test 3 and the red line is the linearadaptation to these points. The equation of the linear adaptation isshown above the graph. Made in Matlab[26] . . . . . . . . . . . . . . . . 22

4.4 Graph comparing the force reference over time with and without pre-filtering. The blue line is the force reference when using a moving av-erage low pass filter and the orange line is without the filter. Made inExcel[25] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23

4.5 Graph of the force reference plotted over time. Made in Excel[25] . . . . 234.6 Graph of the exerted force plotted over time. Made in Excel[25] . . . . . 244.7 Graph comparing exerted force between different controllers plotted over

time. The blue line uses a proportional control coefficient of 60 and theorange 70. Made in Excel[25] . . . . . . . . . . . . . . . . . . . . . . . . 24

4.8 Graph of the exerted force plotted over time. Made in Excel[25] . . . . . 244.9 Graph showing how the exerted force tracks the force reference during a

lift sequence with an object weighing 250 grams. Made in Excel[25] . . . 254.10 Graph showing how the exerted force tracks the force reference during a

lift sequence with an object weighing 300 grams. Made in Excel[25] . . . 25

A.1 Graph of the resistance in the FSR plotted over the applied force. Theblue circles are the values in resistance taken over three separate testsand the red line is the curve adaptation. Tests performed 2019-04-04.Made in Matlab[26] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

A.2 Graph of the resistance in the FSR plotted over the applied force. Theblue circles are the average values in resistance taken over three separatetests and the red line is the curve adaptation. Tests performed 2019-04-22. Made in Matlab[26] . . . . . . . . . . . . . . . . . . . . . . . . . . . 38

A.3 Graph of the resistance in the FSR plotted over the applied force. Theblue circles are the average values in resistance taken over three separatetests and the red line is the curve adaptation. Tests performed 2019-04-29. Made in Matlab[26] . . . . . . . . . . . . . . . . . . . . . . . . . . . 38

A.4 Graph of the force reference over time using only a proportional regulatorand no prefiltering. Made in Excel[25] . . . . . . . . . . . . . . . . . . . 39

A.5 Graph of the force reference over time using only a integral regulatorand no prefiltering. Made in Excel[25] . . . . . . . . . . . . . . . . . . . 39

A.6 Graph of the force reference over time using only a derivative regulatorand no prefiltering. Made in Excel[25] . . . . . . . . . . . . . . . . . . . 39

A.7 Graph of the force reference over time using only a proportional regulatorand a EMWA with α = 0, 2. Made in Excel[25] . . . . . . . . . . . . . . 40

A.8 Graph of the force reference over time using only a integral regulatorand a EMWA with α = 0, 2. Made in Excel[25] . . . . . . . . . . . . . . 40

A.9 Graph of the force reference over time using only a derivative regulatorand a EMWA with α = 0, 2. Made in Excel[25] . . . . . . . . . . . . . . 40

Page 12: Get a Grip - DiVA portalkth.diva-portal.org/smash/get/diva2:1373917/FULLTEXT01.pdfPID controllers thought to be sufficient as starting points for further testing of the complete system.

A.10 Graph of the force reference over time using a proportional integral reg-ulator and a EMWA with α = 0, 2. Made in Excel[25] . . . . . . . . . . 41

A.11 Graph of the force reference over time using a integral derivative regu-lator and a EMWA with α = 0, 2. Made in Excel[25] . . . . . . . . . . . 41

A.12 Graph of the force reference over time using a proportional integralderivative regulator and a EMWA with α = 0, 2. Made in Excel[25] . . . 41

A.13 Graph of the exerted force over time using a proportional regulator.Made in Excel[25] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42

A.14 Graph of the exerted force over time using a proportional integral regu-lator. Made in Excel[25] . . . . . . . . . . . . . . . . . . . . . . . . . . . 42

A.15 Graph of the exerted force over time using a proportional integral regu-lator. Made in Excel[25] . . . . . . . . . . . . . . . . . . . . . . . . . . . 42

A.16 Graph of the exerted force over time using a proportional integral deriva-tive regulator. Made in Excel[25] . . . . . . . . . . . . . . . . . . . . . . 43

A.17 Graph of the exerted force over time using a proportional integral deriva-tive regulator. Made in Excel[25] . . . . . . . . . . . . . . . . . . . . . . 43

A.18 Graph of the exerted force over time using a proportional integral regu-lator. Made in Excel[25] . . . . . . . . . . . . . . . . . . . . . . . . . . . 43

A.19 Graph of the exerted force over time using a proportional integral regu-lator. Made in Excel[25] . . . . . . . . . . . . . . . . . . . . . . . . . . . 44

A.20 Graph of the exerted force over time using a proportional integral regu-lator. Made in Excel[25] . . . . . . . . . . . . . . . . . . . . . . . . . . . 44

A.21 Graph of the exerted force over time using a proportional integral deriva-tive regulator. Made in Excel[25] . . . . . . . . . . . . . . . . . . . . . . 44

A.22 Graph of the exerted force over time using a proportional integral regu-lator. Made in Excel[25] . . . . . . . . . . . . . . . . . . . . . . . . . . . 45

A.23 Graph of the exerted force over time using a proportional integral deriva-tive regulator. Made in Excel[25] . . . . . . . . . . . . . . . . . . . . . . 45

A.24 Graph showing how the exerted force tracks the force reference during alift sequence with an object weighing 100 grams. Made in Excel[25] . . . 45

A.25 Graph showing how the exerted force tracks the force reference during alift sequence with an object weighing 150 grams. Made in Excel[25] . . . 46

A.26 Graph showing how the exerted force tracks the force reference during alift sequence with an object weighing 200 grams. Made in Excel[25] . . . 46

Page 13: Get a Grip - DiVA portalkth.diva-portal.org/smash/get/diva2:1373917/FULLTEXT01.pdfPID controllers thought to be sufficient as starting points for further testing of the complete system.

List of Abbreviations

CPU Central Processing Unit

DC Direct Current

EMA Exponentially Moving Average

EWMA Exponentially Weighted Moving Average

FSR Force Sensitive Resistor

I/O Input/Output

I2C Inter-Integrated Circuit

LCD Liquid Crystal Display

Matlab Matrix Laboratory

PID Proportional–Integral–Derivative

PWM Pulse Width Modulation

USB Universal Serial Bus

Nomenclature

α Weighted Factor

xi Current Average

xi−1 Previous Average

dg Diameter of Gear to Convert Rotational Movement to Linear Move-ment

Page 14: Get a Grip - DiVA portalkth.diva-portal.org/smash/get/diva2:1373917/FULLTEXT01.pdfPID controllers thought to be sufficient as starting points for further testing of the complete system.

dr Outer Diameter of Roller

e(t) Static Error

I Motor Current

KD Derivative Coefficient

KI Integral Coefficient

Kp Proportional Coefficient

n Amount of Data Points

nr Available Rotation

r(t) Reference Signal

T Motor Torque

u(t) Control Signal

xi Current Value

xi−n First Measured Value

y(t) Output Signal

z Aforementioned Intermediate Signal

zref Aforementioned Intermediate Reference Signal

F Gripper Force

ls Measurement Interval

Page 15: Get a Grip - DiVA portalkth.diva-portal.org/smash/get/diva2:1373917/FULLTEXT01.pdfPID controllers thought to be sufficient as starting points for further testing of the complete system.

Chapter 1

Introduction

1.1 Background

According to the Gartner Hype Curve for Emerging Technology from 2018 au-tonomous mobile robots are on the rise and are to be expected on the market inabout 5-10 years [1]. Autonomous robots are freely moving and adaptable robotsthat are able to execute tasks in complex environments, without human supervi-sion. The main challenges are to make the robots able to operate even if crucialparameters are unknown [2]. For example, a task asked of a robot in future homescould be to pick up an egg and later a package of milk without cracking one anddropping the other. The force control of the robot grippers will in these cases be ofgreat importance.

Most of the robots used today are found in the industry and are specialized ina certain area, with very specific and predetermined tasks. The grip force in thegripper depends on the known weight of the object that is being manipulated. Aneasy way to do this is by having tactile sensors built in to the grippers to evaluatethe grip force applied by the grippers on the workpiece. However, in industrial envi-ronments it might in some cases be inappropriate to rely on fragile, external sensorsand the grip force can instead be controlled by changing the current through themotor in the gripper [3].

Regardless of the force modulation method, input from an external party, e.g.,a human who knows the weight of the workpiece, will be required to set the forceneeded to grasp the object. This works well in the industry but for future au-tonomous robots they have to manage varying tasks without relying on an externalparty.

1

Page 16: Get a Grip - DiVA portalkth.diva-portal.org/smash/get/diva2:1373917/FULLTEXT01.pdfPID controllers thought to be sufficient as starting points for further testing of the complete system.

CHAPTER 1. INTRODUCTION

1.2 Purpose

In this bachelor’s thesis project a robot gripper, that takes the weight of an objectin to account when lifting it, is built. The purpose of the gripper is to only exertas much force necessary to create the required friction to safely lift, without theweight of the object being set beforehand.

To control the grip force, different force modulation methods can be used. In oneof these methods, the proportionality between the current through the motor andits torque is used to regulate the grip force. It will be examined how consistent andaccurate this relationship is and if it is a suitable method for this project.

In order for the gripper to lift an object with unknown weight the grip force isregulated by using input from a slip sensor which registers if the object is slipping,and then adjusts the grip force accordingly. It will be analyzed which PID controllergives the optimal performance for this application.

To summarize; The main purpose of this project is to answer the following researchquestions:

• How consistent and accurate is the relationship between the torque and themotor current in the gripper?

• Which PID controller gives optimal performance of the system in regards toovershoot, rise time and reaction time?

1.3 Scope

With the given time and budget the main focus of this project is on force modu-lation methods and detection of slip in a robotic gripper. Tactile robotic grippersalready exist and the purpose of this project is not to compete with these in regardsto performance but with simplicity and cost.

A robotic crane will be built to enable a consistent platform for testing the gripper.The crane itself will not be equipped with a sensor for object identification andtherefore the object will be placed at a preset location and a hard coded signal willbe used to initiate gripping phase.

Constraints on the workpiece will be rigid, uniform shape and texture. This leadsto the main unknown parameter being the weight of the object and the coefficientof friction. Since the system uses the input signal from the slip sensor, the unknowncoefficient of friction will not be significant in the regulation of the grip force, whichmakes the construction more robust. The weight interval of the objects tested will

2

Page 17: Get a Grip - DiVA portalkth.diva-portal.org/smash/get/diva2:1373917/FULLTEXT01.pdfPID controllers thought to be sufficient as starting points for further testing of the complete system.

1.4. METHOD

be kept within the range 100 grams to 500 grams since it is considered a suitableinterval for testing due to the components available.

1.4 MethodThe project can be separated into two steps, corresponding to each of the researchquestions.

The first step is to construct the gripper which will be of a simple design withtwo parallel plates moving towards each other. The force modulation method byregulating the current through the motor will be tested using a force sensor embed-ded into one of the claws of the gripper. The grip force will be registered throughthe force sensor for different motor voltages and the test results will be comparedto investigate the accuracy and consistency of the method.

In the second step the weight of the object will be unknown and the gripper willuse the ”trial and error”-concept. By receiving input from the slip sensor the forceis increased if slippage is detected until no slip occurs. The task of determining slipwill be performed by a sensor using a mechanical roller built into one of the clawsin the gripper. During the prehension phase the roller will be in direct contactwith the lifted object. If the roller starts turning when the object is manipulatedupwards the sensor will tell the system that slippage is occurring.A crane to attach the gripper and enable the lifting motion will also be constructed.

3

Page 18: Get a Grip - DiVA portalkth.diva-portal.org/smash/get/diva2:1373917/FULLTEXT01.pdfPID controllers thought to be sufficient as starting points for further testing of the complete system.
Page 19: Get a Grip - DiVA portalkth.diva-portal.org/smash/get/diva2:1373917/FULLTEXT01.pdfPID controllers thought to be sufficient as starting points for further testing of the complete system.

Chapter 2

Theory

2.1 MicrocontrollerThere are currently many different microcontrollers on the market but in generalthey all consist of three main parts; a Central Processing Unit (CPU), Memory andInput/Output (I/O) ports. All of these three parts are connected through buses forinternal system communication. The I/O ports enable communication between themicrocontroller and the external components by collecting and transmitting signals.The CPU is the brain of the circuit and is where the signals are interpreted andprocessed. The memory is where the instructions given by the operator is stored,e.g. what signals to transmit when a certain combination of signals have been col-lected.The performance of the microcontroller is also manly decided by these three com-ponents. The CPU sets the limit for the speed of the system, the memory limitsthe size of the program that can be run on the chip-set and the I/O ports limit thenumber of unique input and output signals that can be managed at the same time[4].

The microcontroller that will be used in this project is an Arduino Uno rev 3 andis shown in Figure 2.1. The Uno rev 3 is based around the ATmega328 micropro-cessor and has a total of 14 digital I/O ports where 6 of these are digital PWMports. The card also has 6 analog ports and 2 power ports, one 3,3V and one 5V,and corresponding ground pins. The controller runs at an internal clockspeed of16MHz and has 35kB of Flash Memory[5].

Figure 2.1. Top down view of the chip-set Arduino Uno rev 3. [5]

5

Page 20: Get a Grip - DiVA portalkth.diva-portal.org/smash/get/diva2:1373917/FULLTEXT01.pdfPID controllers thought to be sufficient as starting points for further testing of the complete system.

CHAPTER 2. THEORY

2.2 Robot GrippersThe gripper is the link between the robot arm and the object that is to be manip-ulated. As robots can be asked to perform different tasks it is required that thegripper is versatile since switching to a new gripper for each of these operations isnot cost effective[6].

There are different methods for prehension and holding an object which suits someobjects better than others, e.g. using needles or vacuum suction. One of the mostcommonly used methods is the impactive method where the gripper consists ofclaws or jaws and the adhesion is obtained merely by the frictional forces betweenthe gripper and the surface of the object.

Impactive grippers can be powered by various drive systems, which gives the grip-per diverse properties, see Figure 2.2 where full circle means advantageous andempty circle means unfavourable [7]. Electric motor powered grippers have severaladvantages [8]:

Figure 2.2. Properties of different drive systems in impactive grippers [7]

• Position control: The range that is needed to pick up objects can easily becontrolled

• Detect grip: Through motor encoders it can be determined when the work-piece is grasped.

• Force control: The current in the electric motor is directly proportional to thetorque the motor applies, which gives the gripper the ability to control theforce that impacts the workpiece.

• Efficiency on power and maintenance: Many companies shift from pneumaticdrives to electric due to the reduced operating cost and energy savings it

6

Page 21: Get a Grip - DiVA portalkth.diva-portal.org/smash/get/diva2:1373917/FULLTEXT01.pdfPID controllers thought to be sufficient as starting points for further testing of the complete system.

2.3. FORCE MODULATION METHODS

provides. Electric motor grippers tend to be cleaner since they do not needany fluids to work, and have no general operation problems like leaks andlosses that might occur when using compressed air.

The lack of fluids in the construction also simplifies the design of the gripper. Mostof the force converters in electromechanical powered grippers are based on spindleor rack and pinion gears, shown in Figure 2.3, where the prime mover usuallyis any form of electrically commutated DC servo motor [7]. Because of all thesefactors electric grippers are getting more common in the industry and are thoughtto become even more frequently occurring in the future.

Figure 2.3. Right: Spindle drive. Left: Rack and pinion drive [7]

2.3 Force Modulation Methods

2.3.1 Motor Current Regulation

When using a DC motor the proportionality between the current and torque canbe used to change the force a gripper is exerting on an object. This relationship isgiven by equation 2.1

T = I · kT (2.1)

where T is the output torque of the DC motor, I is the current through the motorand kT is the torque constant which is specific to the motor. This equation can berepresented by a linear curve where the torque constant is the slope of this curve,shown in Figure 2.4

Figure 2.4. Torque-Current curve for a DC motor [9]

7

Page 22: Get a Grip - DiVA portalkth.diva-portal.org/smash/get/diva2:1373917/FULLTEXT01.pdfPID controllers thought to be sufficient as starting points for further testing of the complete system.

CHAPTER 2. THEORY

With the output torque the force applied by the gripper can be calculated usingthe diameter, dg, of the gear which converts the rotational movement into a linearmotion, according to equation 2.2 [9]

T = F · dg (2.2)

To find the relationship between the current and the exerted force, tests can be doneusing a force senor in the gripper to measure this force at different current inputs.By adding the results into a graph and using a curve fitting method an expressionfor the relationship between the current and the force can be found. This expressioncan later be used to choose the specific current which will make the gripper applythe desired grip force.

However, this force modulation method has in practise some problems when thegripper is used during a long period of time. Due to the thermal changes when themotor temperature increases, parameters in the motor may change and the eval-uated expression might not be applicable. The error can be minimised throughrecalibration [10].

2.3.2 FSR sensorA Force Sensitive Resistor sensor, FSR sensor, works like a resistor where the re-sistance is proportional to the force applied onto the sensor. The resistance can betranslated to force by using a curve such as the one in Figure 2.5.

Figure 2.5. Present resistance due to applied force. Curve in logarithmic scale [11].

To make the applied force more easily controlled when used in a system, the resis-tance of the FSR sensor can be converted to voltage using a voltage divider, seeFigure 2.6. The FSR sensor is connected to a measuring resistor in the circuit andthe output voltage is then given by equation 2.3 [11]

Vout = RMV+(RM +RF SR) (2.3)

8

Page 23: Get a Grip - DiVA portalkth.diva-portal.org/smash/get/diva2:1373917/FULLTEXT01.pdfPID controllers thought to be sufficient as starting points for further testing of the complete system.

2.4. SLIP SENSORS

Figure 2.6. A FSR Voltage Divider [11]

2.4 Slip sensorsThe term slip in relation to robot grippers is used to describe the situation wherethe frictional forces are less than the gravitational force on a lifted object. Thereare many ways to measure and calculate slip rate such as distance measurementsusing ultrasound sensors, cameras, or light emission of different frequencies. Othermethods are relating vibrations created in the gripper during slip to the rate of slipthrough different dielectric membranes. There are also methods using mechanicalrollers built in to the gripper in order to measure object displacement and displace-ment rate [14].

2.4.1 Mechanical rollerThe most common construction for slip measurements using a mechanical roller isshown in Figure 2.7. The construction consists of a hollow roller with internal ballbearings fitted on a leaf spring. The leaf spring is attached to the back of the grippersurface and the roller makes contact with the lifted object through a cut-out in thegripper surface. The leaf spring makes sure that the roller stays in contact with thesurface of the object and also allows the surfaces of the gripper to stay in contactwith the object being lifted. When the object starts to slip, it is detected by thesubsequent rotation of the roller. The rotation is then measured by a potentiometricsensor or a photoelectric sensor through readouts of slits in the roller itself or anextra disk. Effectively this is an angle measurement that in the code together withthe dimension of the hardware will be interpreted as a slip distance [12].

Figure 2.7. Cross sectional view of mechanical roller used in a sensory system formeasuring slip [12]

9

Page 24: Get a Grip - DiVA portalkth.diva-portal.org/smash/get/diva2:1373917/FULLTEXT01.pdfPID controllers thought to be sufficient as starting points for further testing of the complete system.

CHAPTER 2. THEORY

There have been several works done on grippers with slip sensors using similarconstructions as the mechanical roller described above. In these grippers the rollershave also been used as the claws of the grippers, though it restricts the possibilityto have other sensors built into the claw construction [13]-[15]. By taking the rateof the slippage, i.e., the velocity of the rotation of the roller, into account the gripforce can be regulated in one single step. This will reduce the total slip time of theobject compared to incrementally increasing the force until slippage is eliminated[16].

2.5 Control Theory

2.5.1 PID Controller

A Proportional-Integral-Derivative (PID) controller, is a commonly used controllerin feedback systems for industries. The proportional part effects the speed of thesystem but does nothing to decrease static errors in the system. The integral part ofthe controller deals with static error by adding up the previous error of the systemover time through an integrator, but may affect the stability of the system. Thederivative part of the controller tries to improve stability by predicting future errorsof the system. Together these three parts aim to increase speed and stability andwhile decreasing static error. The equation for signal regulation can be seen inequation 2.4 and 2.5.

u(t) = Kpe(t) +KI

∫ t

0e(τ)dτ +KD

d

dte(t) (2.4)

e(t) = r(t) − y(t) (2.5)

In equation 2.4 u(t) is the control signal and e(t) is the static error that consists ofthe differential between the reference signal, r(t), and the output signal, y(t), shownin equation 2.5. The constants Kp, KI and KD are the corresponding coefficientsof the three different parts of the controller, P, I and D[17].

In robotic gripper applications a PID controller can be used to control the forceexerted on an object to achieve lift. The requirement to lift an object is that thegravitational force of the object is equal to the exerted force of the gripper multipliedwith the coefficient of friction [7]. The exerted force can be registered through aforce sensor in the gripper and by using it as the output signal of the system the er-ror can be calculated with equation 2.5, where the required force is the reference[18].This would require that the weight of the object and the coefficient of friction areknown. When working with objects with unknown weights the required force isreplaced with a force that dependents on the input from a slip sensor, which is thenset as the reference in equation 2.5 [13].

10

Page 25: Get a Grip - DiVA portalkth.diva-portal.org/smash/get/diva2:1373917/FULLTEXT01.pdfPID controllers thought to be sufficient as starting points for further testing of the complete system.

2.5. CONTROL THEORY

2.5.2 Cascade Controller

When dealing with two or more systems in series with each other a cascade regulatormight be realisable. The main building block of the regulator is a measurableintermediate signal between the systems. An example of this can be seen in Figure2.8, where z is the aforementioned intermediate signal.

Figure 2.8. Figure of two systems in series with each other [17]. Made in Power-point[19]

The idea is to use a regulator to control z as if it was the input of the system. Thiscan be done using one external feedback loop for calculating the reference signalzref using the output y, and one internal to actually regulate z. This can be seenin Figure 2.9, where the internal loop is inside the dotted box.

Figure 2.9. Figure of a cascade regulated system with the inner feedback loop insidethe dotted box [17]. Made in Powerpoint[19]

One thing to note about cascade regulation is that the performance of the systemas a whole is dependent on the internal feedback loop. The faster the internal loopis the better the system will perform in regards to speed, time delay and stability[17].

2.5.3 Filtering

When handling signals, either analog or digital, the quality is often far from ideal.Signals often contain random variations of different, but often high, frequencies.This leads to the need of filtering the signal before computation to ensure morereliable and less random results. Commonly used filters are averaging filters or lowpass filters.An averaging filter takes several data points in to account and uses the mean ofthese as the signal to be accessed. In computer applications a recursive version of

11

Page 26: Get a Grip - DiVA portalkth.diva-portal.org/smash/get/diva2:1373917/FULLTEXT01.pdfPID controllers thought to be sufficient as starting points for further testing of the complete system.

CHAPTER 2. THEORY

an averaging filter is often used, a moving average filter. The formula for a movingaverage filter is shown in equation 2.6.

xi = xi−1 + 1n

(xi − xi−n) (2.6)

In equation 2.6 xi, and xi−1 are the current and previous average and xi, xi−n andn are the current value, the first measured value and the amount of data points.This method places equal emphasis on each data point and leads to a data pointin the past having the same influence as a current data point. In a system wherethe signal is stable and not trending in any direction this may be desirable, but inmost situations it is not. In this case another moving average filter is more suitable,namely the Exponentially Weighted Moving Average filter (EWMA or EMA). Thegeneral formula for a EWMA filter can be seen in equation 2.7 and is also identicalto the discrete first order low pass filter.

xi = αxi−1 + (1 − α)xi (2.7)

In equation 2.7 xi is still the current average, xi−1 is the previous and xi is thecurrent value. The main differences are the weighting factor α and that there isno longer any need to track the amount of data points. The filter, through α, alsoenables the user to chose how much bias the filtered signal should have towardsprevious measurements, which may be useful when dealing with a noisy signal [20].

12

Page 27: Get a Grip - DiVA portalkth.diva-portal.org/smash/get/diva2:1373917/FULLTEXT01.pdfPID controllers thought to be sufficient as starting points for further testing of the complete system.

Chapter 3

Demonstrator

3.1 Hardware and electronics

3.1.1 CraneThe crane can be seen in Figure 3.1 and consists of a wooden box with four metalrods and one lead screw connected with a flexible coupling to a 12V DC motor. Aplatform which the gripper is attached to moves up and down due to the rotationof the lead screw and a nut in the platform. The wooden top plate and the acrylicframe together with the four rods stabilize the platform during the up and downmotion.

Figure 3.1. Image of the crane and gripper platform. Made in Solid Edge ST10,and rendered in KeyShot [23]

On top off and beneath the gripper platform two micro switches are placed that arepushed down when the platform reaches the top or bottom of the rods. This willmake automation of the platform movement easier.

13

Page 28: Get a Grip - DiVA portalkth.diva-portal.org/smash/get/diva2:1373917/FULLTEXT01.pdfPID controllers thought to be sufficient as starting points for further testing of the complete system.

CHAPTER 3. DEMONSTRATOR

3.1.2 Robot GripperThe gripper, that is presented in Figure 3.2, uses two parallel plates for pickingup objects. The plates are connected through rails on the bottom of the gripperplatform to the racks on top of the platform. The traversal motion of the plates isthen accomplished by using a rack and pinion drive with a DC motor installed onthe top side of the platform.

One of the plates has a rectangular cut-out where the Slip sensor is placed, seeFigure 3.2. The FSR sensor is mounted on the opposite plate and has a rubberdome attached to its active surface to distribute the force evenly over the wholearea. Because of the dome shape a second plate, which can be pushed horizontallytowards the sensor, was put between the sensor and the object to ensure that thedirect contact between the claw and the lifted object is sufficient.

Figure 3.2. Image of the gripper with the two plates attached through the rails inthe gripper platform to the racks on the opposite side. On one of the plates is theSlip sensor mounted and on the other the FSR sensor. Made in Solid Edge ST10 andrendered in KeyShot[23]

3.1.3 Slip sensorThe mechanical roller style Slip sensor can be seen in Figure 3.3. The main struc-ture consists of a plate at the back for attaching the two tension springs, the holderand the roller itself. A potentiometer is fitted into the roller in such a way thatits rotation is locked in with the rotation of the roller. On the opposite side of thepotentiometer is a deep grove ball bearing mounted into the roller, providing freerotation on that side.

The final construction of the Slip sensor ended up using a rotational potentiometerwith approximately 315° of rotation where the rotation was picked up through ananalog port on the Arduino. Together with the roller, with a diameter of 22mm,this enables a measurement interval of around 60mm using equation 3.1.

ls = nr

360°πdr (3.1)

14

Page 29: Get a Grip - DiVA portalkth.diva-portal.org/smash/get/diva2:1373917/FULLTEXT01.pdfPID controllers thought to be sufficient as starting points for further testing of the complete system.

3.1. HARDWARE AND ELECTRONICS

The dr in the equation is the outer diameter of the roller and nr is the availablerotation in degrees.

Figure 3.3. Picture of the Slip sensor with its mounting structure attached. Madein Solid Edge ST10 and rendered in KeyShot[23]

Due to the force requirement for rotation double sided tape had to be attachedonto the surface of the roller to retain the contact between the roller and the liftedobject.

3.1.4 CircuitThe circuitry of the project consists of seven main systems which can be seen inFigure 3.4. The brain of the whole project, the Arduino Uno, can be seen in thetop. It was decided that the Arduino will not get its power from the external 12Vpower supply due to the convenience of it being powered by a Universal Serial Bus(USB) port of a laptop and at the same time enabling easy tuning and monitoring.

Figure 3.4. Figure of the complete circuitry of the project. Created with Fritzing[21]

15

Page 30: Get a Grip - DiVA portalkth.diva-portal.org/smash/get/diva2:1373917/FULLTEXT01.pdfPID controllers thought to be sufficient as starting points for further testing of the complete system.

CHAPTER 3. DEMONSTRATOR

One of the seven systems that is not mentioned previously in Theory is the Liq-uid Crystal Display (LCD) and its control Inter-Integrated Circuit (I2C) module.The theory behind the inner workings of these will not be mentioned due to themnot being an integral part of the project and was simply added just for ease ofdemonstration.

3.1.5 Motor driver

The chosen motor driver for this project was the Adafruit TB6612, shown in Figure3.5, which is mainly used for stepper motors. Given the fact that a stepper motorwas first intended to be used for grip modulation the driver satisfied the require-ments for the intended motor. The driver is suitable for controlling two DC motorsusing Pulse Width Modulation (PWM) and reversing voltage polarity which is whatthe final configuration of the gripper ended up being.

Figure 3.5. Picture of the Adafruit TB6612 motor driver[22]

The driver runs on a 2,7V to 5V logic voltage and has a separated motor voltagesuitable for operation between 4,5V and 13,5V. As previously mentioned the driverhas two channels each suitable for 1,2A of continuous current and peak current at3A for about 20 milliseconds [22].

3.1.6 FSR

The FSR is connected, as previously mentioned in Theory 2.3.2, to a measuringresistor, in this case a 12 kΩ resistor. The measuring resistor is connected to ananalog port on the Arduino which enables a 1024 segmented measuring intervalbetween 0 and 5V for the voltage across the resistor.

3.2 Software

Since the two main inputs for the program on the Get a grip robot are the FSRand the Slip sensor these are also the main focus in the code, that can be found inAppendix B.1. The triggers for changes in motor voltages and the different statesof the program are all controlled by these two sensory inputs. The logic of the codeadheres to the flowchart that can be seen in Figure 3.6.

16

Page 31: Get a Grip - DiVA portalkth.diva-portal.org/smash/get/diva2:1373917/FULLTEXT01.pdfPID controllers thought to be sufficient as starting points for further testing of the complete system.

3.2. SOFTWARE

Figure 3.6. Flowchart of the algorithm for the Get a Grip project. Made indraw.io[24]

3.2.1 Control System

Since the goal of this project is to lift objects with unknown weights it requires asmentioned in Theory 2.5.1 input from a slip sensor to set a force reference valueusing a PID regulator. The force reference regulator takes an analog voltage input,which together with equation 3.1 is used to segment the total voltage input over thetotal available slip distance that is measurable for the sensor. This in turn makes

17

Page 32: Get a Grip - DiVA portalkth.diva-portal.org/smash/get/diva2:1373917/FULLTEXT01.pdfPID controllers thought to be sufficient as starting points for further testing of the complete system.

CHAPTER 3. DEMONSTRATOR

each voltage value equivalent to a certain distance in millimeters. This calculatedvalue is then processed by a low pass filter and subtracted with the previous valueto check if any slippage has occurred since the last run of the main loop. The dif-ference is compared to a reference, set to zero to avoid slip, and then a new forcereference is calculated by the controller.

To achieve the calculated force reference another PID regulator is used to con-trol the exerted force in the gripper, given by the FSR sensor embedded into thegripper. By taking the analog voltage over a 12 kΩ resistance as input and usingequation 2.3 the resistance of the FSR is calculated. Through previous tests, usingset weights to assess how the resistance of the FSR changes under load, a force isextracted. The test results of the FSR calibrations can be seen in Appendix A.1.This force is then compared to the force reference according to equation 2.5 and themotor voltages is adjusted accordingly.

3.2.2 Crane

The software that the crane is operated with works like a basic switch case algorithm.In the initialization phase it runs the platform motor downwards until the bottommicro switch is triggered. It then waits for the exerted force in the gripper to reachthe initial force reference before turning the platform motor on and making theplatform rise.To finish off the lifting sequence it runs the platform motor upwards until the uppermicro switch is triggered and then turns it off. To repeat the sequence the Arduinoreset button is pressed.

3.3 Testing

In this section the tests that were performed on the sensors and the constructionas a whole are presented. These tests aim to answer, or at least partly answer, theresearch questions posed in this report.

3.3.1 Current Regulation

To answer the first research question How consistent and accurate is the relationshipbetween the torque and the motor current in the gripper? a built in FSR sensor wasused to register the applied force in the gripper. The FSR sensor was calibrated bydoing three sets of tests putting known weights of 100-700 grams to examine thecorresponding resistance for each weight. With the average values of the resultsfrom the tests an expression using a curve fitting method was evaluated to obtaina relationship between the force applied and the resistance in the FSR sensor.With the calibrated sensor three test cycles on the current regulation method weremade. In each test cycle the force was set to have values 1-4 N, aiming for equal

18

Page 33: Get a Grip - DiVA portalkth.diva-portal.org/smash/get/diva2:1373917/FULLTEXT01.pdfPID controllers thought to be sufficient as starting points for further testing of the complete system.

3.3. TESTING

force point in each test cycle, and the resulting current was documented. Betweeneach cycle a break of five minutes was taken, so the motor could cool slightly.

3.3.2 Force Reference RegulationTo partly answer the second research question ”Which PID regulator gives optimalperformance of the system in regards to overshoot, rise time and reaction time?”several tests were performed on the Force Reference regulator. These tests aimedto guide the tuning of the force reference regulator that takes input from the slipsensor. The tests consisted of manually rotating the slip sensor 180° as smoothlyas possible aiming for full rotation in about two seconds. The tests were thenperformed using a low pass filter and different P, I and D parameters in equation2.4, where these parameters are the same as the corresponding coefficients. Finallythe resulting force reference value were plotted using Excel [25].

3.3.3 Force RegulationTo partly answer the second research question ”Which PID regulator gives optimalperformance of the system in regards to overshoot, rise time and reaction time?”several tests were performed on the Force regulator. These tests aimed to guide thetuning of the force regulation that takes input from the FSR. The tests consistedof measuring the force displayed by the FSR over time when going from a forcereference of 1 N to 2 N. The test was then performed using different P, I and Dparameters. Finally the results were plotted using Excel [25].

3.3.4 System PerformanceTo answer the second research question ”Which PID regulator gives optimal perfor-mance of the system in regards to overshoot, rise time and reaction time?” tests onthe complete system and lifting sequence were performed. The results of the twoprevious tests on the Force Reference Regulator and the Force Regulator were usedas a starting point when determining the final PID parameters for the completesystem.The tests consisted of lifting a box with different weights and tuning the parametersof the two regulators in order to maximize the lifted weight without exerting moreforce than necessary. The complete sequence of the test can be seen in Figure 3.6and is explained in Demonstrator 3.2.

19

Page 34: Get a Grip - DiVA portalkth.diva-portal.org/smash/get/diva2:1373917/FULLTEXT01.pdfPID controllers thought to be sufficient as starting points for further testing of the complete system.
Page 35: Get a Grip - DiVA portalkth.diva-portal.org/smash/get/diva2:1373917/FULLTEXT01.pdfPID controllers thought to be sufficient as starting points for further testing of the complete system.

Chapter 4

Result

4.1 Current Regulation

The results of the current regulation tests can be seen in Figure 4.1, 4.2, and 4.3.The red lines are the linear fittings of the test data of each test and the exactequation of these can be seen just above the graphs.

Figure 4.1. Graph showing exerted force as a function of motor current. The bluecircles are the measured values from test 1 and the red line is the linear adaptation tothese points. The equation of the linear adaptation is shown above the graph. Madein Matrix Laboratory (Matlab)[26]

21

Page 36: Get a Grip - DiVA portalkth.diva-portal.org/smash/get/diva2:1373917/FULLTEXT01.pdfPID controllers thought to be sufficient as starting points for further testing of the complete system.

CHAPTER 4. RESULT

Figure 4.2. Graph showing exerted force as a function of motor current. The bluecircles are the measured values from test 2 and the red line is the linear adaptation tothese points. The equation of the linear adaptation is shown above the graph. Madein Matlab[26]

Figure 4.3. Graph showing exerted force as a function of motor current. The bluecircles are the measured values from test 3 and the red line is the linear adaptation tothese points. The equation of the linear adaptation is shown above the graph. Madein Matlab[26]

22

Page 37: Get a Grip - DiVA portalkth.diva-portal.org/smash/get/diva2:1373917/FULLTEXT01.pdfPID controllers thought to be sufficient as starting points for further testing of the complete system.

4.2. FORCE REFERENCE REGULATION

4.2 Force Reference Regulation

The results of the force reference testing can be seen in Figure 4.4, Figure 4.5, andin Appendix A.2. The PID parameters seen above the graph in Figure 4.5 are thechosen parameters after testing. A low pass filter was applied to the input signalsince this resulted in a smoother output.A couple of basic tests, with separated control parameters, were performed in orderto get a better understanding of the characteristics of the sensor readings. Thesetests, together with more comparisons between filtered and unfiltered results, canbe found in Appendix A.2.

Figure 4.4. Graph comparing the force reference over time with and without pre-filtering. The blue line is the force reference when using a moving average low passfilter and the orange line is without the filter. Made in Excel[25]

Figure 4.5. Graph of the force reference plotted over time. Made in Excel[25]

23

Page 38: Get a Grip - DiVA portalkth.diva-portal.org/smash/get/diva2:1373917/FULLTEXT01.pdfPID controllers thought to be sufficient as starting points for further testing of the complete system.

CHAPTER 4. RESULT

4.3 Force RegulationThe results of the force regulation testing can be seen in Figure 4.6 , Figure 4.7,Figure 4.8 and Appendix A.3. Figure 4.6 shows how the integral coefficient caneffect stability and Figure 4.7 shows how proportional amplification effects systemstability. The PID parameters shown in Figure 4.8 are the chosen parameters aftertesting.

Figure 4.6. Graph of the exerted force plotted over time. Made in Excel[25]

Figure 4.7. Graph comparing exerted force between different controllers plottedover time. The blue line uses a proportional control coefficient of 60 and the orange70. Made in Excel[25]

Figure 4.8. Graph of the exerted force plotted over time. Made in Excel[25]

24

Page 39: Get a Grip - DiVA portalkth.diva-portal.org/smash/get/diva2:1373917/FULLTEXT01.pdfPID controllers thought to be sufficient as starting points for further testing of the complete system.

4.4. SYSTEM PERFORMANCE

4.4 System PerformanceThe results of the system performance testing can be see in Figure 4.9, Figure 4.10,and Appendix A.4. Figure 4.9 shows how the exerted force in the gripper tracks theforce reference when lifting an object weighing 250 grams. This was the maximumachieved weight lifted during the testing of the complete system.

An object weighing 300 grams was also tested, with results in Figure 4.10, toshow what happens to the exerted force when the motor current of the gripper DCmotor surpassed the maximum allowed current through the motor driver.

Figure 4.9. Graph showing how the exerted force tracks the force reference duringa lift sequence with an object weighing 250 grams. Made in Excel[25]

Figure 4.10. Graph showing how the exerted force tracks the force reference duringa lift sequence with an object weighing 300 grams. Made in Excel[25]

25

Page 40: Get a Grip - DiVA portalkth.diva-portal.org/smash/get/diva2:1373917/FULLTEXT01.pdfPID controllers thought to be sufficient as starting points for further testing of the complete system.
Page 41: Get a Grip - DiVA portalkth.diva-portal.org/smash/get/diva2:1373917/FULLTEXT01.pdfPID controllers thought to be sufficient as starting points for further testing of the complete system.

Chapter 5

Discussion and conclusions

5.1 Discussion

5.1.1 Current Regulation

The results shown in the Current Regulation tests were quite conclusive. Theyshowed that the consistency and accuracy of the motor current is not, at least inthis application, suitable for force regulation. The same exerted force seems torequire different motor current in the different tests. This leads to different curveadaptations and therefore no usable expression for the PID regulator. Even thoughit is not conclusive, since the amount of tests where quite low, there also seems tobe a downward trend on the slope of the curve further into testing. This may bedue to increasing motor temperatures during testing.

There are a couple of conceivable reasons why using motor current as an indicatorfor exerted force might be difficult in our construction.

The first being that the friction in the plate slots, where the two gripper platesslide, is a bit to high or not consistent throughout the whole motion. This could bedue to material choice resulting in a slip stick situation, where the rails stick to theside of the slots and when the motor torque is increased they make a leap beforesticking to the sidewalls again. Different claw layouts might be more suitable whenusing motor current for force modulation.

The second being if the regulation towards the force reference was initiatedabove or below the reference itself. The mechanics of the the gripper seemed tohave an affect on how well the gripper was able to hold and or achieve a certainforce. This may also relate to the inconsistent friction between the slots and railsbrought up earlier.

One realization made during testing was that at around 4 N of exerted force inthe gripper the motor current reached the maximum continues current that the mo-tor driver could handle. This means that in this configuration the maximum forceexerted by the gripper is around 4 N.

27

Page 42: Get a Grip - DiVA portalkth.diva-portal.org/smash/get/diva2:1373917/FULLTEXT01.pdfPID controllers thought to be sufficient as starting points for further testing of the complete system.

CHAPTER 5. DISCUSSION AND CONCLUSIONS

The combined results and realizations of this test was one of the main reasonswhy the following tests, and the project as a whole, used the FSR as input for theForce Regulator.

5.1.2 Force Reference Regulation

The results in the Force Reference Regulation tests showed that there was a needfor prefiltering the signal but also that there were quite a lot of dead spots in themeasurable interval of the potentiometer. This led to the reference regulation beingquite jumpy. It is also worth adding that the way the tests where performed wasprobably not optimal, but the force requirements at different parts of the rotationvaried a lot which limited options regarding testing methods.

As predicted the derivative part of the controller had a negative effect on the forcereference regulation, leading to a very unstable output. The proportional part ofthe controller also had a negative effect on the smoothness of the output, but wasdeemed a necessary trade-off to enable higher reference setting at lower slip distance.Throughout the tests it was observed that a higher relative integral coefficient, com-pared to the proportional coefficient, lead to smoother reference setting.

The regulator shown in Figure 4.5 was deemed a sufficient starting point foroptimisation of the controller.

5.1.3 Force Regulation

The results in the Force Regulation tests were quite straight forward. We were ableto achieve a fast initial response, but struggled to eliminate the static error withouteffecting stability. Since we wanted a controller without overshoot the controllershown in Figure 4.8 was deemed a sufficient starting point for optimisation. Thederivative part of the controller was kept at zero due to issues with overshoot andstability. The integral coefficient also seemed to affect the stability if set too high,though the low value might on the other hand be the reason why the static errorwas hard to eliminate. This might not be a huge problem in regards to performancebecause insufficient grip force will just lead to the reference increasing and the ex-erted force being increased that way.

Worth mentioning is that the FSR was damage during reconstruction of the claw.This led to the resistance at each given load being cut in half. Two tests were per-formed, the two last graphs seen in Appendix A.1, after damaging the sensor andthe FSR seemed to stabilize around a new set of constants. Therefore this shouldnot affect the accuracy in any significant way.

28

Page 43: Get a Grip - DiVA portalkth.diva-portal.org/smash/get/diva2:1373917/FULLTEXT01.pdfPID controllers thought to be sufficient as starting points for further testing of the complete system.

5.2. CONCLUSION

5.1.4 System Performance

The results in the System Performance tests yielded a maximum liftable weight of250 grams using Force Regulator parameters P = 80, I = 3 and D = 0 and theForce Reference Regulator parameters from separate testing, shown in Figure 4.5.

The reason why both the proportional and integral parameters were increasedcompared to the result shown in Result 4.3 was due to initial static error. At thestart of the test when gripping was initialized the motor torque was too low to getthe exerted force close enough to the force reference. This is probably due to thefriction in the rails of the claw discussed in Discussion 5.1.1. Unfortunately thisadjustment led to some instability at the initial parts of gripping, resulting in over-shoot followed by overcompensation, that can be seen in Figure 4.9. It was decidedthat this was a better compromise than allowing a high initial static error since thisled to higher current drawn by the motor and therefore lower lifting capacity. Thestatic error still remained relatively high.

The main limiter of the system seems to be the motor driver and therefore thelimit of the control system is still unknown. Using a driver with higher maximumoperational current would allow for further testing.

5.2 Conclusion

To conclude the results and answer the questions posed:

• Motor current as an input for controlling exerted gripper force in the gripperconfiguration presented in this project is most likely not an accurate or con-sistent method. This being due to the unpredictable friction between the railsand the slots in the gripper and also increasing temperatures in the motor.

• A potentiometer might not be optimal for measuring slip due to the varyingforce needed to turn it at different parts of the rotational interval. It alsohas some deadspots that could lead to the output of the regulator being quitejumpy.

• Filtering the signal from the Slip sensor before using it for computation im-proved smoothness of the output noticeably in testing.

• Both PID regulators exhibit good performance during separate testing andcharacteristics seem to carry over when the two are put together.

• The optimal PID parameters, if the internal friction in the system was lower,are the ones produced in the separate regulator tests. Due to system charac-teristics the slightly higher parameters produced during system performancetesting were deemed necessary.

29

Page 44: Get a Grip - DiVA portalkth.diva-portal.org/smash/get/diva2:1373917/FULLTEXT01.pdfPID controllers thought to be sufficient as starting points for further testing of the complete system.

CHAPTER 5. DISCUSSION AND CONCLUSIONS

It is worth noting that there is no accurate way of knowing that the force exertedin the gripper is the same as the readings from the FSR. Even though calibrationwas performed before testing the condition changes between testing and actual use.In the gripper it is difficult to ensure that the pressure on the sensor is appliedorthogonal on to the sensor.This will probably not affect the performance of the gripper negatively since themain input of the system is whether the object is slipping or not. The only thingaffected is the precision of the force being displayed on screen.

30

Page 45: Get a Grip - DiVA portalkth.diva-portal.org/smash/get/diva2:1373917/FULLTEXT01.pdfPID controllers thought to be sufficient as starting points for further testing of the complete system.

Chapter 6

Recommendations and Future work

One of the main parts that needs improvement in the Get a grip robot is the Slipsensor. Due to lack of availability in some parts of the construction the sensorysystem is not as precise as it could have been.

Firstly the potentiometer requires a bit to much force to rotate. This led tohaving to use double sided tape in order to keep contact between the lifted object andthe roller, which in turn effected the natural slipping sequence. A lower resistanceencoder might be more suitable.

Secondly the springs that where used to help the roller to stay in contact withthe lifted object while, at the same time, enabling the object to make contact withthe gripper surface were a bit to stiff. This resulted in the sensor not fully retractingwhich in our case did not pose a big problem. But if you want to lift more delicateobjects you want the pressure being spread out on as large surface as possible.

One thing that could be investigated in future work is how different gripper ge-ometry and mechanics effect the reliability of using motor current as an indicatorof exerted force in the gripper. A design with less internal friction using pivots andsprockets might give more conclusive results. An external force gauge could also beused to both test the accuracy of the FSR and the motor current method.

Another thing that could be investigated in future work is additional controllersfor both force reference regulation and force regulation. The force reference regula-tor could, for example, have an extra set of control parameters used when the slipspeed is high in order to quickly increase the reference fed to the force regulator.The force regulator could have an extra set of control parameter for situations whenthe exerted force is further away from the reference, but also one when the exertedforce is higher than the reference in order to safely decrease the force.Instead of using PID regulators fuzzy controllers could also be investigated for usein this application. A multifinger gripper setup investigated by three researchers atInternational Islamic University Malaysia might be a good starting point for furtherwork [13].

31

Page 46: Get a Grip - DiVA portalkth.diva-portal.org/smash/get/diva2:1373917/FULLTEXT01.pdfPID controllers thought to be sufficient as starting points for further testing of the complete system.

CHAPTER 6. RECOMMENDATIONS AND FUTURE WORK

Lastly a setup with the same sensory combination would be interesting to see ineither a robotic prosthetic arm or just mounted to an industrial multipurpose robotarm.

32

Page 47: Get a Grip - DiVA portalkth.diva-portal.org/smash/get/diva2:1373917/FULLTEXT01.pdfPID controllers thought to be sufficient as starting points for further testing of the complete system.

Bibliography

[1] Kasey Panetta, ”5 Trends Emerge in the Gartner Hype Cycle for Emerg-ing Technologies 2018,” Gartner, Aug. 16, 2018. [Online] Retrievedfrom: https://www.gartner.com/smarterwithgartner/5-trends-emerge-in-gartner-hype-cycle-for-emerging-technologies-2018/ [Accessed 2019-03-25]

[2] Mattias Wahde, ”Introduction to Autonomous Robots,”Department of Applied Mechanics, Chalmers Univer-sity of Techonlogy, Goteborg, Sweden, 2016. [Online] Re-trieved from: http://www.me.chalmers.se/ mwahde/cours-es/aa/2016/FFR125 LectureNotes.pdf [Accessed 2019-04-27]

[3] Nicolas Lauzier, ”Robot Gripper Force Control,”blog.robotiq.com, Feb. 21, 2014. [Online] Retrieved from:https://blog.robotiq.com/bid/53319/Robot-Gripper-Force-Control,[Accessed 2019-03-26]

[4] Y. Bai, Practical Microcontroller Engineering with ARM Tech-nology, Hoboken, New Jersey: John Wiley & Sons, Inc.,2016. [Online] Retrieved from: https://onlinelibrary-wiley-com.focus.lib.kth.se/doi/10.1002/9781119058397.ch01# [Accessed2019-02-13]

[5] Arduino. Arduino Uno, 2018. [Online] Retrieved from:https://store.arduino.cc/arduino-uno-rev3 [Accessed 2019-02-13]

[6] Machine Building.Free Guide: How to select theright robot gripper, 2015. [Online] Retrieved from:http://www.machinebuilding.net/ta/t0669.htm [Accessed 2019-02-13]

[7] G. J. Monkman, S. Hesse, R. Steinmann and H. Schunk RobotGrippers, Weinheim: WILEY-VCH Verlag GmbH & Co. KGaA,2007. [Online] Retrieved from: https://www-emeraldinsight-com.focus.lib.kth.se/doi/full/10.1108/aa.2009.03329aae.001 [Accessed2019-01-28]

33

Page 48: Get a Grip - DiVA portalkth.diva-portal.org/smash/get/diva2:1373917/FULLTEXT01.pdfPID controllers thought to be sufficient as starting points for further testing of the complete system.

BIBLIOGRAPHY

[8] Robotiq, ”How To Choose The Right End Effec-tor For Your,” Robotiq. [Online] Retrieved from:http://www.academia.edu/27264795/How To Choose The Right End Effector For Your Application[Accessed 2019-01-20]

[9] Danielle Collins, ”FAQ: What’s the relationship between current andDC motor output torque?”, motioncontroltips.com, Dec. 23, 2015.[Online] Retrieved from: https://www.motioncontroltips.com/faq-whats-the-relationship-between-current-and-dc-motor-output-torque/[Accessed 2019-03-25]

[10] J.D Tedford, ”Design of a Robot Gripper with Force Feed-back Control,” Mechatronics, Vol.1(3), Issue: 3, pp.311-319,1991. [Online] Retrieved from: https://www-sciencedirect-com.focus.lib.kth.se/science/article/pii/0957415891900175 [Accessed2019-03-21]

[11] Interlink Electronics, ”Interlink Electronics FSR Force Sens-ing Resistors,” Interlink Electronics. [Online] Retrieved from:https://www.generationrobots.com/media/FSR400-Series-Integration-Guide.pdf [Accessed 2019-03-29]

[12] Ryosuke Masuda, Kensuke Hasegawa and Wei-Ting Gong, ”A designapproach to total sensory robot control,” Sensor Review, Vol.2, Issue:1,pp.20-24, 1982. [Online] Retrieved from: https://www-emeraldinsight-com.focus.lib.kth.se/doi/pdfplus/10.1108/eb007561 [Accessed 2019-01-29]

[13] Momoh-Jimoh E.Salami, Nazim Mir-Nassiri and Shahrul Naim Sidek,”Design of Intelligent Multifiger Gripper for a Robotic ARM Us-ing a DSP-Based Fuzzy Controller,” 2000 TENCON Proceedings. In-telligent Systems and Technologies for the New Millennium (Cat.No.00CH37119), Vol.3, pp.348-353 vol.3, 2000. [Online] Retrieved from:https://ieeexplore-ieee-org.focus.lib.kth.se/document/892287 [Accessed2019-02-12]

[14] Pavel Dzitac, Abdul Md Mazid, M. Yousef Ibrahim, Gayan Ka-handawa Appuhamillage and T.A Choudhury, ”Friction-based SlipDetection in Robotic Grasping,” IECON 2015 - 41st Annual Con-ference of the IEEE Industrial Electronics Society, pp.004871-004874, Nov. 2015. [Online] Retrieved from: https://ieeexplore-ieee-org.focus.lib.kth.se/document/7392863 [Accessed 2019-03-21]

[15] Pavel Dzitac and Abdul Md Mazid, ”A method to control grip forceand slippage for robotic object grasping and manipulation”, 201220th Mediterranean Conference on Control & Automation (MED),

34

Page 49: Get a Grip - DiVA portalkth.diva-portal.org/smash/get/diva2:1373917/FULLTEXT01.pdfPID controllers thought to be sufficient as starting points for further testing of the complete system.

BIBLIOGRAPHY

pp.116-121, July. 2012. [Online] Retrieved from: https://ieeexplore-ieee-org.focus.lib.kth.se/document/6265624 [Accessed 2019-03-21]

[16] Pavel Dzitac, Abdul Md Mazid, M. Yousef Ibrahim, Tanveer Choud-hury and Gayan Kahandawa Appuhamillage, ”Optimum Grasp Forceand Resistance to Slippage”, 2017 IEEE International Conferenceon Mechatronics (ICM), pp.297-302, Feb. 2017. [Online] Retrievedfrom: https://ieeexplore-ieee-org.focus.lib.kth.se/document/7921120[Accessed 2019-03-21]

[17] T. Glad and L. Ljung, Reglerteknik: Grundlaggande teori, 4th ed, Stu-dentlitteratur, 2006.

[18] Anan Suebsomran, ”Development of Robot Gripper and ForceControl,” 2018 13th World Congress on Intelligent Control andAutomation (WCICA), pp.433-437, July. 2018. [Online] Retrievedfrom: https://ieeexplore-ieee-org.focus.lib.kth.se/document/8630437[Accessed 2019-03-21] bibitemPowerpoint

[19] Powerpoint, (2018), Microsoft. [Software]. Available:https://products.office.com/sv-se/powerpoint

[20] Newcastle University. Dealing with mea-surement noise. [Online] Retrieved from:https://web.archive.org/web/20100214160523/http://lorien.ncl.ac.uk/ming/filter/filter.htm[Accessed 2019-04-15]

[21] Fritzing, (2016), Fritzing. [Online Software]. Available:http://fritzing.org/home/

[22] lady ada, ”Adafruit TB6612 1.2A DC/Stepper Motor Driver Break-out Board,” learn.adafruit.com, May. 01, 2019. [Online] Retrievedfrom: https://learn.adafruit.com/adafruit-tb6612-h-bridge-dc-stepper-motor-driver-breakout [Accessed 2019-03-11]

[23] Solid Edge ST10, (2019), Siemens. [Software]. Available:https://solidedge.siemens.com/en/

[24] draw, JGraph Ltd. [Online Software]. Available: https://www.draw.io/

[25] Excel, (2018), Microsoft. [Software]. Available:https://products.office.com/sv-se/excel

[26] MATLAB, (2016a), MathWorks. [Software]. Available:https://se.mathworks.com/?s tid=gn logo

35

Page 50: Get a Grip - DiVA portalkth.diva-portal.org/smash/get/diva2:1373917/FULLTEXT01.pdfPID controllers thought to be sufficient as starting points for further testing of the complete system.
Page 51: Get a Grip - DiVA portalkth.diva-portal.org/smash/get/diva2:1373917/FULLTEXT01.pdfPID controllers thought to be sufficient as starting points for further testing of the complete system.

Appendix A

Test Results

A.1 FSR Calibration

Figure A.1. Graph of the resistance in the FSR plotted over the applied force. Theblue circles are the values in resistance taken over three separate tests and the redline is the curve adaptation. Tests performed 2019-04-04. Made in Matlab[26]

37

Page 52: Get a Grip - DiVA portalkth.diva-portal.org/smash/get/diva2:1373917/FULLTEXT01.pdfPID controllers thought to be sufficient as starting points for further testing of the complete system.

APPENDIX A. TEST RESULTS

Figure A.2. Graph of the resistance in the FSR plotted over the applied force. Theblue circles are the average values in resistance taken over three separate tests andthe red line is the curve adaptation. Tests performed 2019-04-22. Made in Matlab[26]

Figure A.3. Graph of the resistance in the FSR plotted over the applied force. Theblue circles are the average values in resistance taken over three separate tests andthe red line is the curve adaptation. Tests performed 2019-04-29. Made in Matlab[26]

38

Page 53: Get a Grip - DiVA portalkth.diva-portal.org/smash/get/diva2:1373917/FULLTEXT01.pdfPID controllers thought to be sufficient as starting points for further testing of the complete system.

A.2. FORCE REFERENCE REGULATION

A.2 Force Reference Regulation

Figure A.4. Graph of the force reference over time using only a proportional regu-lator and no prefiltering. Made in Excel[25]

Figure A.5. Graph of the force reference over time using only a integral regulatorand no prefiltering. Made in Excel[25]

Figure A.6. Graph of the force reference over time using only a derivative regulatorand no prefiltering. Made in Excel[25]

39

Page 54: Get a Grip - DiVA portalkth.diva-portal.org/smash/get/diva2:1373917/FULLTEXT01.pdfPID controllers thought to be sufficient as starting points for further testing of the complete system.

APPENDIX A. TEST RESULTS

Figure A.7. Graph of the force reference over time using only a proportional regu-lator and a EMWA with α = 0, 2. Made in Excel[25]

Figure A.8. Graph of the force reference over time using only a integral regulatorand a EMWA with α = 0, 2. Made in Excel[25]

Figure A.9. Graph of the force reference over time using only a derivative regulatorand a EMWA with α = 0, 2. Made in Excel[25]

40

Page 55: Get a Grip - DiVA portalkth.diva-portal.org/smash/get/diva2:1373917/FULLTEXT01.pdfPID controllers thought to be sufficient as starting points for further testing of the complete system.

A.2. FORCE REFERENCE REGULATION

Figure A.10. Graph of the force reference over time using a proportional integralregulator and a EMWA with α = 0, 2. Made in Excel[25]

Figure A.11. Graph of the force reference over time using a integral derivativeregulator and a EMWA with α = 0, 2. Made in Excel[25]

Figure A.12. Graph of the force reference over time using a proportional integralderivative regulator and a EMWA with α = 0, 2. Made in Excel[25]

41

Page 56: Get a Grip - DiVA portalkth.diva-portal.org/smash/get/diva2:1373917/FULLTEXT01.pdfPID controllers thought to be sufficient as starting points for further testing of the complete system.

APPENDIX A. TEST RESULTS

A.3 Force Regulation

Figure A.13. Graph of the exerted force over time using a proportional regulator.Made in Excel[25]

Figure A.14. Graph of the exerted force over time using a proportional integralregulator. Made in Excel[25]

Figure A.15. Graph of the exerted force over time using a proportional integralregulator. Made in Excel[25]

42

Page 57: Get a Grip - DiVA portalkth.diva-portal.org/smash/get/diva2:1373917/FULLTEXT01.pdfPID controllers thought to be sufficient as starting points for further testing of the complete system.

A.3. FORCE REGULATION

Figure A.16. Graph of the exerted force over time using a proportional integralderivative regulator. Made in Excel[25]

Figure A.17. Graph of the exerted force over time using a proportional integralderivative regulator. Made in Excel[25]

Figure A.18. Graph of the exerted force over time using a proportional integralregulator. Made in Excel[25]

43

Page 58: Get a Grip - DiVA portalkth.diva-portal.org/smash/get/diva2:1373917/FULLTEXT01.pdfPID controllers thought to be sufficient as starting points for further testing of the complete system.

APPENDIX A. TEST RESULTS

Figure A.19. Graph of the exerted force over time using a proportional integralregulator. Made in Excel[25]

Figure A.20. Graph of the exerted force over time using a proportional integralregulator. Made in Excel[25]

Figure A.21. Graph of the exerted force over time using a proportional integralderivative regulator. Made in Excel[25]

44

Page 59: Get a Grip - DiVA portalkth.diva-portal.org/smash/get/diva2:1373917/FULLTEXT01.pdfPID controllers thought to be sufficient as starting points for further testing of the complete system.

A.4. SYSTEM PERFORMANCE

Figure A.22. Graph of the exerted force over time using a proportional integralregulator. Made in Excel[25]

Figure A.23. Graph of the exerted force over time using a proportional integralderivative regulator. Made in Excel[25]

A.4 System Performance

Figure A.24. Graph showing how the exerted force tracks the force reference duringa lift sequence with an object weighing 100 grams. Made in Excel[25]

45

Page 60: Get a Grip - DiVA portalkth.diva-portal.org/smash/get/diva2:1373917/FULLTEXT01.pdfPID controllers thought to be sufficient as starting points for further testing of the complete system.

APPENDIX A. TEST RESULTS

Figure A.25. Graph showing how the exerted force tracks the force reference duringa lift sequence with an object weighing 150 grams. Made in Excel[25]

Figure A.26. Graph showing how the exerted force tracks the force reference duringa lift sequence with an object weighing 200 grams. Made in Excel[25]

46

Page 61: Get a Grip - DiVA portalkth.diva-portal.org/smash/get/diva2:1373917/FULLTEXT01.pdfPID controllers thought to be sufficient as starting points for further testing of the complete system.

Appendix B

Code

B.1 Arduino Code

// Main program for Get a grip// Bachelor’s Thesis in Mechatronics, KTH// Martin Granlf & Ellen Andersson// 2019-05-15

//For PID regulator#include <PID_v1.h>//For I2C#include <Wire.h>//For LCD#include <LCD.h>#include <LiquidCrystal_I2C.h>

// Setup for LCDLiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7);

// Setup for FSR sensorint FSRpin = 0;int FSRread;int FSRvolt;double FSRvoltconv;double FSRforce;double resist1=12000; //Resistance in ohmdouble Vcc=5; //Logic voltage on arduino

// Setup DC motor

47

Page 62: Get a Grip - DiVA portalkth.diva-portal.org/smash/get/diva2:1373917/FULLTEXT01.pdfPID controllers thought to be sufficient as starting points for further testing of the complete system.

APPENDIX B. CODE

int DCforwardpin = 13;int DCbackwardpin = 12;int DCPWMpin = 11;int DCPWM;

// Setup slip sensorint Slippin = 1;int Slipread;double Slipreadconv;double Sliplen1;double Sliplen2;double Slipdif;int n=2;

//Setup platform motorint Platformuppin = 8;int Platformdownpin = 9;int PlatformPWMpin = 10;int PlatformPWM;

//Setup micro switchesint micropin1 = 7;int micropin2 = 6;int microval1;int microval2;

// Setup for force PID regulatordouble Setpoint, Input, Output1;double aggP=80, aggI=3, aggD=0; //agressive PID parametersdouble consP=70, consI=2, consD=0; //conservative PID parametersdouble backP=30, backI=2, backD=0; //backing PID parameters//initial state and parametersPID thePID(&Input, &Output1, &Setpoint, consP, consI, consD, DIRECT);

// Setup for the slip PID regulatordouble SetpointS, InputS, OutputS;double SlipP=25, SlipI=100, SlipD=0; //PID parameters slip//initial state and parametersPID SlipPID(&InputS, &OutputS, &SetpointS, SlipP, SlipI, SlipD, DIRECT);

//Setup for Low pass filterfloat EMA_S = 0; //Start value for filterfloat EMA_A = 0.2; //Weighting factor

48

Page 63: Get a Grip - DiVA portalkth.diva-portal.org/smash/get/diva2:1373917/FULLTEXT01.pdfPID controllers thought to be sufficient as starting points for further testing of the complete system.

B.1. ARDUINO CODE

void setup() Serial.begin(9600);//Initializing the DC pinspinMode(DCforwardpin, OUTPUT);pinMode(DCbackwardpin, OUTPUT);pinMode(DCPWMpin, OUTPUT);

//Initializing the platform pinspinMode(Platformuppin, OUTPUT);pinMode(Platformdownpin, OUTPUT);pinMode(PlatformPWMpin, OUTPUT);

//Starting the force PID regulatorfloat maxoutput=6 ; //Max output allowed to the DC motorthePID.SetMode(AUTOMATIC);//Limiting the output of the force regulator to 6VthePID.SetOutputLimits(0, 255*maxoutput/12);Setpoint = 1.0; //Initial force reference, before any slip, in Newton

//Starting the slip PID regulatorSlipPID.SetMode(AUTOMATIC);//Limiting the minimal output so it doesn’t go below the initial SetpointSlipPID.SetOutputLimits((Setpoint*255/8), 255);SetpointS = 0;

// Starting the Slip sensorSlipread = analogRead(Slippin); //Reading the slip sensor for an initial value//Converting the analog value to a relatable value for the geometri of the rollerSlipreadconv = map(Slipread, 0, 1023, 0, 6500);Sliplen2 = Slipreadconv/100; //Converting to a distance in mmEMA_S = Sliplen2; //Initial value for the low pass filter

// Starting the LCDlcd.begin (16, 2); //16x2 LCD modulelcd.setBacklightPin(3, POSITIVE); //Setup for the backlight on the LCDlcd.setBacklight(HIGH); //Turning on the backlightlcd.clear(); //Clearing the LCD screen

//Putting platform in start position

49

Page 64: Get a Grip - DiVA portalkth.diva-portal.org/smash/get/diva2:1373917/FULLTEXT01.pdfPID controllers thought to be sufficient as starting points for further testing of the complete system.

APPENDIX B. CODE

digitalWrite(Platformuppin, LOW);digitalWrite(Platformdownpin, HIGH);analogWrite(PlatformPWMpin, 255);

void loop()

while (digitalRead(micropin1)==HIGH && digitalRead(Platformdownpin)==HIGH)lcd.clear();lcd.print("Goingtohome");delay(100);

if (digitalRead(micropin1) == LOW && digitalRead(Platformdownpin) == HIGH)digitalWrite(Platformdownpin, LOW);digitalWrite(Platformuppin, LOW);analogWrite(PlatformPWMpin, 0);

Slipread = analogRead(Slippin); //Reading the slip sensorSlipreadconv = map(Slipread, 0, 1023, 0, 6500); //Analog value convertionSliplen1 = Slipreadconv/100; //Value convertion to mmEMA_S = EMA_A*Sliplen1 + (1-EMA_A)*EMA_S; //Low pass or EMWA filterSlipdif = (EMA_S-Sliplen2); //Calculating the inputInputS=Slipdif; //Giving input to the slip regulatorSliplen2=EMA_S;if (n=2)

SlipPID.SetControllerDirection(REVERSE); //Direction of the regulatorSlipPID.SetTunings(SlipP, SlipI, SlipD); //Giving parameters to the regulatorSlipPID.Compute(); //Calculating the output//Converting output to refrence for force regulatorSetpoint=8*float(OutputS)/255;//Printing values to the LCDdelay(25);lcd.clear();

50

Page 65: Get a Grip - DiVA portalkth.diva-portal.org/smash/get/diva2:1373917/FULLTEXT01.pdfPID controllers thought to be sufficient as starting points for further testing of the complete system.

B.1. ARDUINO CODE

lcd.setCursor(0,0);lcd.print("Setpoint:");lcd.print(Setpoint);lcd.setCursor(0,1);lcd.print("FSRforce:");lcd.print(FSRforce);n=0;

FSRread = analogRead(FSRpin); //Reading the FSR sensorFSRvolt=map(FSRread, 0, 1023, 0, 5000); //Converting analog voltage to milivoltFSRvoltconv=double(FSRvolt)/1000; //Converting to volt//Calculating the exerted forceFSRforce=pow((7484.58)/((Vcc*resist1/FSRvoltconv)-resist1), (1/0.8319));Input=FSRforce; //Giving input to the force regulator

double error = Setpoint-Input; //Checking how far input is from wanted value

//Checking platform positionmicroval1=digitalRead(micropin1);microval2=digitalRead(micropin2);

//if platform is in low positionif (abs(error)<0.1 && microval1 == LOW && digitalRead(Platformuppin)==LOW)

digitalWrite(Platformdownpin, LOW);digitalWrite(Platformuppin, HIGH);analogWrite(PlatformPWMpin, 255);

//if platform is in high positionelse if (microval2 == LOW && digitalRead(Platformuppin) == HIGH)digitalWrite(Platformdownpin, LOW);digitalWrite(Platformuppin, LOW);analogWrite(PlatformPWMpin, 0);

51

Page 66: Get a Grip - DiVA portalkth.diva-portal.org/smash/get/diva2:1373917/FULLTEXT01.pdfPID controllers thought to be sufficient as starting points for further testing of the complete system.

APPENDIX B. CODE

if (error>0) //If the exerted force is less than what is wantedthePID.SetControllerDirection(DIRECT);if (error<0.2) //If the exerted force close to wanted force

thePID.SetTunings(aggP, aggI, aggD); //Changing the PID parameterselse //If the exerted force far from the wanted force

thePID.SetTunings(aggP, aggI, aggD); //Changing the PID parameters

else //If the exerted force is more than what is wantedthePID.SetControllerDirection(DIRECT);thePID.SetTunings(aggP, aggI, aggD); //Changing the PID parameters

thePID.Compute(); //Calculating output for force regulationdigitalWrite(DCbackwardpin, LOW); //Seting the direction to close the clawdigitalWrite(DCforwardpin, HIGH); //Seting the direction to close the clawanalogWrite(DCPWMpin, int(Output1)); //Giving the motor the new output

n=n+1;

52

Page 67: Get a Grip - DiVA portalkth.diva-portal.org/smash/get/diva2:1373917/FULLTEXT01.pdfPID controllers thought to be sufficient as starting points for further testing of the complete system.

TRITA ITM-EX 2019:21

www.kth.se


Recommended