# Menu 35 − AMC Cam

Mode: RFC‑S

Cam

Parameter | 35.001 AMC Cam Start Index
--- | ---
Short description | Defines which index of the cam table the AMC cam controller starts at
Mode | RFC‑S
Minimum | 0 | Maximum | 19
Default | 0 | Units |
Type | 8 Bit User Save | Update Rate | 4ms read
Display Format | Standard | Decimal Places | 0
Coding | RW

Cam input
The cam is enabled when the motion controller is enabled and AMC Reference Select (34.007) is changed to a value of 3. When enabled AMC Cam Index (35.007) and AMC Cam Position In Segment (35.008) are set to AMC Cam Start Index (35.001) and AMC Cam Start Position In Segment (35.002). If AMC Cam Start Index (35.001) ≥ AMC Cam Size (35.003) or AMC Cam Position In Segment (35.008) is larger than the input position for the start segment then a CAM.001 trip is initiated. This causes the drive to go into the trip state and the motion controller is disabled.

Any change of AMC Master Position (32.004) is used to move forwards (positive change of master position) or backwards (negative change of master position) through the cam table. The number of input user units for each segment are defined in the cam table parameters (AMC Cam Table In 0 (36.004), AMC Cam Table In 1 (36.007), etc.) and AMC Cam Table In 0 (36.004) corresponds to segment 0. AMC Cam Index (35.007) is incremented when the end of the segment is reached (forwards) or decremented when the beginning of the segment is reached (backwards). When the end of the last segment is reached in the forwards direction the cam index wraps around to the start of the next cam table and when the start of the first segment is reached in the reverse direction the index wraps around to the end of the next cam table. AMC Cam Mode (35.012), AMC Cam Start Index (35.001) and AMC Cam Size (35.003) are used to configure the actions taken when the cam wraps around.

It should be noted that if the change of input position causes AMC Cam Index (35.007) to change by more than two segments then a CAM.002 trip is initiated. In addition, the maximum change of master position is limited to 1,000,000,000 user units and a CAM.004 trip is initiated if the maximum value is exceeded.

Cam Output
The cam table parameters provide an output value and an interpolation method for each cam segment. AMC Cam Table Out 0 (36.005) and AMC Cam Table Interpolation 0 (36.006) correspond to segment 0, etc. As AMC Cam Position In Segment (35.008) moves over the range from 0 to AMC Cam Table In 0 (36.004) the output changes from 0 to AMC Cam Table Out 0 (36.005). The change of position is fed out of the cam controller, the cam ratio is applied and the result is accumulated in the profile input integrator. Therefore for a given change of input position defined by AMC Cam Table In 0 (36.004) there is a change of output position defined by AMC Cam Table Out 0 (36.005) multiplied by the cam output ratio.

The interpolation method for each segment defines the relationship between the input and output positions. The interpolation functions are designed so that there are no speed discontinuities at segment boundaries, and so the rate of change of output position with respect to input position is the same either side of a segment boundary. It is the responsibility of the user to ensure that the rate of change of the output is 0 at the end of the last segment to prevent a speed discontinuity as the cam table wraps round. The diagram below shows an example of interpolation within the Nth segment.

x is AMC Cam Position In Segment (35.008)

y is the output position

ΔXN is the cam input table value for the segment

ΔYN is the cam output table value for the segment

WN is dy/dx at the end of this segment

WN-1 is dy/dx at the end of the last segment

The following coefficients are calculated for each segment based on the rate of change of position at the end of the previous segment, where AN is the change of position over segment N which would be due to WN-1 and BN is the change of position to be added to AN to acheive the required movement.

AN = WN-1 ΔXN

BN = ΔYN - AN

The output position is calculated using the following function.

y = (AN X) + (BN f(X))

where X is the input position as a proportion of the total input position over the segment, i.e. X = x/ΔXN. The term AN X produces a constant rate of change of output position against input position, and so if the input speed is constant this will provide a constant output speed that is equivalent to the speed at the start of the segment. This term prevents speed discontinuities between segments. The term BN f(X) produces the required change of output position ΔYN over the segment using the required interpolation function f(X). Different functions can be used to give different types of interpolation, but f(0) must be 0 and f(1) must be 1 to give the correct output position change over the segment. The rate of change of output position with respect to the input position is given by

dy/dx = AN/ΔXN + BN df(X)/dx

It should be noted that the rate of change used internally by the motion controller is scaled by 256 and is rounded to the nearest integer. If the magnitude of the rate of change (dy/dx) at the end of any segment (WN) exceeds 231/256 a CAM.003 trip is initiated. This causes the drive to go into the trip state and the Advanced Motion Controller will be disabled.

