Design of PID Temperature Control System Based on AT89S51 Single Chip Microcomputer

Publisher:幸福的家园Latest update time:2014-08-26 Source: 互联网Keywords:AT89S51 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

  Temperature control technology not only plays a very important role in industrial production, but also plays a vital role in daily life. This paper designs the hardware and software of the system. On the basis of establishing the mathematical model of the temperature control system, the system controller is designed through the analysis of PID control, and the software and hardware debugging of the system is completed. The algorithm is simple, reliable, and robust, and the PID controller parameters directly affect the control effect.

  1. System Overview

  1.1 Overall system structure

  The system uses the rich peripheral modules of AT89S51 to build the hardware platform. The hardware circuit of the system includes: analog part and digital part. The basic circuit consists of core processing module, temperature acquisition module, keyboard display module and control execution module.

  1.2 System Workflow

  When the system starts working, the single-chip control software first issues a temperature reading instruction, collects the current temperature value of the controlled object through the digital temperature sensor and sends it to the display screen for real-time display. Then, the temperature measurement value is compared with the set value T, and the difference is sent to the PID controller. After processing, the PID controller outputs a certain value of the control quantity, which is converted into an analog voltage by D/A to control the controlled object to heat.

  1.3 System Software Design Method

  The whole system software design includes two parts: management program and control program. The management program includes dynamic refresh of LED display, control indicator light, and keyboard scanning and response. The control program includes A/D conversion, median filtering, over-limit alarm processing, PID calculation, etc.

  2. System hardware structure

  2.1 Design of power supply circuit

  The DC power supply used in the system is provided by a series DC regulated power supply composed of three-terminal integrated voltage regulators. The design uses three three-terminal integrated voltage regulators, LM7805, LM7815 and LM7915, to provide +5V DC voltage, and the output current is 1A. The transformer steps down the 220V mains power and then rectifies it through a rectifier bridge. A large-capacity electrolytic capacitor is used for filtering to reduce the output voltage ripple. The power supply circuit diagram is shown in Figure 1.

  

 

  Figure 1 Power supply circuit diagram

  2.2 Reset Circuit Design

  The quality of the microcontroller reset circuit design directly affects the reliability of the entire system. Only a reliable reset circuit can prevent the system from "freezing" and "program failure". The circuit diagram is shown in Figure 2.

  

 

  Figure 2 Reset circuit diagram

  2.3 Clock Circuit Design

  This controller uses an internal oscillation method to obtain the clock signal of the microcontroller. The clock signal obtained in this way is relatively stable. Figure 3 is a clock circuit.

  

 

  Figure 3 Clock circuit diagram

  2.4 SCR output circuit

  Silicon controlled rectifier is a power semiconductor device, referred to as SCR, also known as thyristor. This part is a bidirectional silicon controlled rectifier drive circuit for controlling the power of the electric heating furnace, using MOC3041 as the drive circuit. As shown in Figure 4.

  

 

  Figure 4 SCR output circuit   2.5 Sound and light alarm circuit module

  When the temperature measurement value of a channel exceeds the preset upper or lower limit alarm value or the system fails, the system will issue an audible and visual alarm to alert the user, as shown in Figure 5.

  

 

  Figure 5 Sound and light alarm circuit diagram

  3. System software design

  3.1 System main program design

  In the reactor system, the main function of the main program is to set the relevant variables used in the program execution process, allocate registers, initialize the required parameters, call the corresponding functional modules according to the timer interrupt program, and complete certain tasks.

  3.2 System subroutine design

  3.2.1 Display subroutine

  LED display modes include static and dynamic display. The dynamic scanning display circuit connects all the same field lines of each display together, which are controlled by an 8-bit I/O port, and the common end (common anode or common cathode COM) of each bit is controlled by another I/O port. Since this connection method connects the field lines of each same field together, when the field code is output, each bit will display the same content. Therefore, in order to display different content, it is necessary to adopt a rotation display method.

  3.2.2 Timing subroutine

  The timing program is mainly used to complete the duty cycle control of the table lookup. The overall idea is to use different timings to change the on and off of the relay according to the different values ​​of the duty cycle control variable U in the control table. According to the characteristics of the relay, it is required not to be on and off frequently, so the on and off time must be a certain length of time, but it must also be considered that the control can take corresponding actions in time according to the changes in the new collected values ​​and set values.

  4. Control scheme

  4.1 PID control

  PID controller is a linear controller that forms a control deviation based on a given value and an actual output value, and controls the controlled object by linearly combining the deviation proportion, integral and differential to form a control quantity.

  4.2 PID parameter tuning

  Since the output of the PID controller is a linear combination of the proportional, differential and integral effects of the system deviation, adjusting the linear coefficients of each part is the key to the control performance of the PID controller. The PID controller parameters must be adjusted according to the specific controlled object, and the expanded critical proportionality method is adopted:

  (a) Select a suitable sampling period T. The so-called suitable means that the period is small enough, generally it should be selected to be less than 1/10 of the pure lag time of the object;

  (b) Allow the controller to perform pure proportional control only, gradually increase the proportional coefficient Kp from small to large, until the system has critical oscillation, and record the critical oscillation period Ts and critical oscillation gain Ks at this time;

  (c) Select the appropriate control degree. The so-called control degree is the ratio of the integral of the square of the error of the transition process corresponding to the digital controller and the analog regulator;

  (d) Look up the table based on the control degree.

  4.3 Matlab simulation

  Through the comprehensive application of the above tuning methods, the parameters of the PID controller are: Kp=1.75, Ki=0.0125, Kd=3. The simulation model of the temperature control system is established in the MATLAB/Simulink environment, as shown in Figure 6. After simulation, the system step response curve is obtained.

  

 

  Figure 6 Simulation model

  The dynamic performance of the system step response obtained after simulation is still relatively ideal, with small overshoot (peak response value is 1.017, overshoot Q%=1.7%). The system response error is also relatively small (steady-state error is 0.005), which is within the accuracy range required by the system.

  5. Summary

  The system adopts modular design and has strong expansibility. The modular design makes the controller universal and safe and reliable. It has low cost, simple operation, small size, easy installation, sensitive response and high control accuracy.

