Encoder Pulse to 0-10VDC Converter Module for Siemens S7 PLC

David Krause19 min read
Sensor IntegrationSiemensTechnical Reference
Licensed PE Working through this on a live machine? A Maine-licensed engineer can take it from here — included with IMD hardware, by the hour for everything else. Book an engineer

Problem Definition: Tachometer Replacement with Shaft Encoder

Replacing an aging belt-driven DC tachometer with a modern hollow-shaft encoder is a common retrofit on web-fed converting, wire drawing, and continuous seam-welding lines. The legacy 0-10 VDC signal from the tachometer is wired directly to a PLC analog input, where the CPU scales it to engineering units (RPM, ft/min, or m/min) and uses the result to trim weld current, heat input, or overlap ratio in real time. Management typically wants the validated PLC program untouched, so the new encoder must reproduce a 0-10 VDC signal that is linear with shaft speed while delivering the bandwidth, resolution, and noise immunity the welding process requires.

Two implementation paths exist:

  1. External F/V converter: convert the encoder pulse train to 0-10 VDC with a DIN-rail signal conditioner, feed the existing analog input, and leave the PLC program untouched.
  2. Direct HSC: wire the encoder into a Siemens high-speed counter, compute RPM inside the CPU, and feed the result to the existing tag or to a free analog output. Requires PLC program changes.

When validated programs or contractual lock-downs forbid code modifications, the external F/V path is mandatory. This document covers converter selection, scaling math, wiring, calibration, encoder mounting, and the HSC fallback for future modernization.

Signal Architecture: From PPR to 0-10 VDC

The signal chain is short, but each link has to be sized correctly:

Hollow Shaft Encoder 1024 PPR, 24V HTL A / B / Z F/V Signal Conditioner DIN-rail, isolated, 0-10 VDC out 0-10 VDC S7 Analog Input Module SM 0-10 V / 4-20 mA SM 1231 / SM 331 CPU S7 Scale to RPM Welder Heat / Speed PID

The encoder produces a quadrature A/B channel (and an optional index Z) at a frequency proportional to shaft speed. The F/V module measures that frequency over its internal time window, multiplies by a configurable span, and emits a proportional 0-10 VDC (or 4-20 mA) signal. The Siemens analog input card samples the voltage, returns an integer (0-27648 for the S7-1200/1500 0-10 V range, 0-27648 for the S7-300 SM 331 in 0-10 V mode), and the CPU scales it to engineering units for the existing welding PID. See the Siemens Industry Online Support portal for the analog input manuals for the specific S7 module in service.

Calculating Frequency Range, Resolution, and Output Scaling

The math is straightforward and must be done before the module is ordered. Define three parameters from the process:

  • PPR = encoder pulses per revolution (1024 in the reference application).
  • RPM_min, RPM_max = lowest and highest shaft speeds seen in normal production.
  • V_full = full-scale output voltage (10 V for a 0-10 V module).

Output frequency of channel A (single channel, pre-quadrature):

f_Hz = (RPM / 60) x PPR

Voltage-to-frequency ratio required of the module:

k = V_full / (f_max - f_min)

Voltage at any operating point:

V_out = k x (f_Hz - f_min) = 10 x ((RPM / 60) x PPR - f_min) / (f_max - f_min)

Worked example for a typical 1024 PPR hollow-shaft encoder on a 200-1800 RPM welder line:

Shaft RPM Encoder frequency (Hz) Module output (V) S7 integer (0-27648)
200 3 413 0.00 0
500 8 533 3.13 8 658
1 000 17 067 8.41 23 256
1 800 30 720 10.00 27 648

The frequency span is 3 413 Hz to 30 720 Hz, well inside the 100 kHz capability of every modern F/V module. If the welder runs above ~3 000 RPM with a 1024 PPR encoder, the top end moves past 50 kHz; modules with 50 kHz or 100 kHz input ranges are mandatory. Below 100 RPM, the 0.1-second update period of an F/V module produces visible ripple on the analog output; for very low speeds the HSC path is more accurate.

Resolution of the analog output (counts per RPM):

counts_per_RPM = 27648 / (RPM_max - RPM_min)

