Innovation in Motion

Rockwell Automation Integration

Step 18

Automatic Tuning FORCE Procedure (Manual Mode):

>SHA_RelayId Extend Force Tuning. The sample project includes ladder logic with instances of the SHA_RelayId setup for Extend and Retract Force tuning. The Extend Force tuning will be covered first, and an example is shown below. The SHA_PositionControl block and related ladder logic for it are also required to be in place. However, the SHA_PositionControl block must be disabled when the SHA_RelayId Force block is active. Also, if SHA_RelayId blocks for both Position and Force are present, only one of these RelayId blocks can be active at a time.

The intent of the Force Tuning block is to command the SHA back and forth between two Force values, and measure the observed response, to provide Force Ki and Kp values.


  1. Running the RelayId block can cause the entire SHA to shake and move; make sure it is securely mounted or clamped prior to enabling the block – Proper safety precautions must be observed.
  2. Prior to running the Force block, the pressure feedback MUST be properly calibrated. Pressure feedback values should always be positive, for both Extend and Retract pressure sensors. The Force output of the SHA_PositionControl will typically be negative when a Retract Force zone is active.
  3. The Extend Force calibration can be performed using the SHA’s internal “end stop”, the physical extend position limit (or retract limit, if calibrating for a Retract Force Limit). In this case, make sure the fully extend position can be reached, without damaging any other part of the fixture.
  4. If a fixture will be used to provide the Force Limit, make sure to use a value for the Force Setpoint (+ DeltaSP) that is within the limits of the fixture.

ra web figure20



If your SHA has a lower rating than a 2000 lbf, then use a Force Setpoint that is below the limit of your SHA!

The Kp and Ki output values will need to be entered into the SHA_Config ForceKp and ForceKi tags for this SHA, and then tested using force limited moves with the SHA_PositionControl block.

  • Hi – Represents the highest TorqueLimitPositive value to use, when moving to the Setpoint force + the DeltaSP force offset value. For a Retract Force tune, this would be a negative value.
  • Low – Represents the lowest TorqueLimitPositive value to use, when changing to the Setpoint - DeltaSp force value. For a Retract Force tune, this would be a negative value.
  • Setpoint – Represents the starting force to use. From this starting Force, the force will be dithered by the DeltaSP offset force. In the example, the actuator will extend (because of the MOV of 5 to the SHA_Axis.VelocityTrim) until a Force of 2000 lbs is reached. For a Retract Force tuning block, a negative Force value would be used (-1000 for example).
  • DeltaSP – Represents the Force offset value to add to and subtract from the setpoint value, to measure the response. In the example, this is 200 lbs.
  • PV – Represents the Process Variable, so in a Force use case, this is the tag associated with the Force output of the SHA_PositionControl block.
  • CV – Represents the Control Variable. In the Force case, this will be the Torque % value applied to the Axis.TorqueLimitPositive value (or the Axis.TorqueLimitNegative value if tuning a retract force). NOTE: if the Hi and Lo specified are not sufficient to reach the desired range of forces, the Axis.TorqueLimitPositive value may “stick” at one extreme or the other. In this case, either adjust the Setpoint force (provided it is within the SHA limits), or stop and adjust the Hi or Low value to allow the specified Force dithering.
  • Ts – Represents the RPI time being used for the MotionTask, in seconds. The default value of 0.001 represents 1 millisecond. Adjust to match the SHA_Config.Ts value and RPI being used.
  • Ku – Represents the amplitude of the force ripple observed when the RelayId block runs. The value should stay consistent, if the feedback is being provided at a constant rate.
  • Tu – Represents the observed time-period of the force oscillations. The value should be fairly steady, if the feedback is being provided at a constant rate.
  • Kp – Represents the force Kp value calculated by the RelayId block, for the given Aggressive value. This value is the average of the last 10 oscillations.
  • Ki – Represents the force Ki value calculated by the RelayId block, for the given Aggressive value, and is the average from the last 10 oscillations.
  • Aggressive – Represents a percentage of the “hottest” tuning values to use when calculating the Ki and Kp. So a value of 0.02 represents PID values that are 2% of the “hot” values (the values that would be used if Aggressive = 1.0). Depending on the slowness of the RPI being used and the speed of the feedback data, a force Aggressive setting of 0.02 is a good starting point. Because the RelayId block can tune both Position and Force, the Aggressive value should be kept between 0.02 and 0.04 for the Force tuning case. Put the Kp and Ki values into the Force members of the SHA_Config, and then try some force limited moves using the SHA_PositionControl to observe the results. With most systems, an Aggressive of 0.02 is sufficient for Force tuning.

Make a note of the Kp / Ki values in SHA_RelayId Force block, and place these into the SHA_Config ForceKp and ForceKi tags.



The Force Ki and Kp values from the RelayId block will typically be very small; often both are less than 1. It is also recommended to move into the ForceLimit zone slowly, to minimize the effects of the SHA’s momentum when reaching the ForceLimit, and to limit the Force overshoot in this case. As a consequence of these PID ratios, the high-speed positional moves may have some rabbitting. If the positional Ki value is instead kept less than the Kp, say 1/3 to 1/10 of the Kp, then the high-speed moves will be smoother, but there can be more bounce-back when moving into the Force zone.

The Ki, Kp and output values are held and displayed when the block is disabled. When the block is re-enabled, it will take 10 cycles before the new data starts to display, because of the averaging done in the RelayId block.

When the Force RelayId block is disabled, make sure there is logic to set the SHA Axis.VelocityTrim back to 0.0 to stop the axis motion; see the sample project rungs toward the end of the SHA_Routine.


Step 19

Force Zone and Force Impact:

In typical applications, the SHA is moved toward the Force/Impact zone at a high speed, and then taken into the Force/Impact zone at a slower speed. This helps minimize the Impact force, so that the internal pressure relief valve is not tripped/opened. When a Force limit is set in the SHA_PositionControl (either the ForceMax for extend, or the ForceMin for retract), then a high impact force will tend to cause a larger positional “bounce back”, and then the PID will work to recover the position and force. The recovery from the impact will take longer if the positional PID values are “soft”/slow, as on systems with slower analog input.

The impact force can be lessened by approaching slower, by reducing the ForceMax/Min for the initial impact, or by reducing the TorqueLimit in that direction. A virtual axis can be used to then ramp up the ForceMax/Min, and/or the TorqueLimit, in a controlled manner.