Modifying a curve on the fly

The attached project demonstrates how to update a curve on the fly, while it is running. The project includes one user program. It uses curve data from the variable table. It is intended for a testing application where many cycles of the curve are being run.

The key points to making this work were:

  • Running the curve based on a virtual master.
  • Setting the virtual axis to rotary with the Position Unwind the same as the curve length.
  • Setting the Curve Start options such that the curve is absolute in the curve axis and the master axis.
  • Using a Transition Rate command so that when restarting the curve (which will apply the new curve), the axis seamlessly start on the new curve at the right location.
  • Adding some logic to keep track of the total number of cycles, since the axis Cycles status is reset each time a Curve Start command is sent.

To update a curve on the fly:

  • Run the StartCurve program, which will start the curve.
  • In the Variable Table, change one of the curve data points (if you are in RMCTools, use the Monitor tab). The program will automatically detect the changed data, and when the next curve cycle is reached, it will make a new curve from the changed data and begin using that.

When changing data, the program will make sure that the total number of requested cycles is not affected. The project uses a 50-point curve. The number of curves should be reasonably easily modified.
ChangeCurveOnTheFlyAdvanced.rmcproj (60.7 KB)