Scaling REAL Speed Setpoints to 0-4000 HEX Drive Telegrams in SIMATIC PCS 7 CFC

Scaling REAL Speed Setpoints to 0-4000 HEX Drive Telegrams in SIMATIC PCS 7 CFC

In SIMATIC PCS 7 (v7.0 through v9.1), transmitting a motor speed setpoint (REAL value, 0.0 to 50.0 Hz) from Continuous Function Charts (CFC) to variable frequency drives (such as SINAMICS S120, S150, or G120) over PROFIBUS DP or PROFINET requires normalizing the value to the PROFIdrive standard format. Under the PROFIdrive profile, 100% nominal speed (p2000 reference frequency, typically 50.0 Hz) is represented by 16#4000 HEX (16384 decimal). To scale this in CFC, divide the engineering speed setpoint by the reference frequency (50.0), multiply by 16384.0, clamp the result to valid limits, and convert from REAL to WORD. Alternatively, deploying the standard Drive ES PCS 7 or SINAMICS PCS 7 library block (SINASPEED / MotSpdCL) executes this normalization and telegram mapping automatically.

Table of Contents

The PROFIdrive Setpoint Normalization Standard

In industrial drive engineering, variable frequency drives (VFDs) communicate with automation controllers over fieldbus networks (PROFIBUS DP and PROFINET IO) using standardized communication profiles. Siemens SINAMICS drives (S120, S150, G120) and legacy SIMOVERT MASTERDRIVES conform to the PROFIdrive Profile.

Under PROFIdrive (Standard Telegrams 1, 20, 352, etc.), cyclic communication data is exchanged via Process Data (PZD) words:
- PZD 1: Control Word 1 (STW1) from PLC to Drive; Status Word 1 (ZSW1) from Drive to PLC.
- PZD 2: Main Speed Setpoint (NSOLL_A or NSOLL_B) from PLC to Drive; Actual Speed Feedback (NIST_A or NIST_B) from Drive to PLC.

Unlike process automation where values are often passed as 32-bit floating-point numbers (IEEE 754 REAL), the PROFIdrive cyclic setpoint NSOLL_A is transmitted as a signed 16-bit integer (WORD / INT) where:
$$100.0\%\text{ Reference Speed } (p2000) \equiv 16384\text{ decimal } \equiv 16#4000\text{ hexadecimal}$$
$$-100.0\%\text{ Reference Speed } (p2000) \equiv -16384\text{ decimal } \equiv 16#C000\text{ hexadecimal}$$
$$+199.99\%\text{ Maximum Overspeed } \equiv +32767\text{ decimal } \equiv 16#7FFF\text{ hexadecimal}$$

Mathematical Derivation of the 0 to 16#4000 Hex Range

To convert an engineering process setpoint (e.g., $SP_{Hz}$ from $0.0\text{ Hz}$ to $50.0\text{ Hz}$) into the integer telegram format:

Step 1: Identify Drive Reference Frequency (p2000)

In the SINAMICS drive parameter configuration (via STARTER or Startdrive), check parameter p2000 (Reference Frequency). In standard European and Asian installations, p2000 is typically set to $50.0\text{ Hz}$ (or $60.0\text{ Hz}$ in North America).

Step 2: Establish the Linear Scaling Formula

$$\text{Setpoint}{Word} = \left(\frac{SP\right) \cdot 16384.0$$}}{p2000

Example Calculations:
- 0.0 Hz (Stop):
$$\text{Setpoint}{Word} = \left(\frac{0.0}{50.0}\right) \cdot 16384.0 = 0 \rightarrow 16#0000$$
- 25.0 Hz (Half Speed):
$$\text{Setpoint}
\right) \cdot 16384.0 = 8192 \rightarrow 16#2000$$} = \left(\frac{25.0}{50.0
- 50.0 Hz (Full Speed):
$$\text{Setpoint}_{Word} = \left(\frac{50.0}{50.0}\right) \cdot 16384.0 = 16384 \rightarrow 16#4000$$

Implementing Setpoint Scaling in CFC Using Elementary Blocks

If the project does not have the optional Drive ES library installed, engineers can assemble the scaling logic directly in Continuous Function Chart (CFC) using standard mathematical and conversion blocks from the STEP 7 Elementary Library:

flowchart LR
    A["Speed Setpoint SP<br/>(REAL: 0.0 - 50.0 Hz)"] --> B["DIV_R<br/>(Divide by 50.0)"]
    B --> C["MUL_R<br/>(Multiply by 16384.0)"]
    C --> D["LIMITS_R<br/>(Clamp: 0.0 to 16384.0)"]
    D --> E["R_TO_DI<br/>(Round Real to DINT)"]
    E --> F["DI_TO_W<br/>(Convert to WORD)"]
    F --> G["PZD 2 Output<br/>(Pcs7AnOu / PQW Word)"]

