APIs, concepts, guides, and more
Camming

Convert rotary motion into linear motion, or vice versa.

🔹 What is Camming?

Camming refers to the use of a cam, where cams are mechanical devices with a shaped profile that are used to transmit motion or force in a controlled manner. They are often used to convert rotary motion into linear motion, or vice versa.

In RMP (our motion controller) context, camming is a mode in which controls follow a cam profile curve to derive slave-axis displacement from master-axis position, whether linear or rotary. It is a nonlinear coordinated motion between two axes, and normally, one axis is linear while the other is rotational.

🔹 Why use Camming?

In a master-slave motion system, there are at least two axes and the position of each axis is measured by the motion controller.

Master Axis: this axis/motor may or may not be controlled by the motion controller.

Slave Axis: the motion controller controls the position of this axis/motor as a function of the position of the master axis.

The servo controller will take the master rotational or linear information from one axis and then follow the master to a predefined nonlinear path. The operation is cyclical and both axes will start each cycle at the same 0 position reference.

See also → Cam: A projection on a rotating part in machinery, designed to make sliding contact with another part while rotating and to impart reciprocal or variable motion to it.

A mechanical cam consists of a shaped rotating form and a follower that tracks its surface.

In the image below, the Slave Axis/Motor is moving on the y-axis and the Master Axis/Motor is moving around the z-axis.

Image

You can achieve the same relationship between the master and slave positions using electronic control.

The simplest way is to define the relationship between the master and slave positions as a series of linear segments.

Image

For each segment, you need to define the distance that the master will move during the segment and the position that the slave will achieve at the end of the segment.

This cam profile will be represented by the following cam table.

Note - Cam segments are numbered from zero

Note
Master motion happens in a RELATIVE fashion.
Slave motion happens in an ABSOLUTE fashion.
Camming does not use the given axis user units but instead works in encoder ticks. If you want to work in user units instead of encoder ticks simply multiply by your user unit (i.e. the number of ticks per unit).
Warning
A RELATIVE MOVE of 25 will move the axis 25 units ahead of the current position, rather than to position 25.
An ABSOLUTE MOVE of 25 will move the axis to position 25 rather than 25 units ahead of the current position.

So, in Segment 0, the Master Axis will move 50 units and the Slave Axis will move 200 units.

The speed of the Slave Axis gets computed so it can achieve 200 units at the same time the Master Axis achieves the 50 units of Segment 0.

The same is true for all the other segments

🔹 When to use Camming?

Here are a few examples of when you might consider using the RMP camming feature in your application:

  1. Industrial automation: If you need to control the motion of mechanical components in an industrial automation system, such as a conveyor belt or a robotic arm, you may consider using cams to transmit motion in a precise and repeatable manner.
  2. Motion simulation: If you need to create a realistic and controllable movement for training, entertainment, or research purposes, you may consider using cams in a motion simulator.
  3. Robotics: If you need to control the movement of robotic joints or limbs, you may consider using cams to transmit motion in a precise and repeatable manner.
  4. Mechanical engineering: If you need to actuate valves, control pumps, or transmit power in a mechanical system, you may consider using cams to transmit motion and force in a controlled manner.

🔹 Use Cases

Automotive Manufacturing Company

A manufacturing company that produces automotive parts uses a conveyor belt system to transport parts through various stages of production. The conveyor belt system includes a series of mechanical arms that lift and rotate the parts as they move along the belt. To control the motion of these mechanical arms, the company uses cams that transmit rotary motion from a motor to linear motion in the arms.

The cams are designed with a specific profile that allows the arms to move in a precise and repeatable manner, ensuring that the parts are properly positioned at each stage of production. The use of cams in this application allows the company to achieve precise and repeatable motion control, improving the efficiency and accuracy of their production process.

Robotic Arms in Food Processing Facility

A food processing facility uses a series of robotic arms to sort and package food items. The robotic arms are equipped with grippers that can open and close to grasp and release food items. To control the movement of the grippers, the facility uses cams that transmit rotary motion from a motor to linear motion in the grippers.

