Modes of Motion Zone: Electronic CAM
By John Minotti, Application Engineer
In this article, Electronic CAM (ECAM) is discussed. ECAM mimics the behavior of a mechanical CAM by driving a slave axis along a predetermined profile based on the position of a master axis. As a result, ECAM is well suited
for applications that require an axis to follow a repeatable, non-linear profile coordinated to the position of another axis. This differs
from electronic gearing where the relationship between the axes is a fixed ratio such as the X-axis always moving half the distance of the Y-axis.
With ECAM, the relationship between the master and slave axes is nonlinear where the master axis provides reference points that coordinate with the location of the slave axis. This is done by building a table of positions that define the motion profile that the slave will follow. As the master axis passes through user defined position intervals, the slave will simultaneously reach the respective slave positions assigned by the table commanding it to follow the desired motion profile. This behavior is illustrated in Figure 1, where the position of the slave axis, graphed along the vertical axis, is driven to the locations shown in Table 1 as the master axis passes through each position interval, graphed along the horizontal axis.
Dual ECAM
Using a single ECAM table is adequate for most applications requiring nonlinear motion coordination. However, some applications require the profile of a slave axis to change between ECAM cycles, requiring two ECAM tables. A specialized ECAM mode, called Dual ECAM, allows the slave axis to alternate between two ECAM tables every other cycle. This results in the slave axis changing its motion profile every other ECAM cycle. Single table ECAM is available on all Galil controllers as a standard feature. Dual ECAM comes standard with Galil Accelera controllers and as an option on Galil’s other controllers.
ECAM Implementation
Programming ECAM using Galil controllers requires three parameters to be specified:
1. ECAM modulus (EM) - the displacement of the master axis that corresponds to one complete cycle of the ECAM table.
2. ECAM interval (EP) – the displacement of the master axis between each of the slave positions.
3. ECAM table (ET) - the table of slave axis positions.
The first step in programming ECAM is to build the ECAM table that defines the profile of the slave axis. Next, the position increment of the master that will pass between each slave position must be defined. With the interval and number of ECAM table positions, the modulo can be calculated as follows:
EM=EP* ETdim
Where:
EM=Master Modulo
EP=Master Interval
ETdim=ECAM Table Dimension or Number of ECAM Table Points
One behavior of ECAM worth noting is that the master interval corresponds to absolute position increments. This means that regardless of master axis direction or speed, the slave axis will follow accordingly, essentially coordinating with any speed and
direction of the master.
Example ECAM Application
An example of an application requiring Dual ECAM is a stamping machine where metal is fed continuously and two different patterns are stamped along the face of the sheet. Dual ECAM is necessary because the stamping process operates continuously and requires two different profiles to be stamped into the metal. Dual ECAM allows switching between the two profiles without disrupting the continuous feed of the metal sheet.
For this example, the X-axis is the slave (stamping apparatus) and the Y-axis is the master (sheet metal feed). The Y-axis is geared to a dummy axis Z with a ratio of 1. The Z-axis is used to mimic a constant feedback for the master to follow. In an actual system, the Z feedback could be a production line, motor velocity or anything that the ECAM needs to be coordinated with. The master axis can also simply be an axis under Galil control or can be feedback from an external source. These last two options eliminate the need for the dummy axis.
The Dual ECAM mode not only allows two discrete ECAM profiles to be prescribed, but also allows the ECAM profiles to be changed without disengaging the ECAM mode or stopping motion. This is accomplished by loading a new ECAM table during the execution
of the other. Dual ECAM builds the two ECAM tables as standard Galil arrays or ECAM arrays stored in standard array space. As the code executes, it loads the other array in alternating order into the ECAM table. Alternating the ECAM tables creates two distinct motion profiles for the slave axis to follow.
The Galil DMC code used for this application is shown at the end of this article. The parameters in the program are defined as follows:
Etbl1 and Etbl2: The ECAM Array designations.
VI: Termination variable, which upon changing its value will execute a termination loop to stop the program in a predefined manner. This is necessary to allow for any command to start properly upon subsequent execution.
Master1, Master2, Slave1, Slave2: Variables used to set the controller modulus and adjust the master interval accordingly and on the fly.
#W0: Program loop that is used to ensure that the ECAM has been engaged before starting the execution of the ECAM table.
#W1: Program loop that is used to hold code execution of the next ECAM table until the previous cycle has been completed. This is done by stalling the code until half of the previous ECAM table has been executed. After that, an ECAM disengagement point (90% of the ECAM table) is set and the code waits for disengagement before proceeding.
The program works by initializing and running the first ECAM table in standard ECAM mode. The ECAM tables are loaded by referencing the ECAM arrays. After the first ECAM profile has been executed, the ECAM mode is disengaged per the sequence and timing of the #W0 and #W1 loops. These loops are necessary to wait for certain events to be completed before proceeding. This eliminates any race conditions caused by code executing too fast after the ECAM table has been disengaged.
After the ECAM mode has been disengaged, the modulus for the proceeding table must be entered. Following the loading of the ECAM modulus, the second ECAM table is loaded and executed in the same manner as the first table. In addition to prescribing the two discrete ECAM profiles, this code allows for the ECAM profiles to be changed without disengaging the ECAM mode or stopping the motion. This is easily done by issuing a new point or points to one of the ECAM arrays. These points will then be referenced during the execution of the next cycle, which changes the profile. The ECAM modulus can also be changed without stopping the motion code by changing the value of the variables Master1, Master2, Slave1 and Slave2. These variables define the master and slave ECAM modulus (EM). The code automatically adjusts the ECAM interval (EP), per the modulo setting.
In this example, there are a series of ECAM table points of 0. This provides a dwell in the ECAM function while the new ECAM table is loaded. This dwell is necessary because the controller’s processor is occupied with the loading of the new table which would stall the ECAM profiling at the last point reached. By including this dwell period, the axis can be returned to a predicted and controlled location during the loading of the new table. The necessary dwell time depends on table size and master encoder velocity, both of which will vary from application to application. For example, running this code as a single thread on a DMC-4020 Accelera controller, a 10-point ECAM table required just 1.95 ms to load. With a 100-point ECAM table only 4.9 ms was necessary. For the maximum size of 257 ECAM points, only 12.5 ms was needed.

Figure 2 illustrates the profile that results from the use of Dual ECAM functionality, following the positions listed in Table 2 and Table 3.

View Dual-ECAM DMC Code
Conclusion
The ECAM mode of motion is useful for applications where a slave axis needs to follow a master axis based on a prescribed table. Dual ECAM allows for two different tables to be followed without pausing motion. Galil’s motion controllers provide the ECAM mode of motion as a standard feature. Dual ECAM is a standard feature on Accelera controllers. For additional information on ECAM and Dual ECAM refer to Application note 2510 and 2441 at:
http://www.galilmc.com/support/appnotes/accelera/note2510.pdf
and:
http://www.galilmc.com/support/appnotes/optima/note2441.pdf
|