Keywords:AT89S51 Reference address:Design of PID Temperature Control System Based on AT89S51 Single Chip Microcomputer

Previous article:Software Design of Pulse/Data Generator Based on Embedded WinCE 6.0
Next article:Open FPGA increases test flexibility

Recommended ReadingLatest update time:2024-11-15 15:49

Design of Punch Press Controller Using AT89S51 Single Chip Microcomputer
    This paper introduces a method of simulating PLC control with Atmel89S51 single-chip microcomputer, designs a controller suitable for rigid clutch punch press, introduces the basic structure and working principle of input and output circuits with photoelectric isolation, focuses on the design idea of ​​the interna
[Microcontroller]
Design of AT89S51 microcontroller to expand external interrupt source system
AT89S51 provides users with two external interrupt request input terminals INT0 (inverse) and INT1 (inverse). In actual application systems, the two external interrupt request sources are often not enough, and the external interrupt source needs to be expanded. The following introduces a method to expand external inte
[Microcontroller]
Design of AT89S51 microcontroller to expand external interrupt source system
AT89S51 Timer/Counter Structure
  The timer/counter structure of the AT89S51 microcontroller is shown in the figure below. Timer/counter T0 is composed of special function registers TH0 and TL0, and timer/counter Tl is composed of special function registers TH1 and TL1.      Both timers/counters have two working modes: timer and counter, and four wo
[Microcontroller]
AT89S51 Timer/Counter Structure
Design instructions for implementing digital frequency counter using microcontroller
1. Experimental tasks The timing counter function of T0 and T1 of the AT89S51 microcontroller is used to complete the frequency counting of the input signal. The frequency result of the counting is displayed through the 8-bit dynamic digital tube. It is required to accurately count the signal frequency of 0-250KHZ, an
[Microcontroller]
Design instructions for implementing digital frequency counter using microcontroller
at89s51 watchdog demonstration program
at89s51 watchdog demonstration program #include reg51.h   #include intrins.h   sfr AUXR = 0x8E; //define AT89S51 extended register sfr WDTRST = 0xA6;  void clr_wdt();  main()  {      AUXR = 0xff; // Initialize watchdog related registers      while(1) // Main loop      {  clr_wdt(); // This routine must be called at le
[Microcontroller]
Circuit diagram of horse meter design
  Function:   1. At the beginning, "00" is displayed, and timing starts after the first press of SP1.   2. When SP1 is pressed for the second time, the timing stops.   3. After pressing SP1 for the third time, the timing will be reset to zero.   Schematic diagram wiring:         1. Use an 8-core cable to connect
[Microcontroller]
Circuit diagram of horse meter design
Design of AT89S51 microcontroller electronic doorbell
1. Experimental tasks When the switch SP1 is pressed, the AT89S51 microcontroller generates a "ding-dong" sound and outputs it from the P1.0 port to the LM386, which is amplified and sent to the speaker. 2. Circuit schematic Figure 4.19.1 3. Hardware wiring on the system board (1). Connect the P1.0 port in the "MC
[Microcontroller]
Design of AT89S51 microcontroller electronic doorbell
Latest Power Management Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号