Simulating PROFIdrive Telegrams and State Machines in SIMIT Component Type Editor

Simulating PROFIdrive Telegrams and State Machines in SIMIT Component Type Editor

In SIMIT Simulation Platform, interfacing custom drive components with PCS 7 APL channel blocks like FbDrive (FB1881) requires modeling the PROFIdrive profile state machine inside the Component Type Editor (CTE). The component parses the control word STW1 (evaluating bit 0 'ON/OFF1', bit 1 'OFF2 Coast Stop', bit 2 'OFF3 Quick Stop', and bit 3 'Enable Operation') and generates the matching status word ZSW1 (asserting 'Ready to Switch On', 'Switched On', and 'Operation Enabled'). By implementing this bitwise state machine in CTE behavioral code, virtual drives respond realistically to controller telegrams without password-protected factory blocks.

Table of Contents

Executive Summary

Virtual commissioning of variable speed drives in SIMATIC PCS 7 requires more than simple boolean feedback; advanced control loops utilize APL channel blocks (such as FbDrive FB1881 or MotSpdCL FB1854) communicating via standard PROFIdrive telegrams (e.g., Telegram 1 or Telegram 20). When engineers attempt to model drive behavior in SIMIT using basic boolean delay blocks or find standard drive models locked behind passwords, the PCS 7 controller fails to establish drive control, reporting communication timeouts or stuck status states.

The PCS 7 FbDrive block strictly enforces the standardized PROFIdrive Profile state transition sequence: it asserts command bits in Control Word 1 (STW1) and awaits exact sequential bit affirmations in Status Word 1 (ZSW1) before releasing speed setpoints. If the simulation model does not replicate these state transitions, the drive never enters the 'Operation Enabled' state. This guide provides the complete PROFIdrive state machine logic and SIMIT CTE source code required to build high-fidelity virtual drives.

Architecture and Fundamental Mechanics

The PROFIdrive state machine governs drive lifecycle through standardized 16-bit word exchanges:

  1. Control Word 1 (STW1) Bit Functions (Controller to Drive):
    - Bit 0 (ON / OFF1): 0 = Ramp stop; 1 = Ready for power on.
    - Bit 1 (OFF2): 0 = Coast stop (immediate electronic disconnect); 1 = Operating condition.
    - Bit 2 (OFF3): 0 = Quick stop; 1 = Operating condition.
    - Bit 3 (Enable Operation): 0 = Disable inverter pulses; 1 = Enable pulse generation and speed modulation.
    - Bit 10 (Control by PLC): 1 = Remote automation system commands drive.

  2. Status Word 1 (ZSW1) Bit Functions (Drive to Controller):
    - Bit 0 (Ready to Switch On): DC link charged, electronics active.
    - Bit 1 (Ready to Operate): Main power ready, waiting for operation enable.
    - Bit 2 (Operation Enabled): Pulses enabled, drive rotating or tracking setpoint.
    - Bit 3 (Fault Present): Trip condition active.
    - Bit 6 (Switch-on Inhibit): Interlocked until fault cleared.

  3. The Sequential State Machine in SIMIT CTE:
    - State 0 (Not Ready): Initial power up.
    - State 1 (Ready to Switch On): DC link charged, ZSW1.0 = 1.
    - State 2 (Switched On): STW1.0 = 1, STW1.1 = 1, STW1.2 = 1 -> Drive asserts ZSW1.1 = 1.
    - State 3 (Operation Enabled): STW1.3 = 1 -> Drive asserts ZSW1.2 = 1 and releases internal speed ramps.

Step-by-Step Implementation Procedure

