The simplest microcontroller PID control algorithm program

This program is applied to the 51 MCU.

/*************Define global variables *****************/

Uchar Kp, TI, Td

Int Set_speed;

/*************PID initialization function***************/

Void PID_init(void){

Serror=0;

FError=0;

Kp=30;

TI=500;

Td=10;

}

Int PID_control(int Now_speed)

{

Int Error,Serror,result;

Error=Now_speed-Set_speed;

Serror=Serror+Error;

Result=(Kp*Error+Kp*0.05/TI*Serror+Kp*Td/0.05*(Error-FError));

FError=Error;

/ / Limit the duty cycle

If(result10)

{result=0;} else

If(result"1000)

{result=1000;}

Return result;

}

Semiconductor Module Devices

High-power electronic power devices are repotted into an integrated module according to a certain combination of functions.
A power semiconductor module is a combination of certain functions and modes, and a power semiconductor module is a high-power electronic power device that is re-potted into a whole according to a certain function combination. Power semiconductor modules can achieve different functions according to the different components in the package. Power semiconductor modules can be used as air-cooled modules with air-cooled heat dissipation, and water-cooled modules with water-cooled heat dissipation.
It is characterized by simple installation, convenient use and maintenance, small size and light weight.
Typical applications in AC/DC motor control, various rectifier power supplies, industrial heating control, dimming, non-contact switches, electric welding machines, motor soft start, reactive power compensation, frequency converters, UPS power supplies, battery charging and discharging, etc.

Semiconductor Module Devices,Power Semiconductor Device,Semiconductor Cooling Devices,Diode Module

YANGZHOU POSITIONING TECH CO., LTD. , https://www.cnpositioning.com