Study Notes
for
redesigned
2012-09-14
versions:12_09_01
(1) Collection and processing of sensor signals
(2) PWM output of heating wire
(3) Heating temperature and speed control
(4) Temperature control system operation process control: program initialization, temperature control start and end, LCD display module control
(5) Temperature control information display and parameter setting: status display, control algorithm parameter setting, etc.
Among the functions above, except for the initialization of the program which is executed in the main function, all other parts are executed in the interrupt function, among which keyboard detection and data input are executed in the keyboard interrupt, and other data collection, processing, control, etc. are all executed in the timer 5ms interrupt. The microcontroller is usually in low power mode to reduce power consumption.
The flowchart of the program is as follows:
This paper mainly uses two algorithms to achieve the requirements of the topic:
The first is the improvement of PID algorithm. Since temperature control can only heat but not cool, we only use PI. First, use P to increase the temperature to a temperature close to the set temperature, and then use I to approach the set temperature.
The procedure is as follows:
void
{
e1=set_t-now_t;
uk=kp*e1+ki*e2+kd*e3;
//
e2=e1+e2;
e3=e1-e4;
e4=e1;
if(uk>speed)
uk=speed;
if(uk<0)
uk=0;
control_value=1-uk;
}
The second is a time-controlled linear algorithm
In time control, the temperature is required to be evenly heated from 40° to 60°, and the time can be set arbitrarily.
The method of this program is: set the time set_time in seconds, and divide the 20° temperature difference from 40° to 60° into set_time parts. Then, in the control cycle, let the time period time_m increase by 1 in each cycle, and then calculate the temperature that should be reached in this time period according to the average formula, the formula is as follows:
Because the control time input set_time is in seconds, and the control period is 100ms, the above needs to be divided by 10.
The specific implementation code is as follows:
control_m_value=(float)time_m/set_time;
control_m_value=control_m_value/10;
control_m_value=40+20*control_m_value;
set_t=control_m_value;
pid();
CCR1=control_value*12000;
Previous article:Temperature control system based on msp430
Next article:My matrix keyboard usage notes - based on msp430g2553
Recommended ReadingLatest update time:2024-11-24 20:37
- Popular Resources
- Popular amplifiers
- Naxin Micro and Xinxian jointly launched the NS800RT series of real-time control MCUs
- How to learn embedded systems based on ARM platform
- Summary of jffs2_scan_eraseblock issues
- Application of SPCOMM Control in Serial Communication of Delphi7.0
- Using TComm component to realize serial communication in Delphi environment
- Bar chart code for embedded development practices
- Embedded Development Learning (10)
- Embedded Development Learning (8)
- Embedded Development Learning (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Intel promotes AI with multi-dimensional efforts in technology, application, and ecology
- ChinaJoy Qualcomm Snapdragon Theme Pavilion takes you to experience the new changes in digital entertainment in the 5G era
- Infineon's latest generation IGBT technology platform enables precise control of speed and position
- Two test methods for LED lighting life
- Don't Let Lightning Induced Surges Scare You
- Application of brushless motor controller ML4425/4426
- Easy identification of LED power supply quality
- World's first integrated photovoltaic solar system completed in Israel
- Sliding window mean filter for avr microcontroller AD conversion
- What does call mean in the detailed explanation of ABB robot programming instructions?
- CATL releases October battle report
- Battery industry in October 2024: growth momentum remains unabated!
- Mercedes-Benz will launch the eCitaro equipped with NMC4 batteries to provide high energy density and long life
- Many companies have announced progress on solid-state batteries. When will solid-state batteries go into mass production?
- Xsens Sirius Series Inertial Sensors Enable 3D Inertial Navigation in Harsh Environments
- Infineon's Automotive Landscape: From Hardware to Systems
- STMicroelectronics discloses its 2027-2028 financial model and path to achieve its 2030 goals
- 2024 China Automotive Charging and Battery Swapping Ecosystem Conference held in Taiyuan
- State-owned enterprises team up to invest in solid-state battery giant
- The evolution of electronic and electrical architecture is accelerating
- Did you know? EEWorld's "Device Search" applet has released a new feature~
- Development Trend of Automobile Production Automation System
- India's analog circuit market to grow 35% this year to $300 million
- Passive RFID tag structure and principle
- STM32F767 PWM wave problem
- CC2640R2F main application scenarios and solutions
- GPIO module of C6000 series DSP
- 【NUCLEO-L552ZE Review】+ Based on FREERTOS transplantation
- DM642 hard interrupt delay problem
- Zilog Z8 Encore! XP adds 12KB flash memory