Follow these steps to program a PROFIdrive state machine component in SIMIT CTE:

  1. Create Component and Terminals in CTE:
    - Open SIMIT Component Type Editor.
    - Create a new component: PROFIdrive_Telegram1_Sim.
    - Declare inputs:

    • STW1 (Integer / Word, Control Word from PCS 7 FbDrive.PZDOut1).
    • NSOLL_A (Integer, Speed Setpoint, 16#4000 = 100% speed).
    • Declare outputs:
    • ZSW1 (Integer / Word, Status Word to PCS 7 FbDrive.PZDIn1).
    • NIST_A (Integer, Speed Feedback to PCS 7 FbDrive.PZDIn2).
    • Speed_Percent (Real, Engineering Value).
  2. Program Bit Extraction and State Machine in Behavior Code:
    - In the CTE 'Behavior' editor, decode control bits and evaluate the state transitions:
    ```text
    // Bit masks for STW1
    b_ON := (STW1 AND 16#0001) <> 0;
    b_NoOFF2 := (STW1 AND 16#0002) <> 0;
    b_NoOFF3 := (STW1 AND 16#0004) <> 0;
    b_Enable := (STW1 AND 16#0008) <> 0;
    b_Ack := (STW1 AND 16#0080) <> 0;

    // PROFIdrive State Transitions
    IF NOT b_NoOFF2 OR NOT b_NoOFF3 THEN
    DriveState := 0; // Coast or Quick Stop
    ELSIF DriveState = 0 THEN
    IF b_NoOFF2 AND b_NoOFF3 THEN DriveState := 1; END_IF; // Ready to Switch On
    ELSIF DriveState = 1 THEN
    IF b_ON THEN DriveState := 2; END_IF; // Switched On
    ELSIF DriveState = 2 THEN
    IF NOT b_ON THEN DriveState := 1;
    ELSIF b_Enable THEN DriveState := 3; END_IF; // Operation Enabled
    ELSIF DriveState = 3 THEN
    IF NOT b_Enable THEN DriveState := 2;
    ELSIF NOT b_ON THEN DriveState := 1; END_IF;
    END_IF;

    // Construct ZSW1 based on State
    w_ZSW1 := 16#0200; // Bit 9: Control Requested
    IF DriveState >= 1 THEN w_ZSW1 := w_ZSW1 OR 16#0001; END_IF; // Ready to Switch On
    IF DriveState >= 2 THEN w_ZSW1 := w_ZSW1 OR 16#0002; END_IF; // Ready to Operate
    IF DriveState = 3 THEN w_ZSW1 := w_ZSW1 OR 16#0004; END_IF; // Operation Enabled
    ZSW1 := w_ZSW1;
    ```

  3. Program Speed Response in Integer Format (NIST_A):
    - Scale normalized integer 16#4000 (decimal 16384) to 100%:
    ```text
    IF DriveState = 3 THEN
    // Ramp to setpoint
    TargetSpeed := (REAL(NSOLL_A) / 16384.0) * 100.0;
    ActualSpeed := ActualSpeed + (TargetSpeed - ActualSpeed) * (_dt / 3.0);
    ELSE
    ActualSpeed := ActualSpeed - (ActualSpeed * (_dt / 2.0));
    END_IF;

    Speed_Percent := ActualSpeed;
    NIST_A := INT((ActualSpeed / 100.0) * 16384.0);
    ```

  4. Compile and Deploy to SIMIT Project:
    - Compile the component in CTE with 0 Errors.
    - In SIMIT, drop the component onto a chart and map STW1/ZSW1/NSOLL/NIST to the S7-PLCSIM or Virtual Controller coupling.
    - Start the simulation.

Verification

  1. In SIMATIC Manager Test Mode, monitor the FbDrive block in CFC.
  2. Issue a Start command from the WinCC faceplate: verify that FbDrive cycles STW1 through 16#047E to 16#047F.
  3. In SIMIT, verify that PROFIdrive_Telegram1_Sim transitions from State 1 to State 3 and returns ZSW1 = 16#0237 (Operation Enabled).
  4. Confirm that the WinCC faceplate switches to 'Running' and displays live ramping motor speed feedback.

Limitations and Operational Precautions

Ensure that the telegram format chosen in SIMIT matches the hardware configuration in HW Config (e.g., Telegram 1: 2 words IN / 2 words OUT; Telegram 20: 2 words IN / 6 words OUT). Integer overflows during scaling must be protected with boundary clamps (-16384 to +16384). SIMIT modeling software and Virtual Controller couplings should be verified through an authorized Siemens distributor or the Siemens Industry Mall.

Engineer FAQ

What is the standardized integer value for 100% speed in PROFIdrive?

16#4000 (decimal 16384) represents 100% nominal speed in standard PROFIdrive telegrams.

What bit in STW1 enables pulse generation and operation?

Bit 3 (Enable Operation) transitions the drive into active modulation.

What status word code confirms 'Operation Enabled' in Telegram 1?

Bits 0, 1, and 2 asserted in ZSW1 (typically 16#0237 or 16#0277 depending on warning bits).

Can this CTE model simulate drive fault trips?

Yes, by adding a boolean Fault_Inject input that asserts Bit 3 in ZSW1 and locks the state machine into Switch-On Inhibit.

Does SIMIT require separate licenses for custom CTE components?

No. The ability to execute custom CTE components is included in standard SIMIT engineering licenses.

Technical References

Related Articles

Related Tags

  • SIMIT
  • PROFIdrive
  • Telegram 1
  • STW1
  • ZSW1
  • FbDrive
20 respuestas