2d pick and place robot
TRANSCRIPT
-
7/25/2019 2D Pick and Place Robot
1/41
Project prepared at ITEC and supervised by Eng. Carlos Bou-Gerges
Order No: II2/13/01
2012 / 2013
FINAL YEAR PROJECT
Submitted in fulfillment of the requirements for the
ENGINEERING DEGREE FROM THE LEBANESE UNIVERSITY BRANCH
III
Major : Electrical Engineering in Industrial Control
By :
Ali Ahmad El Souki
______________________________________________
Title
2D Pick & Place Robot
Advisor: Dr. Noureddine Alameh
Defended on June 17, 2013 in front of the jury:
Mr. Zouheir El-Hajj PresidentMr. Hussein El-Amine Member
Mr. Noureddine Alame
Mr. Carlos Bou Gerges
Member
Invited member
-
7/25/2019 2D Pick and Place Robot
2/41
2
DEDICATION
I dedicate this project to my family, especially.
To the Soul of my Grandparents
To my Parents whose love and care made me the person that I am today.
To my Brother & Sister who never left my side.
To my Soul mate.
-
7/25/2019 2D Pick and Place Robot
3/41
3
ACKNOWLEDGEMENTS
Thanks to GOD for every blessing he gave us
I would like to thank the Faculty of Engineering for hosting me for five years.Special thanks to the principal of the Faculty Dr. Mohammad HAMDAN and chief
department Dr. Zouheir EL-HAJJ for their efforts and valuable teaching system.
My deepest appreciations go to Dr.Noureddine ALAME for his time, effort and
advice as a supervisor and academic professor.
I would like to thank Mr.Jad WEHBE general manager of ITEC , Eng. Carlos Bou-
GERGES and all people in ITEC for their help and support in all stages of my project.
Finally, I thank everyone who participated in making this work achievable, hoping
that this project will be an important step into a successful career.
-
7/25/2019 2D Pick and Place Robot
4/41
4
Abstract
Commercial and industrial robots are now in widespread use performing jobs more
cheaply or with greater accuracy and reliability than humans. They are also
employed for jobs which are too dirty, dangerous or dull to be suitable for humans.
Robots are widely used in manufacturing, assembly and packing, transport, earth
and space exploration, surgery, weaponry, laboratory research, and mass
production of consumer and industrial goods.
ITEC (Industrial Technologies Company) proposed a 2D Pick & Place industrial robot
project using BECKHOFFautomation products in order to prove the high
performance of the hardware (Servo Drive) and software combination: PC-based
control technology from Beckhoff is ideally suited for single and multiple axis
positioning tasks with highly dynamic requirements .Even though one controller
can execute motion control in parallel with many other complicated automationprocesses.
-
7/25/2019 2D Pick and Place Robot
5/41
5
Table of Contents
Table of Contents ........................................................................................................ 5
Chapter I : Introduction .......................................................................................... 8
Project description: ...................................................................................... 8I.1-
About ITEC: ................................................................................................... 9I.2-
Chapter II : The Hardware .................................................................................. 10
Synchronous Servomotor AM3112-0400-0001............................................ 10
a) Appropriate use: ......................................................................................... 10
b) Product identification:................................................................................. 10
c) Technical description of the motor: ........................................................... 11
The Servo drives EL7201: ............................................................................ 12II.2-
a) Introduction: ............................................................................................... 12
b) Technology: ................................................................................................ 13
The Controller CX-1020: ............................................................................. 13II.3-
a) About the controller ................................................................................... 13
b) Remote programming via Ethernet............................................................ 14
Principle of operation of the servomotor: ................................................. 14II.4-
a) Definition: ................................................................................................... 14
b) The Magnet: ............................................................................................... 15c) Principle of operation: ................................................................................ 15
The Electromagnet: .................................................................................... 17II.5-
The mechanical system: ............................................................................. 17II.6-
Chapter III : The Software ................................................................................... 18
BeckHoff-TwinCAT: ..................................................................................... 18III.1-
a) Generalities about TwinCAT ....................................................................... 18
b) TwinCAT NCI (numerical control interpolation): ........................................ 19
Creation of the project function blocks: .................................................... 19III.2-
a) MoveToPos Function block:.................................................................... 19
b) Trigger function block:............................................................................ 21
c) CamData function block:......................................................................... 22
d) Reset function block: .................................................................................. 27
-
7/25/2019 2D Pick and Place Robot
6/41
6
e) ComparePos function block: ...................................................................... 27
The Software: ............................................................................................. 28III.3-
a) Latch Program:........................................................................................ 29
b) AxesPower Program:............................................................................... 30
c) The Cycle Program:................................................................................. 31
d) TorqueLim Program: ................................................................................... 38
Chapter IV : Conclusion ....................................................................................... 39
Achieved Objectives:............................................................................... 39IV.1-
Forecast objectives ................................................................................. 39IV.2-
Interesting Statistics: .............................................................................. 39IV.3-
References: ............................................................................................. 40IV.4-
APPENDIX ................................................................................................ 40IV.5-
-
7/25/2019 2D Pick and Place Robot
7/41
7
List of FiguresFigure 1: Sketch of the project .................................................................................... 8
Figure 2 : BeckHoff Servomotor ................................................................................ 10
Figure 3 : Motor's nameplate elemnts definition ..................................................... 10Figure 4 : Motor's nameplate .................................................................................... 11
Figure 5 : EL7201 connection diagram with the motor ............................................ 12
Figure 6: Servo Drive operation principle ................................................................. 13
Figure 7 : Principle and construction of a brushless Servo motor ............................ 15
Figure 8 : waveform for sinusoidal EMF style and square wave servo drives .......... 16
Figure 9 : Oubari's logo ............................................................................................. 17
Figure 10 : An instance of MoveToPos FB called GoHome ....................................... 20
Figure 11 : NciFeedTablePreparation FB ................................................................... 20
Figure 12: NCIFeedTable FB ...................................................................................... 21
Figure 13 :An instance of Trigger FB Called Trig ....................................................... 21
Figure 14: Ladder diagram Trigger ............................................................................ 22
Figure 15: An instance of FB CamData called CamOutput ........................................ 22
Figure 16: SFC of the CamData FB............................................................................. 23
Figure 17: Trigger step .............................................................................................. 24
Figure 18: Scrreshot of the TCP/IP data using Hyperterminal .................................. 24
Figure 19 : Screenshot of the received array of bytes .............................................. 25
Figure 20 : Summary of all respected conditions in analyzing data ......................... 26
Figure 21 : Analyze step of the CamData FB ............................................................. 26
Figure 22 : An instance of the MC_Reset FB ............................................................. 27
Figure 23 : An instance of the RESET FB.................................................................... 27
Figure 24 : An instance of the ComaprePos FB ......................................................... 27Figure 25 : ComparePos process, Units in degrees ................................................... 28
Figure 26 : Screenshot of the MAIN program ........................................................... 28
Figure 27: Ladder diagram of the Latch Program ..................................................... 29
Figure 28 : MC_POWER FB ........................................................................................ 30
Figure 29: CfgBuild3DGroup FB ................................................................................. 30
Figure 30 : Operation principle of the "AxesPower" program .................................. 31
Figure 31 : Grafcet of the "Cycle" program ............................................................... 32
Figure 32 : The Camera Step ..................................................................................... 33
Figure 33 : Ladder diagram of the "Pick" step .......................................................... 34
Figure 34 :Sketch of the axes and the throwing positions ........................................ 35
Figure 35 : Throwing positions according to item's numbers ................................... 36
Figure 36 :"Throw"step diagram .............................................................................. 37
Figure 37 : Project Schedule...................................................................................... 39
Figure 38 : image of theelectrical panel.................................................................... 40
Figure 39 : image of the project in "Project LEbanon 2013" BIEL ............................. 41
http://c/Users/ALI/Desktop/FYP/Documentation/Report/Toula.docx%23_Toc358655769http://c/Users/ALI/Desktop/FYP/Documentation/Report/Toula.docx%23_Toc358655769http://c/Users/ALI/Desktop/FYP/Documentation/Report/Toula.docx%23_Toc358655771http://c/Users/ALI/Desktop/FYP/Documentation/Report/Toula.docx%23_Toc358655771http://c/Users/ALI/Desktop/FYP/Documentation/Report/Toula.docx%23_Toc358655773http://c/Users/ALI/Desktop/FYP/Documentation/Report/Toula.docx%23_Toc358655773http://c/Users/ALI/Desktop/FYP/Documentation/Report/Toula.docx%23_Toc358655774http://c/Users/ALI/Desktop/FYP/Documentation/Report/Toula.docx%23_Toc358655774http://c/Users/ALI/Desktop/FYP/Documentation/Report/Toula.docx%23_Toc358655775http://c/Users/ALI/Desktop/FYP/Documentation/Report/Toula.docx%23_Toc358655775http://c/Users/ALI/Desktop/FYP/Documentation/Report/Toula.docx%23_Toc358655776http://c/Users/ALI/Desktop/FYP/Documentation/Report/Toula.docx%23_Toc358655776http://c/Users/ALI/Desktop/FYP/Documentation/Report/Toula.docx%23_Toc358655777http://c/Users/ALI/Desktop/FYP/Documentation/Report/Toula.docx%23_Toc358655777http://c/Users/ALI/Desktop/FYP/Documentation/Report/Toula.docx%23_Toc358655778http://c/Users/ALI/Desktop/FYP/Documentation/Report/Toula.docx%23_Toc358655778http://c/Users/ALI/Desktop/FYP/Documentation/Report/Toula.docx%23_Toc358655779http://c/Users/ALI/Desktop/FYP/Documentation/Report/Toula.docx%23_Toc358655779http://c/Users/ALI/Desktop/FYP/Documentation/Report/Toula.docx%23_Toc358655780http://c/Users/ALI/Desktop/FYP/Documentation/Report/Toula.docx%23_Toc358655780http://c/Users/ALI/Desktop/FYP/Documentation/Report/Toula.docx%23_Toc358655781http://c/Users/ALI/Desktop/FYP/Documentation/Report/Toula.docx%23_Toc358655781http://c/Users/ALI/Desktop/FYP/Documentation/Report/Toula.docx%23_Toc358655782http://c/Users/ALI/Desktop/FYP/Documentation/Report/Toula.docx%23_Toc358655782http://c/Users/ALI/Desktop/FYP/Documentation/Report/Toula.docx%23_Toc358655783http://c/Users/ALI/Desktop/FYP/Documentation/Report/Toula.docx%23_Toc358655783http://c/Users/ALI/Desktop/FYP/Documentation/Report/Toula.docx%23_Toc358655784http://c/Users/ALI/Desktop/FYP/Documentation/Report/Toula.docx%23_Toc358655784http://c/Users/ALI/Desktop/FYP/Documentation/Report/Toula.docx%23_Toc358655784http://c/Users/ALI/Desktop/FYP/Documentation/Report/Toula.docx%23_Toc358655786http://c/Users/ALI/Desktop/FYP/Documentation/Report/Toula.docx%23_Toc358655786http://c/Users/ALI/Desktop/FYP/Documentation/Report/Toula.docx%23_Toc358655787http://c/Users/ALI/Desktop/FYP/Documentation/Report/Toula.docx%23_Toc358655787http://c/Users/ALI/Desktop/FYP/Documentation/Report/Toula.docx%23_Toc358655788http://c/Users/ALI/Desktop/FYP/Documentation/Report/Toula.docx%23_Toc358655788http://c/Users/ALI/Desktop/FYP/Documentation/Report/Toula.docx%23_Toc358655792http://c/Users/ALI/Desktop/FYP/Documentation/Report/Toula.docx%23_Toc358655792http://c/Users/ALI/Desktop/FYP/Documentation/Report/Toula.docx%23_Toc358655794http://c/Users/ALI/Desktop/FYP/Documentation/Report/Toula.docx%23_Toc358655794http://c/Users/ALI/Desktop/FYP/Documentation/Report/Toula.docx%23_Toc358655795http://c/Users/ALI/Desktop/FYP/Documentation/Report/Toula.docx%23_Toc358655795http://c/Users/ALI/Desktop/FYP/Documentation/Report/Toula.docx%23_Toc358655796http://c/Users/ALI/Desktop/FYP/Documentation/Report/Toula.docx%23_Toc358655796http://c/Users/ALI/Desktop/FYP/Documentation/Report/Toula.docx%23_Toc358655797http://c/Users/ALI/Desktop/FYP/Documentation/Report/Toula.docx%23_Toc358655797http://c/Users/ALI/Desktop/FYP/Documentation/Report/Toula.docx%23_Toc358655798http://c/Users/ALI/Desktop/FYP/Documentation/Report/Toula.docx%23_Toc358655798http://c/Users/ALI/Desktop/FYP/Documentation/Report/Toula.docx%23_Toc358655800http://c/Users/ALI/Desktop/FYP/Documentation/Report/Toula.docx%23_Toc358655800http://c/Users/ALI/Desktop/FYP/Documentation/Report/Toula.docx%23_Toc358655801http://c/Users/ALI/Desktop/FYP/Documentation/Report/Toula.docx%23_Toc358655801http://c/Users/ALI/Desktop/FYP/Documentation/Report/Toula.docx%23_Toc358655802http://c/Users/ALI/Desktop/FYP/Documentation/Report/Toula.docx%23_Toc358655802http://c/Users/ALI/Desktop/FYP/Documentation/Report/Toula.docx%23_Toc358655803http://c/Users/ALI/Desktop/FYP/Documentation/Report/Toula.docx%23_Toc358655803http://c/Users/ALI/Desktop/FYP/Documentation/Report/Toula.docx%23_Toc358655805http://c/Users/ALI/Desktop/FYP/Documentation/Report/Toula.docx%23_Toc358655805http://c/Users/ALI/Desktop/FYP/Documentation/Report/Toula.docx%23_Toc358655805http://c/Users/ALI/Desktop/FYP/Documentation/Report/Toula.docx%23_Toc358655806http://c/Users/ALI/Desktop/FYP/Documentation/Report/Toula.docx%23_Toc358655806http://c/Users/ALI/Desktop/FYP/Documentation/Report/Toula.docx%23_Toc358655806http://c/Users/ALI/Desktop/FYP/Documentation/Report/Toula.docx%23_Toc358655807http://c/Users/ALI/Desktop/FYP/Documentation/Report/Toula.docx%23_Toc358655807http://c/Users/ALI/Desktop/FYP/Documentation/Report/Toula.docx%23_Toc358655807http://c/Users/ALI/Desktop/FYP/Documentation/Report/Toula.docx%23_Toc358655806http://c/Users/ALI/Desktop/FYP/Documentation/Report/Toula.docx%23_Toc358655805http://c/Users/ALI/Desktop/FYP/Documentation/Report/Toula.docx%23_Toc358655803http://c/Users/ALI/Desktop/FYP/Documentation/Report/Toula.docx%23_Toc358655802http://c/Users/ALI/Desktop/FYP/Documentation/Report/Toula.docx%23_Toc358655801http://c/Users/ALI/Desktop/FYP/Documentation/Report/Toula.docx%23_Toc358655800http://c/Users/ALI/Desktop/FYP/Documentation/Report/Toula.docx%23_Toc358655798http://c/Users/ALI/Desktop/FYP/Documentation/Report/Toula.docx%23_Toc358655797http://c/Users/ALI/Desktop/FYP/Documentation/Report/Toula.docx%23_Toc358655796http://c/Users/ALI/Desktop/FYP/Documentation/Report/Toula.docx%23_Toc358655795http://c/Users/ALI/Desktop/FYP/Documentation/Report/Toula.docx%23_Toc358655794http://c/Users/ALI/Desktop/FYP/Documentation/Report/Toula.docx%23_Toc358655792http://c/Users/ALI/Desktop/FYP/Documentation/Report/Toula.docx%23_Toc358655788http://c/Users/ALI/Desktop/FYP/Documentation/Report/Toula.docx%23_Toc358655787http://c/Users/ALI/Desktop/FYP/Documentation/Report/Toula.docx%23_Toc358655786http://c/Users/ALI/Desktop/FYP/Documentation/Report/Toula.docx%23_Toc358655784http://c/Users/ALI/Desktop/FYP/Documentation/Report/Toula.docx%23_Toc358655783http://c/Users/ALI/Desktop/FYP/Documentation/Report/Toula.docx%23_Toc358655782http://c/Users/ALI/Desktop/FYP/Documentation/Report/Toula.docx%23_Toc358655781http://c/Users/ALI/Desktop/FYP/Documentation/Report/Toula.docx%23_Toc358655780http://c/Users/ALI/Desktop/FYP/Documentation/Report/Toula.docx%23_Toc358655779http://c/Users/ALI/Desktop/FYP/Documentation/Report/Toula.docx%23_Toc358655778http://c/Users/ALI/Desktop/FYP/Documentation/Report/Toula.docx%23_Toc358655777http://c/Users/ALI/Desktop/FYP/Documentation/Report/Toula.docx%23_Toc358655776http://c/Users/ALI/Desktop/FYP/Documentation/Report/Toula.docx%23_Toc358655775http://c/Users/ALI/Desktop/FYP/Documentation/Report/Toula.docx%23_Toc358655774http://c/Users/ALI/Desktop/FYP/Documentation/Report/Toula.docx%23_Toc358655773http://c/Users/ALI/Desktop/FYP/Documentation/Report/Toula.docx%23_Toc358655771http://c/Users/ALI/Desktop/FYP/Documentation/Report/Toula.docx%23_Toc358655769 -
7/25/2019 2D Pick and Place Robot
8/41
8
Chapter I : Introduction
Project description:I.1-
The project consists of a Pick &Place 2D Robot which works following this scenario:
Small metallic items with different shapes and colors (Rectangles, Circles,
Black, and Grey) are supplied onto a moving conveyor/Belt System.
These items are checked by a specific camera which determines their
shape/color, XY position and then sends these data to the controller.
The robot picks the moving item from the calculated position using an
electromagnet and throws it to the specified position according to its
shape/color.
Figure 1: Sketch of the project
-
7/25/2019 2D Pick and Place Robot
9/41
9
About ITEC:I.2-
This project is developed in collaboration with Industrial Technologies S.A.L
Company (ITEC), which is located in Sin El Fil, Beirut, Lebanon.
ITEC was created with an aim to integrate emerging technologies in theAutomation and information industries. ITEC fundamental business strategy is
building long term business relationship, by matching each customers
requirements via assembling teams of experts with the knowledge and ability to
deliver superior results.
By the way, ITEC is an exclusive Beckhoff Automation distributor for Lebanon,
Jordan and Syria.
Concerning this project, its specifications were set in a dynamic way between the
company and the project supervisor at the university Dr. Noureddine Alameh.
ITEC provided all the hardware (Beckhoff) and software support in order to
accomplish tasks and finish the project.
-
7/25/2019 2D Pick and Place Robot
10/41
10
Chapter II : The Hardware
Synchronous Servomotor AM3112-0400-0001
Figure 2 : BeckHoff Servomotor
a)Appropriate use:Synchronous servomotors of the AM3100 series are designed as drives for handling
equipment, textile machines, machine tools, packaging machines and similar
machines with demanding requirements in terms of dynamics. The servomotors
from the AM3100 series are exclusively designed for installation as components in
electrical systems or machines and may only be operated as integrated
components of the system or machine.
b) Product identification:
(i )
Nameplate:
Figure 3 : Motors nameplate elements definition
-
7/25/2019 2D Pick and Place Robot
11/41
11
Type AM 3112-0400-0001
S.N. Confidential T.: Sep-12
I0 3.4 Arms Nn 1500 rpm at 24 Vdc
M0 0.32 Nm Nn 3500 rpm at 48 Vdc
Pn 100 W Isol.cl. F IP:54Figure 4 : Motors nameplate
c) Technical description of the motor:
(i )Design of the motor:
The synchronous servomotors of the AM3100 series are brushless three-phase
motors for demanding servo-applications. In conjunction with digital servo
terminal they are particularly suitable for positioning tasks in industrial robots,
machine tools, actuators
The servomotors are equipped with permanent magnets in the rotor. Thisadvanced neodymium magnetic material makes a significant contribution to the
motors' exceptional dynamic properties. A three-phase winding is housed in the
stator, and this is powered by the servo drive. The motor has no brushes, the
commutation being implemented electronically in the servo drive.
The motors normally have an integrated resolver to provide feedback. Beckhoff
servo drives analyze the resolver position of the rotor and supply the motors with
sine currents.
(ii)
Selection Criteria:The three-phase servomotors are designed for operation with servo terminals.
Both units together form a speed or torque control loop.
The main selection criteria are:
Standstill torque M0 [Nm]
Rated speed at rated supply voltage Nn [min-1]
Moment of inertia of motor and load J [kgcm]
Effective torque (calculated) Mrms [Nm]
The static load and the dynamic load (acceleration/braking) must be taken into
account in the calculation of the required motors and servo drives.The selected motors described in this project have been proposed by ITEC.
-
7/25/2019 2D Pick and Place Robot
12/41
12
The Servo drives EL7201:II.2-
a) Introduction:
The EL7201 servomotor EtherCAT Terminal, with integrated resolver interface,
offers high servo performance in a very compact design.
The fast control technology, based on field-oriented current and PI speed control,
supports fast and highly dynamic positioning tasks. The monitoring of numerous
parameters, such as overvoltage and under voltage, overcurrent, terminal
temperature or motor load offers maximum operational reliability.
The latest power semiconductors guarantee minimum power loss and enable
feedback into the DC link when braking. The LEDs indicate status, warning and
error messages as well as possibly active limitations.
Figure 5 : EL7201 connection diagram with the motor
-
7/25/2019 2D Pick and Place Robot
13/41
13
b) Technology:
The servomotor is an electrical motor. Together with a servo amplifier, they form a
servo drive. The servomotor is operated in a closed control loop with position,
torque or speed control.
The servo terminal EL7201 supports control of permanent magnet synchronous
motors. These consist of 3 coils which are offset by 120 and a permanent magnet
rotor.
Servomotors particularly demonstrate their advantages in highly dynamic and
precise positioning applications:
very high positioning accuracy in applications where maximum precision is
required through integrated position feedback
high efficiency and high acceleration capacity
Servomotors are overload-proof and therefore have far greater dynamics
than stepper motors, for example.
load-independent high torque right up to the higher speed ranges
maintenance requirements reduced to a minimum
The Controller CX-1020:II.3-
a)About the controller
With the CX series of Embedded PCs Beckhoff has combined PC technology and
modular I/O level to form a top-hat rail unit in the control cabinet. The CX1020
is equipped with a 1 GHz Intel(r) CPU. It is an energy-saving device that
Figure 6: Servo Drive operation principle
-
7/25/2019 2D Pick and Place Robot
14/41
14
operates with ultra-low core voltage and features low thermal power
dissipation.
As a top-hat rail and in conjunction with the TwinCAT software from Beckhoff, the
CX1020 offers the same functionality as large Industrial PCs. In terms of PLC, up to
four virtual IEC 61131 CPUs can be programmed with up to four tasks each, with a
minimum cycle time of 50 s. All IEC 61131-3 languages can be used. Moreover, all
TwinCAT functionalities are available for Motion Control applications:
In theory, up to 256 axes can be controlled. In addition to simple point-to-point
movements, more complex multi-axis functions such as "electronic gearbox", "cam
plates" and "flying saw" can be implemented. Due to its higher CPU performance
the CX1020 can now also execute interpolating 3D path movementsand
DIN66025 programs. In addition to real-time execution of control tasks, the
TwinCAT real-time kernel ensures that enough time remains for the user interface
(HMI: Human Machine Interface), to communicate with the real-time components
via software interfaces.
b) Remote programming via Ethernet
The CX1020-0113 supplied by ITEC is equipped with Windows CE.NET. In this
case, the system is programmed via a laptop or a desktop PC, which is connected
to the CX1020 via Ethernet (crossover cable). The programs are developed on the
laptop with a standard TwinCAT software license and then loaded into the target
device.
Principle of operation of the servomotor:II.4-
a)
Definition:
Permanent magnet AC (PMAC) motors do not rely entirely on current for
magnetization. Instead, magnets mounted on or embedded in the rotor couple
with the motors currentinduced, internal magnetic fields generated by electrical
input to the stator. More specifically, the rotor itself contains permanent magnets,
which are either surface-mounted to the rotor lamination stack or embedded
within the rotor laminations.
As in common AC induction motors, electrical power is supplied through the statorwindings. Permanent-magnet fields are, by definition, constant and not subject to
failure, except in extreme cases of magnet abuse and demagnetization by
overheating. PMAC, PM synchronous and brushless AC are synonymous terms.
Until recently, PMAC motors were available but not widely distributed; now these
motors are proliferating.
-
7/25/2019 2D Pick and Place Robot
15/41
15
b) The Magnet:
Rare-earth elements are those 30 metals found in the periodic tables oft-omitted
long center two rows; theyre used in manymodern applications. Magnets made of
rare-earth metals are particularly powerful alloys with crystalline structures that
have high magnetic anisotropy which means they readily align in one direction,
and resist it in others. Discovered in the 1940s and identified in 1966, rare-earth
magnets are One-third to two times more powerful than traditional ferrite
magnets generating fields up to 1.4 Tesla, in some cases. Their magnets are used
in permanent-magnet rotary and linear motors.
c)
Principle of operation:
A PMAC (Permanent Magnet AC) motor has a sinusoidal distributed stator winding
to produce sinusoidal back-electromotive force (EMF) waveforms. Back EMF is
voltage that opposes the current that causes it. In fact, back EMF arises in anyelectric motor when there is relative motion between the current-carrying
armature (whether rotor or stator) and the external magnetic field. As the rotor
spins (with or without power applied to the windings), the mechanical rotation
generates a voltage so, in effect, becomes a generator. Typical units are
(V/krpm) Volts/ (1,000 rpm).
Figure 7 : Principle and construction of a brushless Servo motor
-
7/25/2019 2D Pick and Place Robot
16/41
16
Figures 7 and 8 show the construction and the principle of operation of the motor.
Back EMF is the voltage generated by rotating permanent magnet machine. As the
rotor spins (either with or without power applied to the stator windings) the
mechanical rotation generates a voltage in other words, becomes a generator.
The resultant voltage waveform from back EMF is either shaped like a sine wave(AC) or a trapezoid (DC), depending on the power supply from the drive. In fact, the
major difference between PMAC and permanent magnet DC motors is that the
faster a PMACs rotor spins, the higher back-EMF voltage is generated.
PMAC-compatible drives (known as PM drives) substitute the more traditional
trapezoidal waveforms flat tops with asinusoidal waveform that matches PMAC
back EMF more closely, so torque output is smoother. Each commutation of
phases must overlap, selectively firing more than one pair of power-switching
devices at a time. These motor-drive setups can be operated as open-loop systems
used in midrange performance applications requiring speed and torque control. In
this case, PMAC motors are placed under vector-type control.
In fact, though PMACs require a drive specifically designed to drive PM motors, thePM drive setup is most similar to flux vector drives for AC induction motors, in that
the drive uses current-switching techniques to control motor torque and
simultaneously controls both torque and flux current via mathematically intensive
transformations between one coordinate system and another. These PM drives use
motor data and current measurements to calculate rotor position.
Figure 8 : waveform for sinusoidal EMF style and square wave servo drives
-
7/25/2019 2D Pick and Place Robot
17/41
17
During every sampling interval, the three-phase AC system dependent on time
and speed is transformed into a rotating two-coordinate system in which every
current is expressed and controlled as the sum of two vectors.
In PMAC motors, speed is a function of frequency the same as it is with
induction motors. However, PMAC motors rotate at the same speed as the
magnetic field produced by the stator windings; it is a synchronous machine.
Therefore, if the field is rotating at 1,800 rpm, the rotor also turns at 1,800 rpm
and the higher the input frequency from the drive, the faster the motor rotates. A
permanent magnet AC (PMAC) motor is a synchronous motor, meaning that its
rotor spins at the same speed as the motors internal rotating magnetic field.
The Electromagnet:II.5-
The electromagnet is a simple coil taken from a 24 V relay.
The coils terminals are linked to the digital output module (EL2002):
When the Boolean variable linked to this output is True, the electromagnetis on.
When the Boolean variable linked to this output is False, the electromagnet
is OFF.
The mechanical system:II.6-
The whole mechanical system was designed and implemented by Oubatec
company.
The linear motion is achieved using lead-screw system combined to linear guide
ways.
Figure 9 : Oubari's logo
-
7/25/2019 2D Pick and Place Robot
18/41
18
Chapter III : The Software
BeckHoff-TwinCAT:III.1-
a) Generalities about TwinCAT
The TwinCAT software system is a complete automation system for PC-compatible
computers, which is referred to as "The Windows Control and Automation
Technology". TwinCAT transforms every compatible PC into a real time control
with multi-PLC, NC axis control, a programming environment and a control station.
TwinCAT substitutes PLC (Programmable Logic Controller) and NC (Numerical
Control) controllers as well as control stations with:
open, compatible PC hardware,
programmed in accordance with the manufacturer-independent IEC61131-3 standard,
linking to all common field buses and PC interfaces for I/O signals,
embedding of PLC and NC systems in Windows NT,
TwinCAT unites the real time control capability with the open and world-wide
largest software platform of Microsoft's Windows operating systems.
TwinCAT embraces a large number of system components which, together,
constitute a complete solution for automation tasks:
Programming of PLC programs for sequential logic in conformity withIEC61131-3.
Programming of NC point-to-point (PTP) and interpolation (I) positioning in
conformity with DIN66025.
Real time system for the execution of PLC and NC programs in an exactly
timed (deterministic) fashion, regardless of how the PC is used for further
tasks.
I/O linking for all widespread field buses and the PC interfaces and also for
third-party interface cards.
Any TwinCAT software is composed of two 2 types of windows:
TwinCAT PLC where the user creates its own software using available
programming languages and functions.
TwinCAT System Manager: it is the central configuration tool of the
TwinCAT System. It is where the inputs and outputs of the software tasks
and the physical inputs and outputs of the connected fieldbuses are
-
7/25/2019 2D Pick and Place Robot
19/41
19
managed. The I/O information of the PLC Software Tasks is read from and
entered in the TwinCAT System Manager. From there, the installed
fieldbuses and their connected modules/boxes are also described. The
logical and physical inputs and outputs are assigned to one another by
linking software task variables and fieldbus variables.
b) TwinCAT NCI (numerical control interpolation):
The TwinCAT NC Interpolation (NC I) is the NC system for interpolated path
movements. TwinCAT NC I offers 3-D interpolation (interpreter, set point
generation, position controller), an integrated PLC with an NC interface and an I/O
connection for axes via the fieldbus. All well-known Fieldbus systems and
programming standards in the CNC world, such as DIN 66025 (G code), are
supported. TwinCAT NC I deliver open PC solutions for standard axial components
and CNC controls. TwinCAT NC I uses the power of the PC (calculation) and allows
axis regulation under Windows NT/2000/XP/Vista/CE. Hardware modules aresimulated in the software, and are thus superfluous.
The following geometries are supported by the interpreter:
a straight line in space will be used in the project
circles in all main planes
circles in space
helices with base circles in the main planes
The main purpose of using NCI in the project is that the 2 axes move at the same
time and arrive to their destinations (even if they are different) instantaneously
which shows the 2D robot more flexible. The CX1020 controller can perform such
calculations and feed the servo drive with the necessary orders to move the
motors and stop them exactly on the desired positions.
Creation of the project function blocks:III.2-
In the software, there was a need to create special function blocks in order to
simplify the process.
Each function block has its own inputs, outputs and internal variables. They can be
called several times in the entire software under different names.
a) MoveToPos Function block:
This function block (FB) will be used later to move the 2 axes to any (X, Y) position.
It takes the desired coordinates, velocity (in degrees/s which maximal value is
-
7/25/2019 2D Pick and Place Robot
20/41
20
9000) and a bExecute Boolean variable (to enable the motors to run) as inputs and
generates one Boolean output:
bDone:to identify that the motion is done.
This function block is a combination of many other sub functions already defined inTwinCAT libraries that will be described in the following paragraphs. Every time
MoveToPosis called, the sub functions are called in the following order:
(i )NciFeedTablePreparation:
This function block appends an entry of a specified type to a defined structure
called feed group table. One appended entry can generally create more than one
row in the table. In this project, a table with only one row has been chosen. In the
following paragraphs, the term table must be understood as a one row.
The variable E_NCiEntryTypeis an integer that defines the geometrical type of the
trajectory. In this project, it is assigned the value 2 which is related to a straight
line for each axis.
The variable pEntry is a pointer to another variable: ST_NciGeolinethat describes astraight line with a specified velocity. (ST_Geoline is chosen out of many types like
circles, Helicoids).
These data are delivered to stFeedGroupTablethat holds the rows for the NC-
kernel.
TheST_NciGeoline is a structure that takes X, Y, Z positions and Velocity.
Figure 10 : An instance of MoveToPos FB called GoHome
Figure 11 : NciFeedTablePreparation FB
-
7/25/2019 2D Pick and Place Robot
21/41
21
(ii)NciFeedTable:
The function block FB_NciFeedTablefeeds a given table to the NC-kernel. After
feeding is completed, bFeedingDone becomes true. bChannelDonesignals the
complete execution in the NC-kernel of the motion.
The variable bDoneof the MoveToPos function blockis linked to the variablebChannelDoneto indicate the end of motion.
The variables px, py, pzand velo of MoveToPos are linked to the X, Y, Zand
velocity variables of the structure St_Geoline.
The variable bExecuteof MoveToPosis linked to all bEnable and bExecute
variables of all the used sub function of MoveToPos.
The variable bError of MoveToPos is linked to all the bError variables of all the
used sub functions of MOVETOPOS.
Now this function block is ready to move the axes based on the NCI benefits: the
axes arrive simultaneously to their targets. It was created using the Structured
Textprogramming language.
b) Trigger function block:
This function block generates a desired number of pulses on its output timerQ
separated by the desired time interval.
Later on in this project, the creation of this function block will be justified. It was
programmed using the Ladder diagram language.
Figure 12: NCIFeedTable FB
Figure 13 :An instance of Trigger FB Called Trig
-
7/25/2019 2D Pick and Place Robot
22/41
22
A counter (CTU: Counter up) is related to a timer (TON) in the following manner:
When Start is True, the counter counts the first time and its internal
variable M which is linked to the input of the timer generates one pulse. This pulse starts the timer for the desired time and at the moment the
counter is waiting because its input depends on the Q output of the timer
which is FALSE when the timer is on.
Once the timer finishes one cycle, the counter counts up for one time
(because the output Q of the timer turns TRUE) and the process is repeated
until the counted value (CV) reaches the counter limit (PV) where the
TrigDone output turns TRUE.
c)
CamData function block:
This function block is used to receive data from the camera sensor using
TCP/IP connection and analyze its content to determine the shape, color,
and position of the item. The programming language used here is the
Sequential Function Chart language(SFC) also known as Grafcet.
This language is based on steps (actions) and transitions (conditions to
move from one action to another). Every action can be programmed using
any one of the IEC3113 languages.
Figure 14: Ladder diagram Trigger
Figure 15: An instance of FB CamData called
CamOutput
-
7/25/2019 2D Pick and Place Robot
23/41
23
This function block takes an execute Boolean input and returns many
outputs:
Rec : turns True if the shape is rectangle
Cir: turns True if the shape is a circle
W: turns True if the color is white B: turns True if the color is black
Xcam : the X position of the item when detected by the camera
sensor
Ycam: the Y position of the item when detected by the camera
sensor
GrayVal : the grayscale value of the item
Found: a Boolean output indicating that an item was detected by
the camera
The Sequential Function Chart (SFC) of this function block is composed of the
following steps as shown in the figure 16:
(i )
Init:
An initialization phase where all Boolean output variables (Rec, Cir, W and B) are
RESET to False.
Figure 16: SFC of the CamData FB
-
7/25/2019 2D Pick and Place Robot
24/41
24
The figure 17 represents the action performed in the Trigger Step:
Figure 17: Trigger step
The Trig instance of the Trigger function block generates 10 pulses 10 milliseconds
separated from each other.
These pulses trig the receive function block (already found in the Twincat TCP/IP
server library) as it is shown in the figure. The received data are stored in an array
of bytes in a sequence but in random positions in the array.Before trigging the receive function block, the connectone is used to establish
the connection and generate a special hand shake variable called hsocket. This
block takes the IP address and the port number of the camera as inputs.
Each time the controller enters this step, data are delivered from the camera to the
array. Thus, the transition to the next step is related to the TrigDone output
variable of the Trigger Function Block.
(ii)Analyze:
The received data are in a sequence starting by the character a and ending with
the character b as it was programmed in the camera software. The received
sequence shown in the figure 18.
Figure 18: Scrreshot of the TCP/IP data using Hyperterminal
-
7/25/2019 2D Pick and Place Robot
25/41
25
This sequence can be read in the following order:
B, 1 : a part is found ( if it was 0 means that no item was detected)
(X , Y ) position of the item
AREA (in this example 3127 ) : it is the area of the item, this parameter
leads us to determine the shape according to the area of the item G, 18: the grayscale value that leads us to determine the color.
Unfortunately, these data are received in the following form:
Each byte was transformed using the ASCII code:
The data are placed in sequence but randomly in the array
Sometimes X is a 2 digits number and sometimes it is a 3 digits number
(same for Y)
Sometimes X has 2 numbers after its decimal point and sometimes 1 (same
for Y)
Taking into account all these conditions, around 12 IF, ELSE complicated
instructions were used to analyze the data without any error.
These instructions were written in the ST (structured text language) and can be
found in the cd attached to the report.
The following figure illustrates all the conditions that were taken into account:
Figure 19 : Screenshot of the received array of bytes
-
7/25/2019 2D Pick and Place Robot
26/41
26
Now all the data (X, Y, Grayscale value and the Area of the detected item) are
available, the following figure will summarize how the decision is taken:
Get GrayScale and
AREAGrayVal
-
7/25/2019 2D Pick and Place Robot
27/41
27
d) Reset function block:
This function block is used to reset the axes and the group errors.
It is based on the reset function MC_RESET already found in the Twincat MCLibrary (motion control) which is called for three times, each time for an axis.
Figure 22 : An instance of the MC_Reset FB
Figure 23 : An instance of the RESET FB
The figure 22 shows an instance of the Reset function block called ResetAxes,
when all axes are reset; the output bit bResetDone becomes TRUE.
e) ComparePos function block:This function block is related to the MoveToPos function block. It is used to make
sure that the robot has arrived to its X and Y destinations.
The Actual X and Y values are situated in the global variables XNCtoPLC andYNCtoPLC that are structures including all feedback data from the servo motors to
the PLC.
The following figure shows how this function block works:
Figure 24 : An instance of the ComaprePos FB
-
7/25/2019 2D Pick and Place Robot
28/41
28
|ActualYDesiredY|
-
7/25/2019 2D Pick and Place Robot
29/41
29
a) Latch Program:This program aims to organize the operation of the software when we need to
start or to stop it. Because time was not sufficient, the HMI (Human Machine
Interface) created was not able to be implemented on a screen in Project
Lebanon, so a switch was used to start up and stop the software.
This switch is linked to the global variable bSwitch and to the digital input
module EL1002.
To start the software, a rising edge of the variable bSwitch (turning on) is detected;
it sets the bStartLatch bit and resets the bStopLatch bit. Otherwise, a falling
edge of the variable bSwitch (turning off) is detected; it resets the bStartLatch bit
and sets the bStopLatch bit.
Because the servo motors are equipped with resolvers, every time the system is
shut down, the servo loses its position so we need to set its actual position on the
next startup to (0, 0) respecting the condition that before stopping the system, the
robot must be homed. This action will be implemented in the next steps.
The MC_SetActualPosition function block of the MC (Motion Control library) isused to set the actual position. The following figure shows the Ladder Diagram of
this program:
Figure 27: Ladder diagram of the Latch Program
-
7/25/2019 2D Pick and Place Robot
30/41
30
b) AxesPower Program:
(i )
MC_POWER function block:
This function block is used to power the axis, enabling positive and negative
running directions.
The input variable AxisRefInof type NC_TO_PLC Axis Interfacepresents the actualstatus of the axis including many values (e.g. Axis Status, actual position, actual
velocity, Axis Id).These variables could be considered as feedback variables from
the axis to the PLC. The input variable AxisRefOutof type PLC_TO_NC Axis
Interfaceincludes all variables imposed by the PLC on the axis (external set
position, acceleration, velocity.).This function block is used 3 times to power the
3 axes X, Y and Z. Only 2 motors are present but an interpolation channel needs 3
axes to be appended, so a fictive axis Z is appended which will not be linked to any
hardware.
The output bit Status turns TRUE when the axis is powered, now each axis is ready
to move in Point To Point mode independently from others.
(ii)
CfgBuild3Dgroup function block:This block configures a 3D interpolation group with up to 3 Point To Point axes (X, Y
and Z). The Ids of the PTP axes are supplied to the inputs nXAxisId, nYAxisId and
nZAxisId. nGroupId represents the ID of the 3D group. The command is executed at
a rising edge on the input bExecute.
The output bErr goes TRUE if an error occurs as the command is being executed.
The command-specific error code is contained in nErrId.
Figure 28 : MC_POWER FB
Figure 29: CfgBuild3DGroup FB
-
7/25/2019 2D Pick and Place Robot
31/41
31
(i i i) AxesPower Operationprinciple:
The AxesPower program is written using the Structured Text programminglanguage, but it is illustrated using the CFC (Continuous Function Chart) language in
the following figure.
As it is shown in the figure, once all axes are powered (bAllAxesReady is TRUE), an
interpolation group can be built and a feedback negation of this variable is linked
to the input to make sure that axes are powered once without error.
When the interpolation group is built without errors, the MoveToPos function
block already created can be used successfully for several times.
c)
The Cycle Program:
This program represents the whole cycle followed by the robot from detecting
items to throwing them.
The Sequential Function chart (Grafcet) Programming language was chosen
because it suits the algorithm used along this program. The following figure shows
the cycle program:
Figure 30 : Operation principle of the "AxesPower" program
-
7/25/2019 2D Pick and Place Robot
32/41
32
INIT
Camera
Pick
Inter1
Throw
Inter2
Home1
Home2
bStartLatch
bStopLatch
Rec OR C
bStopLatch
ComparePosHome.EqualTRUE
ComparePickSure.EqualTRUE
NOT CamOutput.exec
CompareThrow1.EqualTRUE AND NOT bStopLatch
bStopLatch
ComparePosHome.EqualTRUE
INIT
Home2
NOT (Rec OR C)
INIT
Figure 31 : Grafcet of the "Cycle" program
-
7/25/2019 2D Pick and Place Robot
33/41
33
(i )
INIT step:
In this step, an instance of the Reset function block is called to remove any
probable axis error.
(ii)Camera step:
When the Boolean variable bstartLatch is true (the switch is turned on), the system
passes from the INIT step to the Camera step.
In this step, an instance of the CamData function block named CamOutput is
called to receive data from the camera and analyze its content. All output data
from this function block are linked to global variables in order to be able to deal
with them by other steps.
The global variable called Magnet that is related to the digital output of the
module EL2002 is Reset to FALSE in this step to make sure that the robot doesnt
catch any item when the camera is detecting.
Whenever the camera detects any item, one of the global variables Rec or C
becomes TRUE and the system then passes to the next step.
(i i i) Pick step:
In this step, the following actions are achieved:
1. Move to the calculated X position according to the data from the camera
(CamOutput.Xcam) taking into consideration that the X value delivered by
the camera must be transformed to become suitable with the robots
coordinate system. The Y position is chosen constant (Y3 check figure 34).
Figure 32 : The Camera Step
-
7/25/2019 2D Pick and Place Robot
34/41
34
GoPickOrder function block of the following figure, Network 0001.
2. When the robot arrives to the calculated X, turn ON the electromagnet
ComparePickOrder1 function block of the following figure, Network
0002.
3. When the robot arrives to the (calculated X, Y3) position, move to the
(calculated X, Y3 +10000) position (unit in degrees) to make sure to catch
the item.
ComparePickOrder and PickSure function blocks of the following figure,
Networks 0003 and 0004.
4. When the robot arrives to the (calculated X, Y3 +10000) position, move to
the next step.
ComparePickSure function block of the following figure, Network 0005.
Figure 33 : Ladder diagram of the "Pick" step
-
7/25/2019 2D Pick and Place Robot
35/41
35
(iv)Inter1 step:
In this intermediate step, all the MoveToPos and counters function blocks of the
Pick and Throw steps are called but with their bExecute inputs = FALSE to make
sure they are not still working.Moreover, the Camoutput function block is called (with bExecute=FALSE) to
prevent the camera from receiving data when the robot is picking and throwing.
(v)Throw step:
In this step, the robot must decide where to throw the item according to its shape
and color taking into account the number of similar items already arranged and
respecting the order shown in the next figure.
The robot counts the number of existing items of every type using the UP counter
function block CTU) from the Twincat standard library, every time the counter
value becomes 6, the value is reset to 0 (counter is reset). If we take for example
the black circles, when the number of black circles is 1 (BCnb=1), the robot throws
the item in the (x1, y6) position and when BRnb=6 then (Xthrow, Ythrow) = (x3,y5).
The robot throws from the most far position to the nearest one to prevent the
electromagnet (that is ON when the robot is throwing) to attract the already sorted
items.
This algorithm was applied using the Casestructure of the structured text
language.
Figure 34 :Sketch of the axes and the throwing positions
-
7/25/2019 2D Pick and Place Robot
36/41
36
When the robot arrives to the (Xthrow,Ythrow) position
(CompareThrow.EqualTrue), the software moves to the next intermediate action
Inter2 where all the function blocks used in the Throw action (Counters ,
MoveToPos, ComparePos) are called with their bExecute inputs are False to make
sure they are no more active.
Figure 35 : Throwing positions according to item's numbers
-
7/25/2019 2D Pick and Place Robot
37/41
37
BR= Rec AND B
BC= C AND B
WR=Rec AND W
WC=C AND W
BC=TRUEWR=TRUEBR=TRUE WC=TRUE
BRnb =BRnb+1
YES
BCnb=BCnb+1
YES
WCnb=WCnb+1
YES
WRnb=WRnb+1
YES
BRnb=6BCnb=6
WCnb=6 WRnb=6
WRnb=0
YES
WCnb=0
YES
BCnb=0
YES
BRnb=0
Reset Counter
YES
(Xthrow,Ythrow)
according to BRnb
(Xthrow,Ythrow)
according to BCnb (Xthrow,Ythrow)
according to WCnb
(Xthrow,Ythrow)
according to WRnb
Go Throw to
(Xthrow,Ythrow)
Figure 36 :"Throw"step diagram
-
7/25/2019 2D Pick and Place Robot
38/41
38
(vi)Home1 and Home2 Steps:
When the bSwitch is turned off, the bStopLatch becomes TRUE and the robot
must stop and return to its home position.
For these reasons, parallel branches like Home1 and Home2 were added in
different positions in the Sequential Function Chart to make sure that the robot
returns home whenever the switch is turned off.
But if the robot was moving and this switch was turned off, the robot continues its
action and then returns home.
d) TorqueLim Program:This program is used to set the value of a variable called torque limitation related
to some hardware issues.
Sometimes this value is set to 0 and the robot doesnt move. Thus, this program
resets the variable to its normal value (32767) whenever it changes to 0.
-
7/25/2019 2D Pick and Place Robot
39/41
39
Chapter IV : Conclusion
Achieved Objectives:IV.1-
Learn NCI (numerical control by interpolation) programming using
TWINCAT
Respect the deadlines before 4-June-2013date of Project LEBANON
2013
Learn how to communicate and deal with other companies
Learn how to lead a workgroup and assign tasks
Assembly of the of the panel from A to Z
Use of 4 IEC3113 languages: ST (Structured text), LD (ladder diagram) ,
SFC(sequential function chart), CFC (continuous function chart)
Forecast objectivesIV.2-
To let the robot Pick more than one itemTime was not sufficient
especially because of the delay to deliver the mechanical system & some
problems with the camera software.
To let the robot synchronize with the conveyor motor and the magnet turns
ON only when it is right up of the itemstill need more appropriate
sensor and sufficient time
Interesting Statistics:IV.3-
This figure represents the Project Schedule that was followed step by step.
Figure 37 : Project Schedule
-
7/25/2019 2D Pick and Place Robot
40/41
40
3 visits to Oubaris Workshop in Zahle where the mechanical system was
implemented
10 meetings with the Supervisor
More than 90 working days from 8:00 to 6:00
References:IV.4-
http://infosys.beckhoff.com/index_en.htm; This reference includes all
relevant data about the hardware and the software.
www.leeson.com/documents/.../PMAC_Whitepaper.pdf
The projectsSoftware and Twincat will be attached to this report
APPENDIXIV.5-
Figure 38 : image of theelectrical panel
http://infosys.beckhoff.com/index_en.htmhttp://www.leeson.com/documents/.../PMAC_Whitepaper.pdfhttp://www.leeson.com/documents/.../PMAC_Whitepaper.pdfhttp://infosys.beckhoff.com/index_en.htm -
7/25/2019 2D Pick and Place Robot
41/41
The figure 38 shows the panel board of the project including:
From the top left of the upper rail : Siemens 24 V power supply , camera
driver
From the top left of the lower rail : 2 fuse (one for 220 V and the other for
24 V ), BeckHoff Controller CX1020 with its connected modules (1 digital
input EL1002, 1 digital output EL2002, 2 EL7201 Servo Drive modules)
Figure 39 : image of the project in "Project LEbanon 2013" BIEL