For the 200-1800 RPM example, that is 27648 / 1600 = 17.28 counts per RPM, or equivalently 0.0579 V per RPM. The encoder's intrinsic mechanical resolution is 1024 PPR x 60 s = 61 440 counts per RPM. The analog link discards more than 99.97% of that information. If the welding process ever requires sub-RPM control, HSC is the only path that preserves it.

Critical sizing rule: always pick a module whose maximum input frequency is at least 1.5x the worst-case shaft frequency. Encoder quadrature mode multiplies channel A pulse rate by 4 in some modules; verify whether the spec sheet quotes pre-quadrature or post-quadrature frequency.

Off-the-Shelf F/V Modules: Selection, Comparison, and a Detailed Example

Selection criteria

Catalog F/V signal conditioners differ in five ways that matter on a retrofit:

  1. Input frequency range - 0-10 kHz, 0-50 kHz, 0-100 kHz, 0-250 kHz. Match to the calculated f_max with headroom.
  2. Output range and resolution - 0-10 V, +/-10 V, 0-20 mA, 4-20 mA; 12-bit or 16-bit DAC; output update period (typical 10 ms to 100 ms).
  3. Galvanic isolation - input-to-output and power-to-input. Always specify isolated; encoder power and PLC ground differ.
  4. Configuration method - DIP switches, potentiometers, push-button with LCD, or PC software (FDT/DTM, FDT2). DIP is fastest on the floor; software is fastest during design.
  5. Approvals - CE, UL 508, ATEX/IECEx for hazardous areas. Welding cells occasionally require Class I Div 2 modules.

Avoid the following common mistakes:

  • Using a rate meter with relay outputs (a frequency trip) instead of an analog signal conditioner.
  • Using a non-isolated module in a plant with VFD-driven welders; common-mode noise will push the analog output above 10 V and damage the S7 input.
  • Picking a module whose output is current (4-20 mA) when the S7 input card is wired for voltage - the loop will sit at 4 mA and the CPU will read 0 VDC equivalent.

Module comparison

The table below lists commonly available DIN-rail frequency-to-analog converters suitable for this application. Specifications reflect manufacturer datasheets at the time of writing; verify the latest revision before purchase.

Manufacturer Model Input freq. Output Resolution Update Isolation Configuration
Omega DRF-FR series 0-100 kHz 0-10 V / 4-20 mA 16-bit 20 ms 1.5 kV DIP / PC
Phoenix Contact MINI MCR-2-F-UI(-PT) 0-120 kHz 0-10 V / 4-20 mA 16-bit 30 ms 3-way DIP / FDT/DTM
Wago 857-402 0-100 kHz 0-10 V / 4-20 mA 16-bit 20 ms 3-way Wago settings app
Red Lion IFMA0035 / IFMA0060 0-50 / 0-100 kHz 0-10 V / 4-20 mA 14-bit 25 ms 2.5 kV Crimson / USB
Acromag IP330 / IP340 0-100 kHz 0-10 V / 4-20 mA 16-bit 20 ms 1.5 kV USB / DIP
Wieland Electric SLO 12-100 kHz 0-100 kHz 0-10 V / 4-20 mA 16-bit 30 ms 3-way DIP
Always confirm that the selected module accepts single-ended TTL/HTL encoder signals at the encoder's supply voltage. Most accept 5 V TTL or 24 V HTL; some require an external resistor network for 12 V encoders.

Omega DRF-FR detailed specifications

The Omega DRF-FR is the most commonly cited off-the-shelf F/V module for legacy tachometer retrofits. Key parameters from the datasheet:

  • Input: 0-100 kHz, 0.05-500 Vrms selectable sensitivity, 5-24 VDC encoder supply.
  • Output: 0-10 VDC (>=10 mA drive) and 4-20 mA (<=500 ohm loop), selectable by DIP switch.
  • Accuracy: +/-0.1% of full scale at 25 deg C; +/-0.3% over 0-50 deg C.
  • Update rate: 20 ms (50 Hz).
  • Power: 24 VDC +/-10%, 80 mA.
  • Isolation: 1.5 kVAC input-to-output, 1.5 kVAC power-to-input.
  • Approvals: CE, UL 508 listed, RoHS.

