September 18, 2025
Implementing Motor Speed Control and Monitoring in TIA Portal
Motor speed control and monitoring is a common industrial automation task. In Siemens TIA Portal, it typically involves converting between…

By Christine Muchiri
3 min read
Motor speed control and monitoring is a common industrial automation task. In Siemens TIA Portal, it typically involves converting between engineering values (e.g., revolutions per minute) and raw PLC/analog module values, and ensuring that the motor is properly safely monitored.
In this article, I walk you through two custom functions I developed today:
MOTOR_SPEEDCONTROL (FC10) → Converts a setpoint speed in RPM to an analog output value for the drive.
MOTOR_SPEEDMONITORING (FC11) → Monitors the actual feedback speed and flags or trips if it's out of range.
These two functionalities are the foundation of a sound and safe motor control strategy.
Part 1: Motor Speed Control (FC10)
The speed will be specified in an input of the "MOTOR_SPEEDCONTROL" [FC10] function in revolutions per minute (range: ±50 rpm). Data type: 32-bit floating-point number (Real).
Validation
The function initially checks the validity of the speed setpoint within the range of ±50 rpm.
If the setpoint speed is outside this range, a MOVE instruction forces the manipulated variable speed to 0 and the return value is set to TRUE (1)
Normalization and Scaling
With valid input, the speed setpoint is first normalized to the range 0…1.
The normalized value is then scaled to ±27648, as a 16-bit integer (Int).
This corresponds to the analog output range (±10 V).
Output
The scaled manipulated value speed is sent to analog output.
The output is associated with signal U1 (manipulated value speed of motor).
In this case, ±10 V corresponds to ±50 rpm, and motor speed can be regulated in the forward and backward directions.
Place a CALL to FC10 in OB1 and map inputs/outputs
Part 2: Motor Speed Monitoring (FC11)
In this task, a function called MOTOR_SPEEDMONITORING (FC11) will be used. The function constantly monitors the actual motor speed and compares it to predetermined limit values. Warning or error signals are generated if there is an overshoot of limits. Error signals will be used to trip the MOTOR_AUTO (FB1) block for motor protection.
Function Description
Input The motor's actual speed is read through sensor channel B8. The analog input provides a ±10 V signal, linearly scaled to ±50 rpm, of data type INT (16-bit).
Step 1 — Normalization The INT input value of the range −27,648 … +27,648 is normalized to the range ±1.0 floating-point value (REAL) initially.
Step 2 — Scaling to rpm The normalized value is scaled to the actual motor speed in rpm (±50.0), output as a REAL.
Step 3 — Limit monitoring: The scaled motor speed is compared with four floating-point thresholds (REAL), supplied at FC11 inputs:
Motor_speed_monitoring_error_max→ Speed > Error MaxMotor_speed_monitoring_warning_max→ Speed > Warning MaxMotor_speed_monitoring_warning_min→ Speed < Warning MinMotor_speed_monitoring_error_min→ Speed < Error Min
Outputs
ActualSpeedRpm(REAL): the scaled motor speedError_Max(BOOL): TRUE if speed exceeds Error MaxWarning_Max(BOOL): TRUE if speed exceeds Warning MaxWarning_Min(BOOL): TRUE if speed falls below Warning MinError_Min(BOOL): TRUE if speed falls below Error Min- speed_monitoring_trip (BOOL): TRUE if
Error_Max or Error_Min is TRUE
If an error condition occurs (Error_Max or Error_Min TRUE), the MOTOR_AUTO (FB1) block must be tripped for protection.
Place a CALL to FC11 in OB1 and map inputs/outputs
The MOTOR_AUTO function block already handles the motor start/stop command and safety interlocks. We extend it with one more interlock input called speed_monitoring_trip
- If speed_monitoring_trip = TRUE, the motor output coil (Q3) is forced OFF regardless of other conditions.
Conclusion
In this exercise, we developed two significant functions that work together to ensure safe and stable motor operation:
FC10 — MOTOR_SPEEDCONTROL: Takes the translation of operator speed setpoints (±50 rpm) and develops it into a valid manipulated variable for the analog output. By means of limit checking, normalizing, and scaling, it sends the motor the correct voltage for the desired speed.
FC11 — MOTOR_SPEEDMONITORING: Reads real motor speed feedback from the sensor, converts to engineering units (rpm), and compares with warning and error limits on a continuous basis. Exceeding these limits provides warnings or trips to protect the motor and the system.
Finally, we paired FC11 with the MOTOR_AUTO (FB1) block with an interlock. This ensures that upon detection of an error condition, the motor is safely tripped to prevent damage and improve system reliability.
These two functions combined demonstrate how speed monitoring and speed control complement each other in a PLC-based motor control system: one ensures correct actuation, while the other ensures safety and protection.