Escolar Documentos
Profissional Documentos
Cultura Documentos
2012 / 2013
By :
Title
President
Member
Member
Invited member
DEDICATION
ACKNOWLEDGEMENTS
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 BECKHOFF automation 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 automation
processes.
Table of Contents
Table of Contents ........................................................................................................ 5
Chapter I :
Introduction .......................................................................................... 8
I.1-
I.2-
Chapter II :
b)
c)
II.2-
a)
Introduction: ............................................................................................... 12
b)
Technology: ................................................................................................ 13
II.3-
a)
b)
II.4-
a)
Definition: ................................................................................................... 14
b)
c)
II.5-
II.6-
Chapter III :
b)
b)
c)
d)
e)
b)
c)
d)
Chapter IV :
Conclusion ....................................................................................... 39
IV.1-
Achieved Objectives:............................................................................... 39
IV.2-
IV.3-
IV.4-
References: ............................................................................................. 40
IV.5-
APPENDIX ................................................................................................ 40
List of Figures
Figure 1: Sketch of the project .................................................................................... 8
Figure 2 : BeckHoff Servomotor ................................................................................ 10
Figure 3 : Motor's nameplate elemnts definition ..................................................... 10
Figure 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 ......................................................... 27
Figure 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
Chapter I :
I.1-
Introduction
Project description:
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.
I.2-
About ITEC:
Chapter II :
The Hardware
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:
10
Type
S.N.
AM 3112-0400-0001
Confidential
T.:
Sep-12
I0
M0
3.4 Arms
0.32 Nm
Nn
Nn
1500 rpm
3500 rpm
at 24 Vdc
at 48 Vdc
Pn
100 W
Isol.cl.
IP: 54
11
12
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.
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 movements and
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.
14
b) The Magnet:
Rare-earth elements are those 30 metals found in the periodic tables oft-omitted
long center two rows; theyre used in many modern 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 any
electric 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).
15
Figure 8 : waveform for sinusoidal EMF style and square wave servo drives
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 a sinusoidal 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, the
PM 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.
16
17
Chapter III :
The Software
III.1- BeckHoff-TwinCAT:
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:
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:
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
18
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.
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.
19
9000) and a bExecute Boolean variable (to enable the motors to run) as inputs and
generates one Boolean output:
This function block is a combination of many other sub functions already defined in
TwinCAT libraries that will be described in the following paragraphs. Every time
MoveToPos is called, the sub functions are called in the following order:
(i) NciFeedTablePreparation:
Figure 11 : NciFeedTablePreparation FB
20
(ii) NciFeedTable:
The function block FB_NciFeedTable feeds a given table to the NC-kernel. After
feeding is completed, bFeedingDone becomes true. bChannelDone signals the
complete execution in the NC-kernel of the motion.
The variable bDone of the MoveToPos function block is linked to the variable
bChannelDone to indicate the end of motion.
The variables px, py, pz and velo of MoveToPos are linked to the X, Y, Z and
velocity variables of the structure St_Geoline.
The variable bExecute of MoveToPos is 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
Text programming language.
21
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.
22
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.
23
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 connect one 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.
24
25
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:
Receive Data from
the Camera
NO
Item Detected
YES
YES
GrayVal <=30
NO
YES
Rec:=TRUE
(Rectangle)
NO
Cir:=TRUE
(Circle)
B:=TRUE
(Black)
W:=TRUE
(White)
(iii)Intermediate step:
If the camera detects any item, this step makes sure to reset all the outputs (Rec,
Cir, W, B, and Found) to avoid data from remaining the same next time the
CamData FB is called.
26
The figure 22 shows an instance of the Reset function block called ResetAxes,
when all axes are reset; the output bit bResetDone becomes TRUE.
The Actual X and Y values are situated in the global variables XNCtoPLC and
YNCtoPLC that are structures including all feedback data from the servo motors to
the PLC.
The following figure shows how this function block works:
27
NO
|ActualX DesiredX|
|ActualY DesiredY|
NO
<1
<1
YES
AND
YES
EqualTrue
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) is
used to set the actual position. The following figure shows the Ladder Diagram of
this program:
29
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 AxisRefIn of type NC_TO_PLC Axis Interface presents the actual
status 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 AxisRefOut of type PLC_TO_NC Axis
Interface includes 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.
Figure 28 : MC_POWER FB
30
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.
INIT
bStopLatch
bStartLatch
Home2
Camera
bStopLatch
Home1
Rec OR C
Pick
ComparePosHome.EqualTRUE
INIT
ComparePickSure.EqualTRUE
Inter1
NOT CamOutput.exec
Throw
bStopLatch
Home2
ComparePosHome.EqualTRUE
Inter2
NOT (Rec OR C)
INIT
32
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.
(iii) 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).
33
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.
34
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 Case structure of the structured text
language.
35
36
BR=TRUE
YES
WR=TRUE
YES
YES
WCnb=WCnb+1
WRnb=WRnb+1
WCnb=6
WRnb=6
YES
YES
WCnb=0
WRnb=0
YES
BRnb =BRnb+1
BRnb=6
BCnb=BCnb+1
BCnb=6
YES
YES
BRnb=0
Reset Counter
(Xthrow,Ythrow)
according to BRnb
WC=TRUE
BC=TRUE
BCnb=0
(Xthrow,Ythrow)
according to BCnb
(Xthrow,Ythrow)
according to WCnb
(Xthrow,Ythrow)
according to WRnb
Go Throw to
(Xthrow,Ythrow)
37
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.
38
Chapter IV :
Conclusion
To let the robot Pick more than one item Time 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 item still need more appropriate
sensor and sufficient time
This figure represents the Project Schedule that was followed step by step.
39
IV.4- References:
www.leeson.com/documents/.../PMAC_Whitepaper.pdf
IV.5- APPENDIX
40
41