Configuration procedure on the DRF-FR:

  1. Set input range DIP switch to match encoder frequency span. The module reads f_min at 0 V and f_max at full scale; both endpoints are user-configurable.
  2. Set output type DIP switch to V for 0-10 VDC.
  3. Apply a known reference frequency (signal generator or a calibrated encoder at a known RPM) at the midpoint of the operating range. Trim the SPAN potentiometer until the DMM reads 5.000 VDC.
  4. Apply the f_min reference. Trim the ZERO potentiometer until the DMM reads 0.000 VDC. Repeat SPAN trim because the two interact.

Cross-reference the datasheet at the Omega Engineering site for the current variant: omega.com. Phoenix Contact MINI MCR-2 documentation is available at phoenixcontact.com; Red Lion's IFMA manuals are on redlion.net; Acromag IP330/IP340 data sheets on acromag.com.

Wiring, Grounding, and Signal Integrity Best Practices

Encoder and analog signals share a 24 VDC cabinet environment rich in IGBT switching noise from the welder. Treat the encoder and the F/V module as a single shielded system:

  • Use twisted-pair shielded cable (Belden 9841, 9842, or Alpha 6010C) for both the encoder A/B pair and the 0-10 VDC output. Run a separate twisted pair for each channel.
  • Ground the shield at one end only, usually the cabinet ground bus, not the encoder end. Encoder housings are typically isolated; do not rely on shaft grounding.
  • Keep encoder cable away from welder secondary cables by at least 200 mm, and never run parallel inside the same conduit.
  • Provide a dedicated 24 VDC power supply for the encoder and F/V module. Do not share with solenoid valves or contactor coils.
  • Add a 24 VDC MOV (e.g. Littelfuse V24ZA50) at the encoder terminal box to clamp transients from the welder's HF arc-start.
  • Terminate HTL encoder outputs with a 1-2 kohm pull-up to 24 V at the F/V module input if the encoder is open-collector or push-pull rated for less than 20 mA per channel.
Encoder / F/V Module (Cabinet) Encoder +24 V +24 V Channel A A Channel B B Common / GND GND F/V Module DRF-FR / MINI MCR +24 VDC supply Channel A pulse Channel B pulse Common / shield Siemens S7 Backplane F/V Output V+ V+ F/V Output GND GND S7 AI SM 1231 / SM 331 0-10 VDC to PID

Verify the S7 analog input is configured for 0-10 V (not +/-10 V or 0-20 mA). On the SM 1231, the input type is selected by wiring the input terminals as voltage (V+ and V-) and configuring the channel as Voltage in TIA Portal. On the SM 331 (S7-300), the measuring-range module on the side of the card must be set to B (0-10 V) before powering the rack - see the Siemens Industry Online Support portal for the manual reference for your specific analog module.

Hollow Shaft Encoder Selection and Mounting

The reference application uses a 1024 PPR hollow-shaft encoder. The criteria below cover the most common selection and installation pitfalls.

Parameter Typical value Selection note
Bore diameter 6 / 8 / 10 / 12 / 15 / 16 / 20 mm Match to driven shaft with H7 tolerance (e.g. 10 mm H7 = 10.000 to 10.015 mm).
Stator coupling 3-arm, torque-limited Prevents shaft damage if encoder binds; tie down with anti-vibration arm.
Max shaft speed 6 000 to 12 000 RPM Allow 1.5x safety margin above max operating RPM.
Radial / axial load 50-100 N radial, 20-40 N axial Check if the encoder sits over a chain or belt drive.
Output 24 V HTL push-pull or RS-422 line driver HTL works directly with S7-1200 onboard HSC; RS-422 needs adapter.
IP rating IP65 standard, IP67 optional Welding cells need at least IP65.
Operating temperature -20 to +85 deg C Verify if cabinet ambient exceeds +50 deg C.