Detailed CFC Interconnection Steps:

  1. Insert DIV_R (Floating-point division):
    - Connect input IN1 to the Speed Setpoint (REAL).
    - Set input IN2 to the drive reference frequency: 50.0.
  2. Insert MUL_R (Floating-point multiplication):
    - Connect input IN1 to DIV_R.OUT.
    - Set input IN2 to 16384.0.
  3. Insert LIMITS_R (Limiter):
    - Connect input IN to MUL_R.OUT.
    - Set MN (Minimum) to 0.0 (or -16384.0 for reversing drives).
    - Set MX (Maximum) to 16384.0 (or 32767.0 if overspeed is permitted).
  4. Insert R_TO_DI (Real to Double Integer converter):
    - Connect input IN to LIMITS_R.OUT.
  5. Insert DI_TO_W (Double Integer to Word converter) or use W_BO / block mapping:
    - Connect input to R_TO_DI.OUT.
  6. Connect the output WORD to the peripheral output word corresponding to PZD 2 of the drive telegram (e.g., via Pcs7AnOu or direct peripheral address PQW 514).

Implementing Setpoint Scaling Using Standard Drive ES Blocks

In modern SIMATIC PCS 7 systems, the recommended best practice is utilizing the Drive ES PCS 7 library or SINAMICS PCS 7 APL library blocks:

  1. Insert the dedicated drive driver block SINASPEED (FB1860) or MotSpdCL (FB1854).
  2. Parameterize the block interface:
    - Set parameter RefFreq (or SP_OpScale.High) to 50.0.
    - Connect the operator setpoint SP_Ext or SP_Int directly in engineering units ($0.0 - 50.0\text{ Hz}$).
  3. The block automatically handles:
    - Normalization to $16#4000$ HEX for PZD 2.
    - Bit-level assembly of Control Word 1 (STW1: ON/OFF1, OFF2, OFF3, Enable Inverter).
    - Unpacking of Status Word 1 (ZSW1: Ready to Run, Fault, Warning) and conversion of Actual Speed feedback (NIST_A) back into engineering units ($0.0 - 50.0\text{ Hz}$) for faceplate display.

PROFIdrive Setpoint and Normalization Matrix

The following matrix details the relationship between engineering frequencies, decimal integers, hexadecimal words, and drive percentage:

Motor Operating ConditionEngineering Value (Hz)PROFIdrive PercentageSigned Integer (Decimal)Hexadecimal Telegram WordFull Reverse (100%)$-50.0\text{ Hz}$$-100.0\%$$-16384$16#C000Half Reverse (50%)$-25.0\text{ Hz}$$-50.0\%$$-8192$16#E000Zero Speed (Stop)$0.0\text{ Hz}$$0.0\%$$0$16#0000Creep Speed (10%)$+5.0\text{ Hz}$$+10.0\%$$+1638$16#0666Half Forward (50%)$+25.0\text{ Hz}$$+50.0\%$$+8192$16#2000Nominal Forward (100%)$+50.0\text{ Hz}$$+100.0\%$$+16384$16#4000Maximum Overspeed (150%)$+75.0\text{ Hz}$$+150.0\%$$+24576$16#6000

Verification

To confirm that setpoint scaling functions accurately:
1. In CFC, open the scaling chart in online monitoring mode.
2. Enter a test setpoint of 25.0 ($25.0\text{ Hz}$).
3. Verify that MUL_R.OUT reads 8192.0 and the output word to the drive displays 16#2000.
4. Enter 50.0 ($50.0\text{ Hz}$); verify that the output word displays 16#4000.
5. On the physical SINAMICS drive operator panel (BOP-2, AOP30) or in STARTER software:
- Check parameter r2050[1] (Received Process Data PZD 2): Confirm it displays 16#4000.
- Check parameter r0021 (Actual Speed Setpoint): Confirm it displays 50.00 Hz or matching RPM.

Limitations and Operational Precautions

Observe the following precautions when configuring drive telegrams:
- Telegram Parameter Mismatch (p2000): Always ensure the reference frequency configured in the PLC math logic (50.0 Hz) matches drive parameter p2000 exactly. If p2000 in the drive is set to 60.0 Hz while the PLC divides by 50.0, the motor will overspeed by $20\%$.
- Overflow Protection: Always clamp the REAL setpoint with LIMITS_R before converting to integer. If an unconstrained math operation passes a value greater than $32767.0$ to R_TO_DI, the integer will overflow into negative values, commanding an unexpected emergency reversal!
- Control Word Interlocking: Transmitting a speed setpoint word alone will not rotate the motor. The drive requires a valid Control Word 1 (STW1) sequence: bit 0 transitioning from $0 \rightarrow 1$ with enable bits (OFF2, OFF3, Inverter Enable) asserted.

Engineer FAQ

Why does SINAMICS use 16#4000 for 100% instead of 16#7FFF?

Under the PROFIdrive standard, 16#4000 (16384 decimal) represents 100% nominal speed (p2000), leaving the range between 16385 and 32767 (up to 16#7FFF) available to command overspeed up to nearly 200% without changing telegram structure.

How do I command reverse rotation in PROFIdrive?

You can command reverse rotation either by sending a negative setpoint (using two's complement, where -16384 is 16#C000) or by keeping the setpoint positive and toggling the direction bit in Control Word 1 (STW1.Bit11).

Can I use standard APL MotSpdCL block with non-Siemens drives?

Yes. MotSpdCL provides standard setpoint and feedback interfaces. As long as the non-Siemens drive communicates via PROFIdrive or is mapped via standard PZD words, MotSpdCL can control it.

Technical References

Related Articles

Related Tags

  • SINAMICS
  • PROFIdrive
  • Scaling
  • CFC
  • VFD
  • SIMATIC PCS 7
  • Motion Control
6 respuestas