The cams are designed with a specific profile that allows the grippers to open and close in a precise and repeatable manner, ensuring that the food items are properly sorted and packaged. The use of cams in this application allows the facility to achieve precise and repeatable motion control, improving the efficiency and accuracy of their food processing operations.

📜 Sample Code

  • C#

    /* This sample demonstrates how to command nonlinear coordinated motion between two axes.
    The follower axis position is controlled as a function of the moving axis position.
    Moving Axis: may or may not be controlled by the motion controller.
    Follower Axis: controlled by the motion controller as a function of the moving axis.
    */
    using RSI.RapidCode; // RSI.RapidCode.dotNET;
    Console.WriteLine("📜 Camming");
    // set sample config params
    const double MOVING_POSITION = 25; // total distance to move on moving axis
    // get rmp objects
    try
    {
    Helpers.CheckErrors(controller);
    // get axes
    Axis movingAxis = controller.AxisGet(Constants.AXIS_0_INDEX);
    Helpers.CheckErrors(movingAxis);
    Axis followerAxis = controller.AxisGet(Constants.AXIS_1_INDEX);
    Helpers.CheckErrors(followerAxis);
    // configure phantom axes
    Helpers.PhantomAxisReset(movingAxis);
    Helpers.PhantomAxisReset(followerAxis);
    // enable phantoms to keep commanded position after motion done
    movingAxis.AmpEnableSet(true);
    followerAxis.AmpEnableSet(true);
    // cam profile - relative moving axis distances and absolute follower positions
    double[] movingAxisDistances = [4, 8, 12]; // relative distances on moving axis (x-axis) (4 + 8 + 12 = 24)
    double[] followerAxisPositions = [10, 20, 15]; // absolute positions for follower axis (y-axis)
    // command cam motion on follower before moving axis starts
    followerAxis.MoveCamLinear(
    masterAxisNumber: movingAxis.NumberGet(),
    masterFeedbackSource: RSIAxisMasterType.RSIAxisMasterTypeAXIS_COMMAND_POSITION, // use COMMAND for phantoms, ACTUAL for real axis
    masterDistances: movingAxisDistances,
    slavePositions: followerAxisPositions,
    pointCount: movingAxisDistances.Length);
    // command motion on moving axis
    movingAxis.MoveRelative(MOVING_POSITION);
    // wait for cam motion to complete
    followerAxis.MotionDoneWait();
    // print results
    Console.WriteLine($"Moving axis final position: {movingAxis.CommandPositionGet()}");
    Console.WriteLine($"Follower final position: {followerAxis.CommandPositionGet()}");
    // cleanup
    Helpers.AbortMotionObject(followerAxis);
    Helpers.AbortMotionObject(movingAxis);
    }
    // handle errors as needed
    finally
    {
    controller.Delete(); // dispose
    }
    Constants used in the C# sample apps.
    Definition _constants.cs:3
    const int AXIS_0_INDEX
    Default: 0.
    Definition _constants.cs:11
    const int AXIS_1_INDEX
    Default: 1.
    Definition _constants.cs:12
    void MoveCamLinear(int32_t masterAxisNumber, RSIAxisMasterType masterFeedbackSource, const double *const masterDistances, const double *const slavePositions, int32_t pointCount)
    Enable this Axis to be linear follower (slave) using an electronic cam.
    void MoveRelative(double relativePosition, double vel, double accel, double decel, double jerkPct)
    Command a relative point-to-point S-Curve motion.
    Represents a single axis of motion control. This class provides an interface for commanding motion,...
    Definition rsi.h:5863
    static MotionController * Get()
    Get an already running RMP EtherCAT controller.
    Represents the RMP soft motion controller. This class provides an interface to general controller con...
    Definition rsi.h:800
    int32_t MotionDoneWait()
    Waits for a move to complete.
    int32_t AmpEnableSet(bool enable, int32_t ampActiveTimeoutMilliseconds=AmpEnableTimeoutMillisecondsDefault, bool overrideRestrictedState=false)
    Enable all amplifiers.
    int32_t NumberGet()
    Get the axis number.
    RSIAxisMasterType
    Sources available to a slave Axis for electronic gearing & camming.
    Definition rsienums.h:1218
    Helpers namespace provides utility functions for common tasks in RMP applications.
    Definition helpers.h:21