Interpolation functions with no speed change
If WN = WN-1 then the speed at the start and end of the segment will be the same for a constant input speed. If the whole cam table is filled with segments that use an interpolation method where this is true, then the speed will return to 0 at the end of every segment. Such a function can be selected if the cam table interpolation parameter for a segment is set to 0 (Cos1). The following function is used:

f(X) = X - (1/(2π)) sin (2πX)

As already defined X = x / ΔXN, and so

f(X) = x/ΔXN - (1/(2π)) sin (2πx / ΔXN)

Differentiating with respect to x gives

df(X)/dx = (1 - cos (2πX)) / ΔXN

df(0)/dx = df(1)/dx = 0, and so WN = WN-1. The diagram below shows this function where WN-1 = WN = 0.

It should be noted that if ΔYN = AN then the output will be a constant speed for a constant speed input.

Interpolation functions that give a speed change
If it is not a requirement to have the same speed at the start and end of a segment then a function can be used where df(0)/dx = 0 and df(1)/dx = 2/ΔXN. In this case WN = AN + 2BN/ΔXN. One of two functions can be selected by setting the cam table interpolation parameter for a segment to 1 (Square) or 2 (Cos2). These are described below.

For square interpolation f(X) = X2 which gives a linear change of dy/dx. The diagram below shows the position and speed for an acceleration from 0. If ΔYN/ ΔXN is less than WN-1 at the start of the segment then dy/dx will fall over the segment and WN will be less than WN-1.

For the Cos2 interpolation f(X) = X - (1/π) sin (πX) which gives sinusoidal changes in dy/dx. The diagram below shows the position and speed for an acceleration from 0. If ΔYN/ ΔXN is less than WN-1 at the start of the segment dy/dx will fall over the segment and WN will be less than WN-1.

Initial speed segment
One cam segment (AMC Cam Table In -1 (36.001), AMC Cam Table Out -1 (36.002), AMC Cam Table Interpolation -1 (36.003)) is provided to give an initial speed to the cam output. When the cam is enabled this segment becomes active and its output is added to the output provided by the main cam table. If AMC Cam Table Interpolation -1 (36.003) is set for Square or Cos2 interpolation and the end of this segment is passed in the forward direction the output speed is maintained by applying a ratio of 2ΔY/ ΔX to the change of AMC Master Position (32.004). If the initial master speed is negative the input wraps around the end of the segment and will continue until the start of the segment is reached. Again the output speed is then maintained by applying a ratio of 2ΔY/ ΔX to the change of AMC Master Position (32.004). AMC Cam Table Interpolation -1 (36.003) can also be set to linear interpolation, and if this is selected the initial speed segment always applies a ratio of ΔY/ ΔX to the change of AMC Master Position (32.004). If AMC Cam Table In -1 (36.001) is left at its default value of 0 then this initial segment is disabled and no position is added to the main cam system.

Parameter | 35.002 AMC Cam Start Position In Segment
--- | ---
Short description | Defines the position in segment that the AMC Cam controller uses when the cam is enabled
Mode | RFC‑S
Minimum | 0 | Maximum | VM_AMC_POSITION_UNIPOLAR
Default | 0 | Units | UU
Type | 32 Bit User Save | Update Rate | 4ms read
Display Format | Standard | Decimal Places | 0
Coding | RW, VM

See AMC Cam Start Index (35.001).

Parameter | 35.003 AMC Cam Size
--- | ---
Short description | Defines the number of segments from the cam table that are used to define the cam profile
Mode | RFC‑S
Minimum | 1 | Maximum | 20
Default | 1 | Units |
Type | 8 Bit User Save | Update Rate | 4ms read
Display Format | Standard | Decimal Places | 0
Coding | RW

AMC Cam Size (35.003) defines the number of segments from the cam table that are used to define the cam profile.

Parameter | 35.004 AMC Cam Single Shot Enable
--- | ---
Short description | Set to 1 to disable the cam system from running continuously
Mode | RFC‑S
Minimum | 0 | Maximum | 1
Default | 0 | Units |
Type | 1 Bit User Save | Update Rate | 4ms read
Display Format | Standard | Decimal Places | 0
Coding | RW

When AMC Cam Single Shot Enable (35.004) = 0 the cam will run until it is deselected. If AMC Cam Single Shot Enable (35.004) = 1 the cam will stop when either end of the cam table is reached. For single shot operation the following apply:

1. The cam function cannot be started unless AMC Cam Complete (35.010) = 0. The cam function can be restarted again by clearing AMC Cam Complete (35.010). Note that AMC Cam Complete (35.010) is cleared automatically when AMC Cam Single Shot Enable (35.004) is enabled.
2. Once the cam function has stopped it can be restarted by changing AMC Reference Select (34.007) to a value other than 3 (cam) and then back to 3, or by disabling and re-enabling the motion controller.
3. Once the cam function has stopped it can be restarted by a freeze event (see AMC Action On Event (34.008)) provided the freeze event occurs in a sample after the one in which the cam function stopped.
4. The cam function is not stopped the first time it wraps around in reverse if it is selected or restarted with AMC Cam Start Index (35.001) = 0 and AMC Cam Start Position In Segment (35.002) = first segment.

Note that when AMC Cam Single Shot Enable (35.004) is enabled the cam will stop at the beginning of the first segment when running forwards or the end of the last segment when running in reverse.

Parameter | 35.005 AMC Cam Output Ratio Numerator
--- | ---
Short description | Defines the numerator for the ratio that is applied to the change of output position from the Cam function
Mode | RFC‑S
Minimum | 1 | Maximum | 2147483647
Default | 1000 | Units |
Type | 32 Bit User Save | Update Rate | Background read
Display Format | Standard | Decimal Places | 0
Coding | RW

The Cam output ratio (AMC Cam Output Ratio Numerator (35.005) / AMC Cam Output Ratio Denominator (35.006)) is applied to the change of output position from the Cam function before it is accumulated by the profile input integrator.

Parameter | 35.006 AMC Cam Output Ratio Denominator
--- | ---
Short description | Defines the denominator for the ratio that is applied to the change of output position from the Cam function
Mode | RFC‑S
Minimum | 1 | Maximum | 2147483647
Default | 1000 | Units |
Type | 32 Bit User Save | Update Rate | Background read
Display Format | Standard | Decimal Places | 0
Coding | RW

See AMC Cam Output Ratio Numerator (35.005).

Parameter | 35.007 AMC Cam Index
--- | ---
Short description | Displays which index in the Cam table the Cam controller is using
Mode | RFC‑S
Minimum | 0 | Maximum | 19
Default |  | Units |
Type | 8 Bit Volatile | Update Rate | 4ms write
Display Format | Standard | Decimal Places | 0
Coding | RO, ND, NC, PT

See AMC Cam Start Index (35.001).

Parameter | 35.008 AMC Cam Position In Segment
--- | ---
Short description | Displays the position in the segment that the cam controller is using
Mode | RFC‑S
Minimum | 0 | Maximum | VM_AMC_POSITION_UNIPOLAR
Default |  | Units | UU
Type | 32 Bit Volatile | Update Rate | 4ms write
Display Format | Standard | Decimal Places | 0
Coding | RO, VM, ND, NC, PT

See AMC Cam Start Index (35.001).

Parameter | 35.009 AMC Cam Final Speed Coefficient
--- | ---
Short description | Displays the Final Speed Coefficient that the cam controller uses
Mode | RFC‑S
Minimum | -21474836.48 | Maximum | 21474836.47
Default |  | Units | UU
Type | 32 Bit Volatile | Update Rate | Background write
Display Format | Standard | Decimal Places | 2
Coding | RO, ND, NC, PT

AMC Cam Final Speed Coefficient (35.009) shows the value of AK which is calculated using the rate of change at the end of the last segment and ΔXK, i.e. AK = WN ΔXK where N = AMC Cam Size (35.003) and K is the first segment in the cam table. Note that the first segment is always segment 0 when AMC Cam Mode (35.012) = 0 or AMC Cam Start Index (35.001) when AMC Cam Mode (35.012) = 1.

When AMC Cam Force Repeat (35.011) is enabled the rate of change at the boundary between the first and last segment is set to zero when the cam is running forwards or to the rate of change at the end of the last segment when running backwards. This forces the interpolated output position to be identical when the cam repeats in either direction, but will introduce a speed discontinuity at the boundary of the first and last segment if AMC Cam Final Speed Coefficient (35.009) is not zero. An example of the speed discontinuity which can occur when AMC Cam Force Repeat (35.011) is enabled and the rate of change (dy/dx) at the end of the last segment is not zero is shown in the figure below.

If AMC Cam Force Repeat (35.011) is disabled the rate of change calculated at the end of the last segment is used to calculate the interpolated position in the next segment. This removes the discontinuity caused by the rate of change at the end of the last segment but will cause the interpolated position between segment boundaries to change when the cam repeats and the rate of change at the end of the last segment is not zero. The effect of turning AMC Cam Force Repeat (35.011) off is shown in the figure below.