Mounting best practices for a hollow-shaft encoder on a belt- or chain-driven shaft:

  1. Clean the shaft and apply a thin film of light machine oil. Do not use moly disulfide or thread-locker - they change the bore tolerance.
  2. Slide the encoder over the shaft and seat the stator coupling against the mounting surface. Do not hammer.
  3. Torque the anti-rotation arm bolt to the manufacturer's spec (typically 4-6 Nm for M5, 8-10 Nm for M6). A loose arm allows the encoder to follow the shaft's runout and adds bearing wear.
  4. Check axial play: the encoder should slide freely on the shaft but have no endplay. If play exceeds 0.2 mm, shim with a thrust washer.
  5. Verify runout with a dial indicator: total indicated runout (TIR) under 0.05 mm at the encoder face. Excessive runout will modulate the output frequency and inject low-frequency noise.
Do not mount the encoder where the shaft is subject to axial thrust. A worn bearing or misaligned coupling can push the encoder off the shaft. If axial thrust is unavoidable, use a shaft-end retained encoder with a keyed coupling instead.

Siemens HSC Alternative: Direct Encoder Connection

The direct HSC route eliminates the F/V module entirely. The encoder's A and B channels connect to a Siemens high-speed counter input, the CPU counts edges in a fixed time window, and the result is scaled to RPM in the user program.

Advantages:

  • No drift, no span/zero pots, no analog noise injection.
  • Counts all 4 edges of A/B (quadrature x4) - effectively 4096 counts per rev with a 1024 PPR encoder.
  • Resolution is uniform from 0 RPM to maximum RPM; F/V modules lose resolution near zero.
  • One tag (e.g. MD120 RPM) replaces the analog scaling block and feeds the same PID block.

Disadvantages:

  • PLC program must be modified - forbidden in this retrofit.
  • If the program is validated (21 CFR Part 11, GAMP 5), changes trigger revalidation.
  • High-frequency digital wiring still requires shielding and segregation.

For future modernization or for non-validated lines, the HSC path is the better long-term solution. The next section summarizes platform-specific configuration.

HSC Configuration by Platform

Each Siemens family has a different HSC implementation. Use the configuration that matches the platform in the cabinet.

S7-200 (legacy)

Onboard HSC inputs: I0.0, I0.1, I0.2 (CPU 224/226). Configure HSC mode 9 (quadrature x4, no reset) in the system block, then call the HSC_INIT subroutine. A 1-second time-base interrupt reads SMD38 (count value) into VW200, divides by 4096, and multiplies by 60 to obtain RPM.

S7-200 SMART (current legacy)

Onboard HSC inputs: I0.0, I0.1, I0.2 (CPU SR20/SR30 etc.). Configure HSC mode 9 (quadrature x4, no reset) in the system block, then call the HSC_INIT subroutine. A 1-second time-base interrupt reads SMD38 (count value) into VW200, divides by 4096, and multiplies by 60 to obtain RPM.

S7-1200 (current mainstream)

Onboard HSC: I0.0-I0.5 (CPU 1214C/1215C). In TIA Portal, add the High_Speed_Counter technology object, set count mode to Quadrature x4, set the initial count direction, and configure the Capture feature if Z (index) is used. Map the count value to a global tag, then add a cyclic OB30 (e.g. 100 ms) that reads the count, subtracts the previous value, and computes:

RPM = (delta_count / PPR_quadrature) x (60 / t_window_seconds) RPM = (delta_count / 4096) x (60 / 0.1) = delta_count x 0.014648

Wire the encoder to the S7-1200 input terminals as shown in the TIA Portal Device configuration wiring view. See the S7-1200 system manual on Siemens Support.

S7-1500 (new builds)

Use the TM Count 2x24V technology module on the ET 200MP or ET 200SP backplane. The Counting and Measuring technology object handles 24 V HTL encoders up to 200 kHz and exposes RPM directly. Configuration is done in TIA Portal under Technology Objects > Add new > Counting and Measuring.

S7-300 (legacy SIMATIC)

Use the FM 350-1 (single-channel, 500 kHz) or FM 350-2 (eight-channel, 20 kHz each) counter module. Configuration is in HW Config; the load value, comparison value, and integration time are set in the FM 350 parameter dialog. The current count is read with the CNT_CTL1 or CNT_CTL2 function block.

