ECET-262 [LABORATORY 12C]
ECET-262 [LABORATORY 12C]
ECET-262 [LABORATORY 12C]
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
<strong>ECET</strong>-<strong>262</strong><br />
FALL 2010<br />
[<strong>LABORATORY</strong> <strong>12C</strong>]<br />
Motion Programming with EPAS Software- CAM Motion
P a g e | 2 of 25<br />
LAB <strong>12C</strong><br />
Motion Programming with EPAS Software- CAM Motion<br />
Objective: To learn and understand motion programming applications and concepts by working<br />
with ELAU PacDrive Systems and EPAS Software.<br />
Software Tool Required: Automation Toolkit EPAS-4 V24.<br />
Prerequisite Knowledge: Ladder Logic programming.<br />
Supplement Documents: EPAS-4 Programming Manual, PacDrive C-200 Controller Operating<br />
Manual, PacDrive iSH Motor Operating Manual, PacDrive MC-4 Servo Drive Operating<br />
Manual.<br />
Background<br />
This lab would be utilizing ELAU PacDrive MC-4 and ELAU PacDrive C200 Controller<br />
Hardware along with the ELAU iSH Motors. The system setup is being shown in the figure<br />
below:
P a g e | 3 of 25<br />
PacDrive Automation System<br />
The PacDrive automation system provides the optimal solution for electronic packaging<br />
machines, both in terms of technology and economy. PacDrive consists of a high performance<br />
controller run on a PC or controller-based architecture, the PacDrive controller and the digital<br />
servo amplifiers which contain the power supply unit, the final stages and the servo controller for<br />
the individual axes. The PacDrive controller is the intelligent head of the system and is based on<br />
an industrial PC. The PacDrive controller synchronizes and coordinates the motion functions of<br />
the packaging machine. Thanks to the use of an IEC 1131-3 soft PLC, areas of application that<br />
had previously been unavailable to a classical PLC have been opened up to the PacDrive<br />
controller family. The individual PLCs or motion tasks can thus be split up into various parallel<br />
tasks that can then be implemented with the programming environment EPAS-4 as per the IEC<br />
61131-3 standard. Up to 99 servo axes can be connected to one PacDrive controller and supplied<br />
with motion data. The circular, digital real-time bus SERCOS implements the secure data<br />
exchange with the MC-4 servo amplifiers. With the use of fiber optic technology, the data bus is<br />
insensitive to electromagnetic disturbances and cyclically supplies the decentralized<br />
MC-4 servo amplifiers with new set points at a data rate of up to 16 MBaud. All internal<br />
conditions of the axes can be called up via the real-time bus and processed by the PacDrive<br />
controller.<br />
In addition to digital and analog inputs and outputs, each PacDrive controller has two<br />
serial interfaces and one Ethernet interface available. Thanks to the integrated OPC<br />
interface, it is possible to connect various process visualization and control systems<br />
to PacDrive. Additional peripheral components can also be connected using the field<br />
bus interface module. A PacDrive controller can be the field bus master or the slave.<br />
The international field bus standards CANopen, PROFIBUS-DP and DeviceNet are<br />
supported. The built-in interfaces enable remote diagnosis via telephone modem or<br />
Internet. PCs can communicate via TCP/IP with the PacDrive controller and directly<br />
diagnose the conditions of the controller.<br />
C-200 Controller<br />
The PacDrive controller, microprocessor-based control hardware with the VxWorks real-time<br />
operating system, centrally implements the PLC and motion functions. PacDrive controller<br />
C200 synchronizes, coordinates and generates the motion functions for a maximum of 8 drives<br />
of a food and packaging machine.
P a g e | 4 of 25<br />
PacDrive MC-4 servo amplifier<br />
The MC-4 digital servo amplifier features compact, closed, wall-mountable construction as well<br />
as state-of-the-art technology. The innovative MC-4 has a power supply unit, power amplifier,<br />
and a software servo controller for one axis all installed in a single space-saving housing. Since it<br />
communicates with the PacDrive controller exclusively via fiber optics, it is also suitable for<br />
decentralized structures. It does not require a user program, processes single or multi-turn<br />
encoders, and configures itself using the electronic type plate in the SH motor.<br />
Highlights of the PacDrive MC-4:<br />
▪ Broad voltage range<br />
▪ Integrated power supply unit<br />
▪ Max. 34.5 / 69 kVA power<br />
▪ Automatic motor identification<br />
▪ Minimal size<br />
▪ Inverter Enable safety input<br />
▪ 250% overload<br />
▪ Integrated SERCOS interface<br />
PacDrive iSH Motor<br />
The innovative iSH combines the motor, power amplifier, and the digital servo controller for an<br />
axis in a space-saving housing. Due to its compact construction with integrated controller it is<br />
perfectly suitable for peripheral set-up. It is available with single or multi-turn encoders and<br />
configures itself with the aid of the electronic type plate in the iSH itself.<br />
Highlights<br />
▪ Compact size<br />
▪ 3.5 times as much peak torque<br />
▪ Integrated SERCOS interface<br />
▪ High-resolution single or multi-turn encoder<br />
▪ Protection class IP65<br />
▪ Simple wiring<br />
▪ Superior reliability<br />
Automation Toolkit EPAS-4 Software<br />
Due to the combination of comprehensive functions and fully developed tools, the Automation
P a g e | 5 of 25<br />
Toolkit EPAS-4 is a good example of a powerful programming tool that is as easy to use as a<br />
standard office program.<br />
Getting Started with EPAS-4<br />
EPAS-4 is a complete development environment for the PacDrive system. EPAS-4 puts a<br />
simple approach to the powerful IEC language at the disposal of the PLC programmer. Use of<br />
the editors and debugging functions is based upon the proven development program<br />
environments of advanced programming languages (such as Visual C++).<br />
EPAS-4 Quick Concepts<br />
Project<br />
A project contains all of the objects in a PLC program. A project is saved in a file named after<br />
the project. The following objects are included in a project:<br />
1. POUs (Program Organization Units)<br />
2. Data types<br />
3. Visualizations<br />
4. Resources and libraries.<br />
POU (Program Organization Unit)<br />
Functions blocks and programs are POUs. Each POU consists of a declaration part and a body.<br />
The body is written in one of the IEC programming languages, which include IL, ST, SFC, FBD,<br />
LD and CFC. EPAS-4 supports all IEC standard POUs. If you want to use these POUs in your<br />
project, you must include the library standard.lib in your project. POUs can call up other POUs.<br />
However, recursions are not allowed.
P a g e | 6 of 25<br />
CAM Motion<br />
A CAM is a projecting part of a rotating or oscillating body that sticks a lever at one or more<br />
points on its circular path and in doing so imparts a reciprocating or oscillating motion to a<br />
second body, called the follower, with which it is in contact.<br />
Working of a CAM Shaft<br />
As the CAM rotates, the follower goes up, dwells, and falls. The length of times spent at each of<br />
these positions depends on the shape of the CAM. The rise section (projected part) of the CAM<br />
is the part that drives the follower upwards and it profile determines how quickly the CAM<br />
follower will be lifted. The fall section of the CAM is the part that lowers the follower and its<br />
profile determines how quickly the CAM follower will fall. The dwell section of the CAM is the<br />
part that allows the follower to remain at the same level for a considerable amount of time. The<br />
dwell section of the CAM is where it is circular in radius that does not change. In other word<br />
shape of the CAM body determines the time (rotational angle), direction, and amount of follower<br />
movement. The following figures show several shapes of CAM body and their corresponding<br />
follower displacement with time.
P a g e | 7 of 25<br />
Creating a CAM profile using solids mechanical shaped, as our above example, has some<br />
drawbacks. It is not fast enough and less flexible to quick change. Thus in high speed packaging<br />
systems, desired CAM operations are mostly performed by servomotors coupled encoders and<br />
position control loop. The following is the fundamental build block for CAM operation in<br />
packaging systems.<br />
Electronic cam applications can be found in the following sectors:<br />
• Packaging industry<br />
• Timber industry<br />
• Materials handling<br />
• Handling technology<br />
• Printing machine technology<br />
CAM Motion in EPAS4<br />
Mechanical CAM Shafts<br />
The PacDrive System is capable of performing CAM motion in conjunction with the EPAS4<br />
Software. EPAS4 provides MultiCam motion programming function block that support CAM<br />
motion. Understanding CAM motion could be a little trickier compaered to other motion<br />
profiles. Each CAM profile is defined to have different CAM points which are simply the X and<br />
Y positions of the shaft. Notice that the unit of rotation for the shaft is 360◦◦ , the X position is the<br />
virtual position and the Y position is actually the command for the Slave or the CAM Axis(axis<br />
performing CAM motion). CAM Points are defined in a MultiCamStruct type of Variable in<br />
EPAS4.
P a g e | 8 of 25<br />
The figure below explains how a logical encoder works as a conduit between the Slave Axis/<br />
CAM Axis.<br />
X Velocity<br />
Logical<br />
Encoder<br />
Slave Axis<br />
X position being virtual the X velocity ( velocity at which X position would be incremented)<br />
could be provided to the logical encoder in two different ways:<br />
Setting the Offset Velocity of the Logical Encoder<br />
Or, Setting logical encoder to follow a real axis by using SetMasterEncoder function<br />
block.<br />
As said earlier a CAM motion profile is described by a MultiCamStruct type of variable. The<br />
table below explains the different MultiCamStruct structure variables:<br />
Structure Variable<br />
Definition<br />
NumberOfCamPoints Number of CAM points in the structure<br />
UserTableId Number to identify Table at run time<br />
mStart Slope at the beginning<br />
mEnd Slope at the end<br />
XPeriode X Period<br />
YPeriode Y Period
P a g e | 9 of 25<br />
Example : MultiCamStruct structure variable declaration:<br />
multicamstuc_FWD.NumberOfCamPoints:=3;<br />
Defines the total number of CAM<br />
points to be 3.<br />
multicamstuc_FWD.CamPoint[0].X:=0;<br />
multicamstuc_FWD.CamPoint[0].Y:=0;<br />
multicamstuc_FWD.CamPoint[0].M:=0;<br />
multicamstuc_FWD.CamPoint[0].CamType:=poly5com;<br />
Defines the CAM point 0 which in<br />
motion terms define that When X is at<br />
0 Y (Slave ) is at 0(takes no turn).<br />
multicamstuc_FWD.CamPoint[1].X:=180;<br />
multicamstuc_FWD.CamPoint[1].Y:=3600;<br />
multicamstuc_FWD.CamPoint[1].M:=0;<br />
Defines the CAM point 1 which in motion<br />
terms define that When X is at 180 Y<br />
(Slave ) is at 3600(takes 10 turns).<br />
multicamstuc_FWD.CamPoint[1].CamType:=poly5com;<br />
multicamstuc_FWD.CamPoint[2].X:=360;<br />
multicamstuc_FWD.CamPoint[2].Y:=0;<br />
multicamstuc_FWD.CamPoint[2].M:=0;<br />
Defines the CAM point 2 which in<br />
motion terms define that When X is at<br />
360 then Y (Slave ) is at 0(no turn).<br />
multicamstuc_FWD.CamPoint[2].CamType:=poly5com;
P a g e | 10 of 25<br />
Graphically:<br />
Now notice that the Master which is X will be provided a fixed velocity e.g. - 60 degrees per<br />
seconds. This would mean that the master would take 3 seconds to reach 180 degrees thus the<br />
slave would turn 3600 degrees (10 turns) after 3 seconds. Thus for each motion cycle this CAM<br />
profile would be repeated.<br />
Procedures to Write a CAM Motion Program:<br />
1. Define a Logical Encoder:<br />
Go to EPAS4 Start New Project Go to Resources Tab Go to PLC Configuration<br />
Append the MC-4 Sub-elements Append Log. Encoder:
P a g e | 11 of 25<br />
2. Configure Logical Encoder:<br />
Go Online Go to PLC Configuration Go to Log. Encoder Velocity Generator Set<br />
the Offset Velocity to 0:<br />
Note: Recall that as told previously after setting the offset velocity to 0 we will ensure that<br />
we will use SetMasterEncoder function block to assign an axis to the logical encoder.<br />
3. Assign an Axis to the Logical Encoder in the Program:<br />
In the ladder program we can assign an actual axis to the logical encoder as shown below:<br />
4. Define MultiCamStruct Structure Variables:<br />
Create an Action File: The action file contains all the MultiCamStruct type CAM structures.<br />
Thus all the CAM structures along with their CAM points will be defined in this Action file.<br />
Select the Ladder Program (PLC_PRG) Right Click Add Action:
P a g e | 12 of 25<br />
Name the new Action Choose ST (Structured) as the Language of the new ActionOK:<br />
5. Define MultiCamStruct variables in the Action File:<br />
Go to CAM_Update (Action File):
P a g e | 13 of 25<br />
6. Define CAM_Update Logic:<br />
CAM update logic is a simple logic to get the New Cam Data once a CAM Cycle is complete.<br />
This logic is particularly important for machines which perform cyclic operations e.g. - Such as<br />
10 rotations clockwise and 15 rotations anticlockwise for the motor for doing some operation on<br />
the Rotary table and the operation continues continuously. CAM Update logic can be applied in<br />
the following way in the ladder programs:<br />
Explanation: From the left the NEWCAM variable is a Boolean variable which is toggled at the<br />
end of the each CAM Cycle by the MultiCam block. A switch Boolean variable is being used as<br />
a selector to choose between two MultiCamStruct structures. Each time the NEWCAM variable<br />
is toggled the output of the SEL block is either of the variables multicamstruc_bkd OR<br />
multicamstruc_FWD.<br />
If the switch is false then the mcam variable will load the multicamstruc_bkd structure, if the<br />
switch is true the mcam variable will load the multicamstruc_FWD structure.<br />
CAM_Update is the name of the action file and it is need to be enabled since it contains all the<br />
Cam points defined for both the MultiCamStruct variables.
P a g e | 14 of 25<br />
7. Define MultiCam5 Function Block:<br />
Enable: Accepts a Boolean, Enable needs to be true before executing Start signal<br />
Axis: Name of the SLAVE Axis which is needed to perform CAM Motion<br />
Encoder Id: Transferor of the master encoder code (for example, "LEnc.LogAdr").<br />
Start: Starts the drive motion<br />
WSSelect: A "Warm start" is executed using the input Start = TRUE and the input<br />
WSSelect = TRUE. "Warm start" means that it starts in the middle of a motion sequence<br />
(e.g., after an emergency stop). The FB orients itself to the master position and moves to<br />
the curve position. As soon as the drive position is at the curve position again, the output<br />
SynActive is set. This signal can be used to start the master encoder.<br />
The master encoder must be at a standstill during "warm start".<br />
CSModeAxis: Cold Start Mode Axis<br />
0 = Make no change in the slave position.<br />
1 = Set slave position to first curve point<br />
<br />
<br />
2 = Axis (slave position) moves to the first curve point<br />
3 = Set the slave position to the corresponding curve position (CSModeMaster is<br />
executed first) (V00.15.07 and higher).<br />
CSModeMaster: Cold Start Mode Master<br />
<br />
<br />
<br />
<br />
0 = Make no change in the master position.<br />
1 = Set master position to first curve point<br />
2 = Set master position towards minus infinity<br />
3 = Set the master encoder position to CSMasterPosition from ExtendedInDat<br />
(V00.15.07 and higher)<br />
WSMode: Warm start mode<br />
With MultiCam4() and higher, it is possible to choose whether the FB buffered profile or the<br />
new profile is used on a warm start. Warm start modes 0 to 4 work with the current data
P a g e | 15 of 25<br />
(profiles) that is buffered in the function block. Modes 10 to 14 use the data that corresponds to<br />
the function block inputs.<br />
<br />
<br />
<br />
<br />
<br />
0 = No check, always move<br />
1 = Move to curve position (slave position) if the axis is in the WSWindow<br />
2 = Move forwards only to the curve position<br />
3 = Move backwards only to the curve position<br />
4 = Do not move to the curve position; only display the curve position to the<br />
current master position (output position Y).<br />
WSWindow: Warm start window (axis +/-)<br />
EmergencyDEC If the input Enable = FALSE, progress is stopped with<br />
deceleration EmercencyDEC.<br />
WSVel<br />
Velocity for starting up the warm start position (slave<br />
position).<br />
WSAcc<br />
Acceleration for starting up the warm start position (slave<br />
position).<br />
WSStart<br />
The input starts the motion on the warm start if<br />
WSStart=TRUE.<br />
TXend<br />
Determines the setting of the outputs XHighEnd and<br />
XlowEnd.<br />
TXend is a time value in ms. TXend determines the last<br />
possible transferal of the NewCam signal.<br />
In MultiCam6 (), TXend is limited to 1.5 * program cycle<br />
time.<br />
InstantXLimMax<br />
ExtendedInDat<br />
V00.15.00 and higher<br />
TXend is extended by one program cycle internally in order<br />
that XHighEnd at least gets to TXend before the end.<br />
Abort position of the current motion profile and transferal of<br />
the new motion profile with InstantNewCam.<br />
Contains the parameters for options.<br />
<br />
<br />
<br />
FirstCamNoXLimMin (V00.15.00 and higher)<br />
The flag prevents the XlimMin from being active in<br />
the first curve during cold start. XlimMin is reactivated<br />
on the second curve.<br />
StopPositionSelect, StopPosition (V00.15.00 and<br />
higher)<br />
The option to move to "Stop Position" is now<br />
executed with PosStart4(). By this means, the<br />
momentary curve acceleration at the aborting point is<br />
transferred and used as the starting value for the<br />
positioning of the Stop position.<br />
YEqualCheck (V00.15.02 and higher)<br />
If YequalCheck = TRUE, then either a NewCam or<br />
an InstNewCam is used to check if the Y Start<br />
position of the new curve is the same as the Y End<br />
position of the current curve. If an error occurs,
P a g e | 16 of 25<br />
<br />
<br />
<br />
<br />
NewCam implements a pause at the cycle end of the<br />
current curve, and InstNewCam executes an<br />
immediate stop. The error message "MultiCam<br />
YEqualCheck" is displayed.<br />
StopPositionSelect, StopPosition (V00.15.02 and<br />
higher)<br />
If StartPositionSelect = TRUE, the StartPosition is<br />
run on Start, and the negative edge of Start is<br />
awaited. Thereafter, there can be normal startup with<br />
StartPositionSelect = FALSE.<br />
DisableLowEnd, DisableHighEnd (V00.15.02 and<br />
higher)<br />
DisableLowEnd prevents the addition of a new curve<br />
at the lower end of the running curve with NewCam<br />
or InstantNewCam.<br />
DisableHighEnd prevents the addition of a new curve<br />
at the upper end of the running curve with NewCam<br />
or InstantNewCam.<br />
When setting the NewCam input in standstill with a<br />
physical master encoder, the function block may<br />
attempt to add the new curve at the lower end, as it<br />
just sees a small negative velocity at this moment in<br />
time. With DisableLowEnd, the eXLimMinMode<br />
CAM_LIMIT_MODE of the current curve stays on<br />
CAM_LIMIT_MODE_REVERSE and thus prevents<br />
the addition of the new curve.<br />
The same is true of the upper end of the curve with<br />
DisableHighEnd.<br />
xInWindowCheckwithoutLimits (V00.20.10 or<br />
higher)<br />
The flag switches on the evaluation for the<br />
InWSWindow output in warm start modes 2, 12, 3<br />
and 13 even beyond the period limit.<br />
diInWindowMode (V00.20.10 or higher)<br />
Previously the InWSWindow output was not set in<br />
warm start mode 4 and 14. This output is now set<br />
depending on diInWindowMode. The parameter<br />
symbolizes the warm start mode that should actually<br />
be executed next (warm start mode = 0, 1, 2, 3, 10,<br />
11, 12 or 13). There is no error message when the<br />
drive is not in the warm start window.<br />
NewCam<br />
Starts a new motion profile based on the current motion<br />
profile<br />
V00.15.00 and higher<br />
NewCamDirectAccept: = TRUE: The synchronization of the<br />
NewCam signal with XLowEnd and XHighEnd is canceled.<br />
NewCam is accepted immediately. The NewCam signal can
P a g e | 17 of 25<br />
InstantNewCam<br />
MultiCamData<br />
therefore come later. With NewCam, it is now only<br />
necessary to set a program cycle + SERCOS-Task<br />
(Parameter CycleTime) before the end of the curve.<br />
Aborts the current motion profile with InstantXLimMax and<br />
starts a new motion profile.<br />
Information about the curve progression (MultiCamStruct<br />
structure).<br />
The input was changed from a POINTER to a<br />
VAR_IN_OUT variable.<br />
For the preliminary level of CAM Motion programming variables InstantXLimMax,<br />
ExtendedInDat etc are too complicated to understand. Thus for a simplistic approach towards<br />
understanding the MultiCam block the example Multicam5 block with appropriate inputs is<br />
shown below:<br />
Notice that the SLAVE Axis is ‘Axis_1” here and the Encoder Id is being used as the logical<br />
address of the Logical Encoder.
P a g e | 18 of 25<br />
8. Define Motion Block for the Master Axis:<br />
Motion to the master axis is needed to be defined in order to move the slave axis, because<br />
each cam point in the MultiCamStruct structure variable consist of a X and Y values and if X<br />
value remains zero the slave will not move. The Motion block for the slave can be defined as<br />
EndlessFeed Motion:<br />
Notice that the VEL parameter for the block specifies the velocity for the MASTER Axis<br />
which in this case is ‘Axis’ and the SLAVE Axis is ‘Axis_1’.
P a g e | 19 of 25<br />
Sample CAM Motion Program:<br />
Ladder Program: PLC_PRG
Program continued on next page…<br />
P a g e | 20 of 25
P a g e | 21 of 25
Action File: CAM_Update<br />
P a g e | 22 of 25
P a g e | 23 of 25<br />
CAM Motion Programming Task<br />
Task 1. Create a new project in EPAS4 Software that does exactly the same CAM motion<br />
as described in the Sample CAM Motion Program. Use the C-200 PacDrive Controller<br />
System along with MC-4 Servo Drive to drive the two axes.<br />
Task 2. Create a second new project that does the CAM Motion which is described below:<br />
1 st Variable:<br />
1. Create two MultiCamStruct variables each would have 4 CAM points<br />
described as:<br />
CAM Point X Y<br />
0 0 0<br />
1 90 1800<br />
2 180 0<br />
3 360 3600<br />
2 nd Variable:<br />
CAM Point X Y<br />
0 0 0<br />
1 90 -1800<br />
2 180 0<br />
3 360 -3600<br />
The CAM/ Slave Axis should execute 1 CAM Structure and then in the next cycle it should<br />
execute the other CAM structure. The CAM Profile for both the variables is shown below:<br />
1st Variable<br />
2nd Variable<br />
4000<br />
3500<br />
3000<br />
2500<br />
2000<br />
1500<br />
1000<br />
500<br />
0<br />
0 100 200 300 400<br />
0<br />
-500<br />
-1000<br />
-1500<br />
-2000<br />
-2500<br />
-3000<br />
-3500<br />
-4000<br />
0 100 200 300 400<br />
The VEL of the MASTER should not exceed 25, ACC should not exceed 100, DEC should not<br />
exceed 100.<br />
Report: Include the print of the ladder program of both the task in your report.