In this example the speed is continuous but the interpolated position between segment boundaries has changed. This is caused by the rate of change used at the beginning of segment 0 in the second cam which is not forced to zero when AMC Cam Force Repeat (35.011) is off. Note that the rate of change used to calculate the position in the first segment of the first cam is always zero. This mode is intended to be used when writing cam table parameters (more than 20 points) from a controller or AMC Cam Mode (35.012) is set to 2 and the rate of change at the end of the last segment is not zero.

Parameter | 35.010 AMC Cam Complete
--- | ---
Short description | Displays when the cam controller reaches the end of the cam table
Mode | RFC‑S
Minimum | 0 | Maximum | 1
Default | 0 | Units |
Type | 1 Bit Volatile | Update Rate | 4ms write
Display Format | Standard | Decimal Places | 0
Coding | RW

AMC Cam Complete (35.010) is set to one when the cam function wraps around either end of the cam table. AMC Cam Complete (35.010) is not set the first time the cam wraps around the first segment (running in the reverse direction) if AMC Cam Start Position In Segment (35.002) = 0 and AMC Cam Start Index (35.001) = first segment. Note that the first segment is always set to segment 0 when AMC Cam Mode (35.012) = 0 or AMC Cam Start Index (35.001) when AMC Cam Mode (35.012) = 1.

Parameter | 35.011 AMC Cam Force Repeat
--- | ---
Short description | When set to 1, the rate of change of position at the boundary between the first and last segment is set to zero when the cam is running forwards, or to the rate of change at the end of the last segment when running backwards.
Mode | RFC‑S
Minimum | 0 | Maximum | 1
Default | 1 | Units |
Type | 1 Bit User Save | Update Rate | 4ms read
Display Format | Standard | Decimal Places | 0
Coding | RW, BU

See AMC Cam Final Speed Coefficient (35.009).

Parameter | 35.012 AMC Cam Mode
--- | ---
Short description | Defines the behaviour when the cam wraps around
Mode | RFC‑S
Minimum | 0 | Maximum | 1
Default | 0 | Units |
Type | 8 Bit User Save | Update Rate | 4ms read
Display Format | Standard | Decimal Places | 0
Coding | RW

AMC Cam Mode (35.012) is used to select between the functionality shown in the table below.

AMC Cam Mode (35.012) | AMC Cam Index (35.007) when the cam is enabled | AMC Cam Index (35.007) when the cam wraps around the last segment in the forward direction | AMC Cam Index (35.007) when the cam wraps around the first segment in the reverse direction | Parameter update
0 | AMC Cam Start Index (35.001) | 0 | AMC Cam Size (35.003) - 1 | AMC Cam Start Index (35.001) and AMC Cam Size (35.003) are updated when the cam is disabled
1 | AMC Cam Start Index (35.001) | AMC Cam Start Index (35.001) | AMC Cam Start Index (35.001) + AMC Cam Size (35.003) - 1 | AMC Cam Start Index (35.001) and AMC Cam Size (35.003) are updated when the cam is disabled and when the cam wraps around the last segment in either direction

When AMC Cam Mode (35.012) = 1 the last index in the cam table (AMC Cam Start Index (35.001) + AMC Cam Size (35.003) - 1) is automatically limited to the maximum value (i.e. segment 19). For example, if AMC Cam Start Index (35.001) = 10 and AMC Cam Size (35.003) = 20 the cam would operate between index 10 and 19.

When AMC Cam Mode (35.012) = 0 the cam will run between index 0 and AMC Cam Size (35.003) - 1. The figure below shows a trapezoidal cam with three segments (i.e. ramp in, running and ramp out). In single shot mode the cam runs once and stops at the beginning of the first segment (i.e. AMC Cam Index (35.007) = 0 and AMC Cam Position In Segment (35.008) = 0).

In some applications (e.g. rotary knife) the ramp in and ramp out segments are only required at the beginning and end of a process. When AMC Cam Mode (35.012) = 1 it is possible to change AMC Cam Start Index (35.001), AMC Cam Size (35.003) and AMC Cam Single Shot Enable (35.004) while the cam is running to produce the cam profile shown below, i.e. the cam remains in the running segment until the ramp out is required.

Note that any parameter in the AMC Cam (35) or AMC Cam Table (36) menus must be updated at least 4ms before the cam enters the segment in which the new value is applied, e.g. when running forwards AMC Cam Size (35.003) must be updated 4ms before the end of the last segment is reached.