...
Home / PID-Based Temperature Control of an Incandescent Lamp

PID-Based Temperature Control of an Incandescent Lamp

In the world of industrial automation and temperature regulation, PID (Proportional–Integral–Derivative) control is one of the most reliable and widely used techniques. This article walks through a hands-on case study of using a PID controller to regulate the temperature of an incandescent lamp. We’ll cover the entire process: from hardware setup and wiring to ladder logic programming, PID parameter configuration, and tuning.

1. Hardware Overview

In this example, an incandescent lamp is used as the heat source. A K-type thermocouple is used for direct temperature sensing from the lamp’s surface. A solid-state relay (SSR) controls the on/off state of the lamp, and a GT_070_32MC_8TC all-in-one controller is used to execute the PID control logic.

  • Heat source: Incandescent bulb
  • Temperature sensor: K-type thermocouple
  • Controller: GT_070_32MC_8TC
  • Relay: 3–32V DC input, 24–240V AC load, 15A

2. Wiring Instructions

a) Thermocouple Connection

Connect the thermocouple to the controller’s TA+ and TGND terminals.

b) SSR and Lamp Circuit

  1. Connect the live wire of the 220V AC supply to the input (normally open) terminal of the SSR.
  2. Connect the output side of the SSR to the lamp.
  3. Connect the neutral wire directly to the lamp.
  4. Connect SSR+ to +24V, SSR– to Y0, and COM to –24V.

3. Ladder Diagram Programming

Use SKTOOL7.1 to create the project, and open the ladder diagram using SamSoar2022.

Figure 1 Project Manager Window

Add normally open contacts and PID instructions in the ladder diagram.

 (a) Normally open contact                                                            (b) PID control instruction

Figure 2 Positions of normally open contact and PID instruction

 

Add as shown in the following figure.

Figure 3 Ladder diagram

4. PID Parameter Configuration

Click the advanced option button of PID in Figure 3, and set PID parameters in the pop-up interface.

(1) In this example, PID loop 0 is used, and the input is AI0 (i.e., analog input channel).

(2) The PID mode is manual mode, and the output is Y000 (in this example, it is a switching output, and the temperature is controlled by controlling the on-off time of the Y000 port).

(3) The parameter starting address is D1000 (this parameter selects the starting address for storing other PID parameters, occupying 18 consecutive D registers).

(4) The target value is the final target value set for PID, which is set to the D100 register in this example.

Click the OK button after setting.

Figure 4 PID Parameter Setting Interface

5. PID Initialization Values

Select View -> Window -> Open soft element initialization window in the upper menu bar.

Figure 5 Opening the soft element initialization window

Add the parameter starting addresses D1000~D1017 just configured in the soft element initialization window, and configure PID parameters as shown in the following figure (note the difference in data types). The PID parameters corresponding to each register are available in the PID parameter setting interface in Figure 4.

Figure 6 Soft Component Initialization Settings

Configure D1008 sampling period as 1000ms (it should not be too low in temperature control scenarios, otherwise the fluctuation will be large), D1015 as 1 to enable self-tuning, and D1016 as 100, which means that if PID self-tuning is not completed after 100 fluctuation cycles, it will fail, and the self-tuning state D1015 will be set to 2.

The explanations of each parameter are as follows:

D1000: Proportional parameter KP: The output of the controller is proportional to the input deviation value. Once a deviation occurs in the system, the proportional adjustment immediately produces an adjustment effect to reduce the deviation. Characteristics: The process is simple and fast, and the proportional effect is large, which can speed up the adjustment and reduce the error; however, it reduces the system stability, causes instability, and has residual error. The data type is 32-bit floating-point number.

D1002: Integral time TI (ms): The integral link is mainly used to eliminate the steady-state error. The so-called steady-state error is the difference between the output value and the set value after the system is stable. The integral link is actually the process of accumulating deviations, and the accumulated error is added to the original system to offset the steady-state error caused by the system. The data type is 32-bit floating-point number.

D1004: Derivative time TD (ms): The derivative signal reflects the change law or trend of the deviation signal. It performs advanced adjustment according to the change trend of the deviation signal, thereby improves system responsiveness or speed of response. The data type is 32-bit floating-point number.

D1006: PID control dead zone: When the PID generates a control effect, if the error is less than the dead zone value, the PID will stop calculating and maintain the previous state output. The data type is 32-bit floating-point number.

D1008: Sampling time (ms): This time is the data input and PID output refresh time. It needs to be set to different values according to different systems, and cannot be less than the scanning cycle. In addition, the relay-type all-in-one machine cannot set it too small. The data type is 32-bit floating-point number.

D1010~D1013 Given value lower limit / Given value upper limit: The PID output is limited to this range (no limit in this example). The data type is 32-bit floating-point number.

D1014: Direction: Direction 1 indicates positive PID output (such as heating), and 0 indicates reverse output (such as cooling).

D1015: Self-tuning state: 0 indicates tuning completed, 1 indicates tuning in progress, and 2 indicates tuning failed.

D1016: Tuning sampling points: When PID self-tuning is adopted (i.e., the self-tuning state is 1), this value means that if the PID fails to complete tuning within the set number of points, it is judged as a failure (if set to K30, it means that if the PID self-tuning is not completed after 30 sampling cycles, it will fail, and the self-tuning state will be set to 2).

Output quantity: When the output type is 0, this value represents the on-time of the bit component; when the output type is 1, this value is invalid.

D1017: PID output: When this address is a bit component (ensure the output type is 0), the PID control quantity is the positive pulse width of this component; when this address is a word component, the PID calculation result is output here.

6. Program Download and Testing

  • Go to Tools → Download → Modify Configuration → Analog Setting.
  • Enable AI0, set input type, and apply settings.
  • Download the ladder program to the controller.

Figure 7 Download Interfac

After the download is completed, open the monitoring, and enter the target value 400 in the D100 register. Set M0 to 1 to enable PID control and wait for the self-tuning to complete. The self-tuning function will automatically configure KP, TI, and TD parameters.

Figure 8 Timing diagram at the start of self-tuning

As shown in Figure 8, self-tuning is enabled at 1 minute and 30 seconds, with the temperature value being 400 and the set value being 500. Self-tuning ends at 4 minutes and 50 seconds. After self-tuning, the temperature stabilizes within the set value of 500±1.

Figure 9 Timing diagram of set value change

Change the set value to 600. As shown in the above figure, the temperature transition is relatively smooth, and the temperature value stabilizes within 600±1 after one minute.

Figure 10 Timing diagram of set value change

Finally, set the temperature value to 700. As shown in the above figure, the temperature value stabilizes at the new target value quickly.

Conclusion

This case study demonstrates how PID control can effectively manage temperature for heating systems like incandescent lamps. With built-in self-tuning and flexible parameter settings, such systems can be easily implemented in packaging, drying, or heating applications.

Need Help?

If you need access to the ladder logic files or want assistance applying PID to your project, feel free to contact us or leave a comment below.

Tags: PID Control, PLC, Temperature Regulation, Ladder Logic, SamSoar2022, GT_070_32MC_8TC, Automation

 

Get in Touch Now!

We'll response within 12 hours.