In all four cases the encoder must be supplied with the same voltage as the HSC input threshold (typically 24 V HTL for S7-1200/1500 onboard, 5 V TTL for older modules). A 1024 PPR encoder with line driver outputs (RS-422) may need a 24 V adapter if the S7 input is 24 V HTL; verify the encoder data sheet - most modern hollow-shaft encoders (Baumer Hubner, Heidenhain, Sick, Dynapar) ship in 5-30 V universal-voltage versions that work in both cases.

Calibration and Commissioning Procedure

Follow this sequence on a quiet shift. Two technicians are recommended - one at the encoder, one at the cabinet with a DMM.

  1. Lock-out/tag-out the welder and decouple the driven shaft so the encoder can be spun by hand or with a calibration motor.
  2. Verify encoder supply: 24 VDC +/-10% at the encoder terminal box. If the supply is below 22 V, the F/V module will undercount and the analog output will read low.
  3. Confirm channel A and B switching: with a handheld tachometer or scope, verify a clean 0-24 V square wave at 50% duty. Distorted or ringing signals indicate a wiring or termination problem.
  4. Set module DIP switches to the input range that covers f_min-f_max. For the DRF-FR, this is typically the 0-100 kHz switch position for any welder RPM with a 1024 PPR encoder.
  5. Apply 0 Hz (encoder stationary) and trim the ZERO potentiometer for 0.000 VDC at the module output.
  6. Apply a known reference RPM at the high end of the operating range (use a calibration motor with a calibrated tachometer, or use the 60 Hz mains as a coarse check by counting pulses with a DMM in frequency mode). Trim the SPAN potentiometer for the calculated V_out.
  7. Repeat steps 5 and 6 because span and zero interact on most analog front-end modules.
  8. Verify mid-point linearity at three RPM setpoints (25%, 50%, 75% of full scale) using the S7 analog input value in TIA Portal's watch table. Compare to the calculated table; deviation must be < +/-0.5% of full scale.
  9. Re-engage the driven shaft and observe the analog value on the S7 HMI. Run a slow ramp from 0 to maximum RPM; the analog must track smoothly without stepping, hunting, or saturating.
  10. Record calibration data in the asset record: encoder model and serial, F/V module serial, f_min/f_max setpoints, V_zero/V_span trim positions, S7 raw value at 0% and 100% RPM, ambient temperature.
Many F/V modules drift with temperature. The DRF-FR is specified at +/-0.3% of full scale from 0-50 deg C. For welding cells where cabinet temperatures routinely hit 45 deg C, perform the final trim while the cabinet is at operating temperature, not cold.

Welding Application: Response Time and Filtering

Welding heat control loops typically have a closed-loop bandwidth of 1-5 Hz. A 20 ms F/V module output update is well above Nyquist for the loop, but the analog input card adds a hardware integration time and the S7 analog-to-digital conversion (4 ms typical on SM 1231) adds a quantization delay. The total plant lag is therefore on the order of 30-50 ms - fast enough for line-speed tracking at any reasonable web speed.

Two filters are worth tuning:

  • F/V module output filter: most DIN-rail F/V modules provide a 1- to 10-tap moving average. Increase taps for noisy encoders (chain-driven shafts with backlash) at the cost of response. A 5-tap average is a good starting point.
  • S7 analog input software filter: in TIA Portal, the SM 1231 channel configuration has a Smoothing parameter (none, weak, medium, strong). Weak adds 1 conversion cycle of averaging - fine for most welders. Strong averages 4 cycles (~16 ms) and may be needed if the encoder signal is noisy from VFD-induced common-mode voltage.

Avoid the temptation to filter the PID loop's output instead of the input; the latter preserves control loop phase margin and is the textbook location for a low-pass filter on a measurement signal.

Finally, consider the welder's HF arc-start transients. A resistance welding control can fire the ignitron at random in the cycle and dump a 1-2 kV spike onto nearby wiring. If the analog signal spikes during arc-start, the F/V module's 24 V supply has common-mode coupling to the encoder wiring; adding a 24 VDC isolating transformer or a DC-DC isolator at the F/V module supply input will break the ground loop.

Troubleshooting Matrix

