Application Context: PAMA Speedram 4 HBM Ram Sag Compensation
The installation is a PAMA Speedram 4 horizontal boring machine (HBM) undergoing a CNC retrofit. The original machine was designed with a ram sag adjustment function, using a hydraulic servo valve to lift the ram and counter the gravitational deflection that grows as the ram extends from the headstock. The retrofit preserves that functional intent and re-implements it on a Siemens SINUMERIK 840D controller with PCU 50.3, replacing the original closed-loop controller chain with a Siemens HLA (Hydraulic Linear Axis) module and a Rexroth hydraulic servo valve.
The machine has nine controlled axes: X, Y, Z, W (the ram), SP (spindle), ATC, V, B, U. The W axis is the ram and has 2 m of total travel. The ram is mechanically weight-balanced by steel wire ropes and pulleys, not by a hydraulic counterbalance cylinder. As the ram extends, the cantilever bending increases and the tool point drops relative to the commanded Z position. To keep the tool point on the programmed path, the controller must lift the ram with a hydraulic force that grows with ram extension. The original implementation drove a Rexroth servo valve card with a 0-10 V command derived from ram position. The retrofit retains the Rexroth valve and re-implements the 0-10 V command source.
The drive line-up in the retrofit uses eight LT (line) modules and one HLA module on the SINAMICS / SIMODRIVE drive bus. The HLA module is intended to deliver the position-dependent setpoint voltage to the Rexroth valve card. The retrofit team is using a distance-coded linear scale on the ram and an incremental encoder on the drive motor. Because the original closed-loop control hardware (pressure transducers, valve spool position sensor) is not being re-wired, the HLA must in practice function as an open-loop voltage source rather than as a closed-loop hydraulic axis controller. This is the central engineering problem the article addresses.
HLA Module Architecture in the 840D Drive Line-Up
The HLA (Hydraulic Linear Axis) module is a member of the SINUMERIK 840D drive family. It is engineered specifically for axes where the final control element is a hydraulic proportional valve or a hydraulic servo valve. The module contains the position, velocity, and pressure/force regulators that close the hydraulic axis loop, and exposes the analog and digital interfaces required to command a hydraulic valve and read hydraulic feedback.
Physically, the HLA module lives on the drive bus backplane alongside the line modules (LT) and the servo/infeed modules. It communicates with the NCK (NC kernel) over the drive bus, which on 840D systems is implemented as a proprietary high-speed serial link. The NCK writes setpoint values into the drive and reads back actual values. The drive's internal regulator closes the loop at the drive cycle rate, which is configurable from 125 us to 1 ms depending on the drive firmware version and the configured current, speed, and position controller cycle.
The HLA module's I/O includes:
- Analog command output to the valve, typically configurable as +/-10 V, 0-10 V, 4-20 mA, or +/-20 mA depending on the connected valve specification. The output stage is a 16-bit (or higher) DAC with hardware current limiting and short-circuit protection.
- Spool position feedback input, used by the drive to monitor whether the valve spool has actually moved to the commanded position. This is a safety function: a stuck or disconnected spool is detected within a few milliseconds and the drive is disabled with a fault.
- Encoder inputs (SSI, EnDat, or incremental TTL/HTL) for the cylinder position feedback. A linear scale on the cylinder or a rotary encoder on a rack-and-pinion is the typical source.
- Analog inputs for pressure transducers, used for force control. The HLA module supports two pressure channels (A-side and B-side of the cylinder) for differential pressure measurement.
- Digital I/O for valve enable, ready, fault, and other status signals. These map to the drive's terminal interface and to NCK interface signals.
- PROFIBUS / PROFINET interface for commissioning and diagnostics via SIMATIC S7 or SINUMERIK Operate.
Internally, the HLA module runs three cascaded regulators: current (or pressure), velocity, and position. The position regulator output is a velocity setpoint; the velocity regulator output is a current/pressure setpoint; the current regulator output is the valve command. The regulator structure is configured by drive machine data, and the user can select preset configurations for common Rexroth and Bosch valve types from the drive machine data library.
Closed-Loop Hydraulic Axis: The HLA's Intended Application
To understand why the HLA module is not the obvious choice for an open-loop sag compensation, it is useful to understand what the module is designed to do. In a typical closed-loop hydraulic axis application:
- The NCK commands a position setpoint to the drive.
- The drive's position regulator compares the position setpoint to the actual cylinder position read from the linear scale and outputs a velocity setpoint.
- The drive's velocity regulator (or force regulator, in force-controlled axes) compares the velocity setpoint to the actual velocity (computed from the position feedback) and outputs a current/pressure setpoint.
- The drive's current/pressure regulator outputs an analog voltage to the proportional or servo valve, commanding valve opening in the direction needed to reduce the position error.
- The valve moves, oil flows, the cylinder moves, the linear scale reports the new position, and the loop closes.
Throughout this loop, the drive monitors the valve spool position. If the commanded valve opening does not match the actual spool position within a configurable tolerance and time, the drive declares a spool position fault and disables the output. This is a machine-safety function: a stuck valve can cause uncontrolled cylinder motion and a crash.
In force control mode, the regulator structure changes: the inner loop is closed by the pressure transducers on the cylinder, not by the position feedback. This is used in presses and in force-limited clamping axes.
The HLA module is a high-performance motion controller for these applications. It is engineered to be the sole controller of the hydraulic axis, with the NCK acting as a setpoint source. Using it as a pure voltage source discards all of this functionality and creates configuration conflicts with the safety monitors.
The Open-Loop Sag Compensation Application
The application being implemented is structurally simpler than the HLA's intended use. The closed-loop control of the ram position is performed by the W axis drive (a standard SINAMICS servo or a hydraulic axis with the HLA) and the W axis linear scale. The sag compensation is a small additive correction to the ram's Z position: as the ram extends, the controller adds a small upward Z offset to lift the ram against gravity-induced sag. The compensation value is a function of ram extension only (or, in more sophisticated implementations, of ram extension, ram velocity, and tool weight).
The compensation function is implemented as follows:
- Read the W axis actual position (ram extension) from the linear scale.
- Compute the required compensation value using a curve (linear, polynomial, or lookup table) populated during commissioning.
- Output the compensation value as a voltage (0-10 V) to the Rexroth servo valve card.
- The Rexroth card drives the valve to lift the ram by the required amount.
This is a feed-forward function, not a closed-loop regulator. The W axis drive still closes the position loop using the W axis linear scale; the sag compensation is a slow, position-dependent bias added to the W axis command. The hydraulic actuator in this scheme is not closing a position loop with its own linear scale; it is responding to a voltage command and producing a force that is approximately proportional to that voltage.
Because the function is open-loop, the HLA module is not the natural tool for the job. A standard analog output card from the SINUMERIK 840D I/O family (for example, an SM 332 from the SIMATIC S7-300 line that mounts in the 840D PLC rack) is the right hardware choice. The card accepts a numerical value from the PLC, converts it to a 0-10 V output, and drives the Rexroth valve card. The PLC computes the compensation value from the W axis actual position. The whole function is well-supported by standard Siemens application examples and is straightforward to commission.
Why the HLA Module Is Not Recommended for This Application
Using the HLA module as a voltage source for an open-loop feed-forward function is technically possible but practically problematic. The reasons are:
- Spool position monitoring alarm: The HLA module by default monitors the valve spool position via a dedicated feedback input. If no spool position sensor is wired (or if the sensor is not connected in the retrofit), the drive raises a fault at power-on. Disabling the monitor in machine data defeats its safety function. The alarm typically reads "Spool position monitoring" or "Valve monitoring" depending on firmware version.
- Encoder error at power-on: The HLA module expects a cylinder-side encoder (linear scale or rotary encoder on the cylinder). If unconnected, the drive reports "Encoder error" or "Measuring system not available." Configuring the HLA to operate without an encoder is not a standard configuration and may not be supported in all firmware versions.
- Regulator output behavior: The HLA module's analog output is the output of the current/pressure regulator. In normal operation, the regulator maintains the valve at the position required to hold the commanded pressure. If the regulator is disabled or the loop is opened, the output may drift, may not respond to a static setpoint, or may be latched at a default safe value (typically 0 V). Stable open-loop voltage output is not the regulator's design intent.
- Cost and commissioning burden: The HLA module is more expensive than a standard analog output card. Commissioning requires the drive machine data, the NCK machine data, the PROFIBUS/PROFINET configuration, and the hydraulic axis tuning. For a simple voltage-output function, this is disproportionate.
- Diagnostic complexity: When the function does not behave as expected, the diagnostic path goes through the drive's alarm system, the NCK alarm system, and the hydraulic tuning parameters. With a standard analog output card, the diagnostic path is the PLC program and the I/O signal.
The recommendation is therefore to remove the HLA module from the drive line-up and use a standard SM 332 (or equivalent) analog output module in the SINUMERIK 840D PLC rack. The PLC reads the W axis actual position, computes the sag compensation, and writes the value to the analog output. The HLA module is returned to the spare parts inventory or repurposed for a different axis where its functionality is needed.
HLA Module Configuration as a Last-Resort Open-Loop Voltage Source
If the HLA module must be retained (for example, because the cabinet layout cannot be reworked or because the spare parts inventory is committed), the configuration steps below describe how to force the HLA into a voltage-output state. These steps are not officially published by Siemens for this use case; the procedure reflects field practice and may not work on all firmware versions.
The configuration is split into drive machine data changes and NCK command path changes.
Drive Machine Data Adjustments
The HLA module is configured through drive machine data. The following conceptual changes are required:
- Axis type declaration: Declare the HLA as a spindle without position feedback. This bypasses the closed-loop position regulator. The drive will accept a speed setpoint from the NCK.
-
Disable spool position monitoring: Set the corresponding monitoring bit in the drive machine data to "no monitoring" or "monitoring inactive." This prevents the drive from raising a spool position fault when no spool position sensor is wired. Disabling spool position monitoring removes a machine-safety function. The risk of undetected valve failure (stuck spool) becomes the responsibility of the mechanical and process design rather than the drive.
- Disable encoder monitoring: Set the encoder monitoring bits to "no encoder" or "encoderless operation." This prevents the drive from raising an encoder fault at power-on. The drive may still report a warning that encoderless operation is in use.
- Configure analog output scaling: Set the drive machine data that maps the regulator output to the analog output range. For a 0-10 V output corresponding to a 100% speed setpoint, set the output scaling to 10 V full scale.
- Disable position regulator: The position regulator must be bypassed; otherwise the drive will attempt to close the position loop and the regulator output will be driven to saturation when no position feedback is present. Set the position regulator to "open" or "feedforward only" mode.
After these changes, the drive should enable and accept a speed setpoint. The analog output will follow the speed setpoint, scaled by the configured output range.
NCK Command Path
To drive the HLA in spindle mode, the NCK must issue a spindle speed command. The command can come from a part program (M03 Sxxx, M04 Sxxx, M05) or from the PLC using standard function blocks.
For a position-dependent voltage, the PLC reads the W axis actual position, computes the required speed setpoint, and writes the setpoint to the spindle using the standard spindle interface. The mapping is:
V_out = V_min + K_sag * x_ram
n_set = (V_out / V_full_scale) * n_max
Where:
- V_out is the desired output voltage in V
- V_min is the minimum voltage at zero ram extension (often 0 V)
- K_sag is the sag compensation slope in V/m
- x_ram is the ram extension in m
- n_set is the spindle speed setpoint in rpm
- n_max is the configured maximum spindle speed in rpm
- V_full_scale is the configured full-scale output voltage (typically 10 V)
This command path is awkward because the spindle interface is designed for velocity commands with enable, disable, and fault semantics. Issuing a static non-zero speed setpoint may be interpreted by the NCK as a spindle run command and may trigger interlocks (door interlock, spindle enable, etc.). The PLC must manage these interlocks explicitly.
For continuous position-dependent output, the PLC must issue a continuously updated speed setpoint. The HLA module's regulator, in this configuration, will output a voltage proportional to the speed setpoint. The stability of the output is not guaranteed; the regulator may apply a low-pass filter that smooths the output and introduces lag, or it may apply a clamping function that limits the output to a safe value when the setpoint is constant.
Sag Compensation Curve: Linear and Polynomial Models
The sag of a horizontal boring machine ram grows with ram extension. The exact relationship depends on the ram's cross-section, the headstock structure, the tool weight, and the bearing play. For commissioning, the relationship is measured empirically.
Linear Model
The simplest model is linear:
V_out(x) = V_0 + K * x
Where x is the ram extension in mm (or m), V_0 is the output voltage at zero extension, and K is the slope in V/mm (or V/m). A linear model is adequate when the sag is dominated by a single mode (typically the first cantilever bending mode of the ram) and the tool weight is constant.
Polynomial Model
For more accuracy, a second- or third-order polynomial is used:
V_out(x) = a_0 + a_1*x + a_2*x^2 + a_3*x^3
The polynomial coefficients are fit to measured data using least-squares regression. A polynomial is preferred when the sag curve shows clear non-linearity, which is typical for long ram travel (>=1 m) and significant tool weight.
Lookup Table Model
For the most accurate compensation, a lookup table with linear interpolation is used. The table is populated with measured (x, V) pairs at intervals of 50-100 mm of ram extension. The PLC reads the table, interpolates between the bracketing points, and outputs the interpolated voltage. This model handles arbitrary sag curves without forcing a polynomial form.
Typical Sag Magnitudes
For a PAMA-class horizontal boring machine with 2 m of ram travel and a tool weight of 5-20 kN, the static sag at full extension is typically 0.1-0.5 mm. The compensation voltage required to bring the ram back to nominal position depends on the Rexroth valve and cylinder sizing, but is typically 1-5 V at full extension. The exact value is measured during commissioning by stepping the ram through its travel with a dial indicator on the ram face.
Commissioning Procedure for Sag Compensation
The commissioning sequence below describes the procedure with a standard SM 332 analog output card. The same procedure applies to the HLA-as-voltage-source path with the PLC driving a spindle setpoint instead of an analog output value.
- Verify W axis linear scale: Power on the machine with the W axis in the parked (fully retracted) position. Verify the W axis actual position reads 0.000 mm in the SINUMERIK Operate HMI. Move the W axis manually through its full travel; verify the position reading tracks the actual position with no jump or drop-out.
- Verify analog output: With the machine in a safe state, force the analog output to 0 V. Measure the output voltage at the Rexroth valve card terminals with a calibrated multimeter. Verify the reading is 0.00 V +/- 0.05 V. Force the output to 5 V; verify 5.00 V +/- 0.05 V. Force to 10 V; verify 10.00 V +/- 0.05 V. This confirms the analog output is calibrated and the wiring is correct.
- Verify Rexroth valve response: With the W axis stationary and the ram in the parked position, command the analog output to step from 0 V to a target value (for example, 3 V). Measure the cylinder pressure (if a pressure gauge is installed) or the ram lift (if a dial indicator is installed). Verify the response is monotonic, stable, and within the expected range.
- Measure the sag curve: With the analog output forced to 0 V, command the W axis to move to 200 mm extension. Wait for mechanical settling (typically 2-5 s). Measure the actual ram face position with a dial indicator referenced to a fixed point on the column. Record the deviation. Repeat at 400, 600, 800, 1000, 1200, 1400, 1600, 1800, 2000 mm. The recorded deviations form the raw sag curve.
-
Invert the sag curve to compute compensation: For each measured (x, sag) pair, compute the required compensation voltage. The relationship is:
where sag_max is the maximum measured sag at full extension. The inversion assumes a linear relationship between voltage and lift, which is a reasonable first approximation for a proportional valve.V_comp(x) = (sag_max - sag(x)) / sag_max * V_full_scale - Program the PLC: Write the PLC logic that reads the W axis actual position and outputs the compensation voltage. Use a linear interpolation between the measured points, or fit a polynomial and evaluate it at the current position. Update the output at a rate of 10-50 Hz; the sag is a slow-changing function and high update rates are not needed.
- Verify with compensation active: Repeat the sag measurement at the same W axis positions, this time with the compensation voltage active. The residual sag should be reduced to within +/- 0.02 mm of the target. Adjust the compensation curve coefficients if the residual is not acceptable.
- Verify dynamic behavior: Command the W axis to traverse from 0 to 2000 mm at the rapid traverse rate (typically 10 m/min for a heavy ram). Monitor the ram face position with the dial indicator during the traverse. The compensation voltage will ramp with the W axis position; the residual sag should remain within tolerance throughout the traverse.
- Verify failure modes: Simulate loss of the linear scale signal (disconnect the scale connector). Verify the analog output goes to a safe state (0 V or last valid value, depending on application). Simulate emergency stop. Verify the analog output is driven to 0 V within 100 ms.
- Document and lock: Record the measured sag curve, the compensation coefficients, the analog output calibration values, and the failure-mode behavior in the machine commissioning report. Lock the parameters with the SINUMERIK password mechanism to prevent unauthorized modification.
Wiring and Signal Conditioning
The 0-10 V signal from the analog output card to the Rexroth valve card is sensitive to electrical noise. The wiring must follow industrial best practice:
- Cable type: Use shielded twisted pair (STP), 24 AWG conductor or larger, with an overall shield. Belden 8761 or equivalent is a common choice.
- Shield grounding: Ground the shield at the cabinet end only. Do not ground at both ends; this creates a ground loop that injects noise. The cabinet ground should be a low-impedance connection to the facility ground.
- Routing: Route the analog signal cable in a separate conduit or cable tray from VFD power cables, motor cables, and any cable carrying switched DC or AC at >50 V. Maintain at least 200 mm of physical separation. Cross power cables at 90 degrees if the cable paths must intersect.
- Input impedance: Verify the Rexroth valve card input impedance. Typical values are 10 kOhm to 100 kOhm. The analog output card's drive capability is typically 5 mA to 20 mA, well above what the valve card requires. If the input impedance is low or the cable run is long, install a buffer amplifier near the valve to drive the signal.
- Current loop option: For long cable runs (>10 m) or high-noise environments, use a 4-20 mA current loop instead of a voltage signal. Configure the analog output card for current output, install a 250 Ohm precision resistor at the Rexroth input to convert the current to voltage (4 mA = 1 V, 20 mA = 5 V; for a 0-10 V equivalent, use 500 Ohm for 4-20 mA = 2-10 V, or scale the Rexroth input accordingly).
- Differential signaling: Some Rexroth valve cards support differential analog inputs. If supported, use a differential output to improve noise immunity. The Siemens SM 332 has both single-ended and differential variants; verify the variant in use before commissioning.
System Topology Diagram
Verification Tests and Acceptance Criteria
The following tests are run after commissioning to confirm the sag compensation is within tolerance.
| Test | Method | Acceptance Criterion |
|---|---|---|
| Static sag at full extension | Dial indicator at ram face, W axis at 2000 mm, output at compensation value | Residual sag < 0.05 mm |
| Static sag at mid extension | Dial indicator at ram face, W axis at 1000 mm | Residual sag < 0.03 mm |
| Output voltage stability | Monitor output over 1 hour at static W axis position | Drift < +/- 0.05 V |
| Dynamic sag during traverse | Traverse W axis at rapid rate, monitor ram face position | Residual sag < 0.10 mm throughout traverse |
| Emergency stop behavior | Trigger E-stop during W axis motion | Output goes to 0 V within 100 ms |
| Feedback loss behavior | Disconnect linear scale during motion | Output goes to safe state within 100 ms |
| Repeatability | 10 full-traverse cycles, measure sag at 1000 mm each time | Standard deviation < 0.01 mm |
Troubleshooting Matrix
| Symptom | Likely Cause | Diagnostic Action | Corrective Action |
|---|---|---|---|
| HLA module reports "Spool position monitoring" fault at power-on | No spool position sensor wired | Check drive alarm history for fault code | Disable spool position monitor in drive MD, or wire spool position sensor |
| HLA module reports "Encoder error" at power-on | No encoder connected to HLA encoder port | Check drive alarm history | Declare HLA as encoderless in drive MD, or wire encoder |
| Output voltage drifts to 0 V after enable | HLA drive times out open-loop command | Monitor output with oscilloscope | Use closed-loop configuration, or replace HLA with SM 332 |
| Sag not fully compensated at full extension | Compensation curve coefficients are wrong | Re-measure sag at 200 mm intervals | Refit polynomial or update lookup table |
| Sag over-compensated at mid extension | Compensation slope too aggressive | Plot residual sag vs. extension | Reduce K_sag, re-measure |
| Output voltage is noisy | Ground loop, cable routing near VFD | Measure with isolated oscilloscope | Reroute cable, use shielded twisted pair, check shield grounding |
| Rexroth valve output is unstable | Input signal quality, valve tuning | Check Rexroth card diagnostic LEDs | Add RC filter, check valve card tuning, verify input impedance |
| W axis position reading is wrong | Linear scale not referenced, distance-coded reference not run | Check axis reference status in HMI | Run reference point approach, verify distance-coded reference points |
| Compensation does not activate | PLC logic not enabled, output not written | Monitor PLC tag in online mode | Check enable conditions, verify write to AO address |
| Output is stuck at maximum (10 V) | PLC writes incorrect value, scale error | Check PLC code, monitor AO raw value | Verify scaling, check for overflow |
Alternative Topologies and When They Apply
Different machine architectures use different compensation schemes. The recommendations below are matched to the application.
- Horizontal boring machine ram (this application): Distance-coded linear scale + standard analog output. The compensation is a position-dependent voltage to a Rexroth servo valve. The recommended hardware is SM 332 (or equivalent) analog output card in the SINUMERIK PLC rack.
- Vertical lathe ram: Same approach. The sag curve is different (typically larger sag at full extension because the ram is supporting a heavier rotating tool), but the topology is the same.
- Press ram with force feedback: Add a pressure transducer on the cylinder and use a force-controlled regulator. The HLA module is the correct hardware for this application because the regulator is closing a force loop. The compensation is a force setpoint, not a position-dependent voltage.
- Hydraulic axis with proportional valve (no separate servo card): The proportional valve is driven directly from the analog output. The Rexroth servo card is not used. The HLA module is also not used; a standard analog output is sufficient. Verify the proportional valve's input specification matches the analog output range.
- Hydraulic axis with closed-loop position control (intended HLA use): The HLA module is the correct hardware. Configure the HLA with cylinder linear scale, pressure transducers (if force control is needed), and spool position feedback. Use the HLA as designed.
FAQ
Can the Siemens 840D HLA module be used purely as a 0-10 V analog output?
The HLA module is engineered for closed-loop hydraulic axis control with spool position, cylinder position, and pressure feedback. Using it as a pure voltage source requires disabling the internal monitors in drive machine data and is not officially supported. For a feed-forward sag compensation that only requires an open-loop 0-10 V command, a standard SM 332 (or equivalent) analog output card is the technically and economically correct choice.
What is the recommended hardware for ram sag compensation on a PAMA-class HBM retrofit?
A Siemens SM 332 analog output module (or comparable) in the SINUMERIK 840D PLC rack. The PLC reads the W axis actual position from the distance-coded linear scale, computes the compensation value from a curve populated during commissioning, and writes the value to the analog output. The output drives the Rexroth servo valve card with 0-10 V.
How is the sag curve populated during commissioning?
With the compensation disabled (output at 0 V), command the W axis to step through 200 mm increments of extension. At each step, measure the actual ram face position with a dial indicator referenced to the column. Record the deviation. The required compensation voltage at each position is the inverse of the measured sag, scaled to the 0-10 V output range. The resulting (position, voltage) pairs form the compensation curve.
What cable type is recommended for the 0-10 V signal to the Rexroth valve card?
Shielded twisted pair, 24 AWG conductor or larger, with the shield grounded at the cabinet end only. Route the cable at least 200 mm from VFD power cables. For cable runs over 10 m, use a 4-20 mA current loop with a 250 Ohm precision resistor at the valve input to convert to voltage.
What acceptance criteria apply to the sag compensation?
Typical acceptance for a horizontal boring machine is residual sag less than 0.05 mm at static mid- and full-extension positions, residual sag less than 0.10 mm during a full rapid traverse, and output voltage drift less than +/- 0.05 V over one hour. Repeatability across 10 traverse cycles should show a standard deviation of less than 0.01 mm at the verification point.