Symptom Likely cause Diagnostic Remediation
Analog output stuck at 0 VDC at all RPMs No encoder pulses reaching F/V; encoder power missing; channel A wire open Measure 24 VDC at encoder; scope channel A Restore 24 V supply; repair wiring; verify encoder supply current vs. spec
Analog output stuck at 10 VDC at all RPMs Open channel B; F/V module set to x2 with no B signal; saturation due to over-range Scope channel B; reduce RPM and observe Repair B wire; switch to x1 mode; lower encoder frequency below module f_max
Analog output reads correctly at low RPM but saturates above mid-range Module f_max DIP switch set too low; encoder is quadrature x4 and module counts only one edge Measure f_Hz at high RPM; compare to module spec Re-set module span; switch to quadrature x4 if supported
Analog output oscillates +/-0.5 VDC at steady RPM Encoder mechanical noise (shaft runout, coupling slip); EMI from welder Scope A/B at encoder terminal; check shaft alignment Add 5-tap output filter; re-align shaft; add ferrite on encoder cable
Analog output reads -2 VDC or +12 VDC (rail saturation) Missing or shared ground between F/V module and S7 AI; polarity reversed Measure V+ to chassis at module and at S7 terminal Run a dedicated ground wire from module GND to S7 AI M terminal
S7 reads 0 when F/V module reads 5 VDC S7 AI configured for current (0-20 mA) input, or measuring-range module in wrong position Check AI configuration in TIA Portal; check S7-300 measuring-range module Re-configure channel for 0-10 V; re-seat measuring-range module to B (0-10 V)
S7 reading drifts over 8-hour shift Temperature drift in F/V module; encoder supply sagging Log module output vs. ambient temperature for 8 hours Re-calibrate at operating temperature; upgrade to higher-grade module (Acromag IP340)
Welder heat oscillates or overshoots after retrofit Loop tuning was based on the old DC tachometer's response; new signal has different lag Open-loop step response test on welder heat Re-tune PID (reduce Kp, increase Td); add 1st-order low-pass on S7 tag
Reading is correct in shop but wrong in field Encoder cable run crosses VFD output cable; common-mode injection Reposition cable and observe Re-route cable; use shielded cable with 360 deg shield termination at both ends

FAQ

What frequency range does the F/V module need for a 1024 PPR encoder at 3000 RPM?

At 3000 RPM, the encoder produces f = (3000 / 60) x 1024 = 51 200 Hz. Pick a module with at least 75 kHz input range for 1.5x headroom - Omega DRF-FR (100 kHz) or Phoenix Contact MINI MCR-2-F-UI (120 kHz) both qualify.

Can I connect the encoder directly to a Siemens S7-1200 and skip the F/V module?

Yes, if the PLC program can be modified. Use the onboard high-speed counter in quadrature x4 mode, count in a cyclic OB, and compute RPM in the CPU. The legacy 0-10 V input can be left unused. If the program is frozen (validated process, 21 CFR Part 11, GAMP 5), the F/V path is required.

Why does the analog output drift with temperature?

Most DIN-rail F/V modules use analog front-end components (charge pumps, op-amps, voltage references) that drift with temperature. Industrial-grade modules specify +/-0.3% of full scale over 0-50 deg C. For welding cells with high cabinet temperatures, re-calibrate hot or use a higher-stability module such as the Acromag IP340.

Do I need a 5 V or 24 V encoder for the S7-1200 onboard HSC?

The S7-1200 onboard HSC is 24 V HTL. Use a 24 V hollow-shaft encoder (e.g. SICK DFS60, Baumer EFLM, Heidenhain EQI). If the encoder is RS-422 line driver, add a 24 V adapter (e.g. Phoenix Contact FL MGUARD or a simple line-driver-to-HTL converter) or use a 24 V version of the encoder.

How do I scale the S7 analog input in TIA Portal?

Use the SCALE_X or NORM_X blocks (TIA Portal V15+) or the legacy FC105. The S7-1200 SM 1231 in 0-10 V mode returns 0-27648. Scale to RPM with: RPM = (raw / 27648) x (RPM_max - RPM_min) + RPM_min. For the 200-1800 RPM example, RPM = (raw / 27648) x 1600 + 200.

Back to blog