├── .vs └── PID_Auto_C │ └── v14 │ └── .suo ├── PID_Auto_C.sln ├── PID_Auto_C ├── PID_Auto_C.vcxproj ├── PID_Auto_C.vcxproj.filters ├── PID_Auto_C.vcxproj.user ├── include │ ├── PIDRun.h │ ├── PIDTemp.h │ ├── PID_Auto.h │ └── PID_Nor.h └── src │ ├── PIDRun.c │ ├── PIDTemp.c │ ├── PID_Auto.c │ ├── PID_Nor.c │ ├── ReadME.txt │ └── main.c ├── PID_Auto_C_Chinese ├── PID_Auto_C_Chinese.vcxproj ├── PID_Auto_C_Chinese.vcxproj.filters ├── PID_Auto_C_Chinese.vcxproj.user ├── include │ ├── PIDRun.h │ ├── PIDTemp.h │ ├── PID_Auto.h │ └── PID_Nor.h └── src │ ├── PIDRun.c │ ├── PIDTemp.c │ ├── PID_Auto.c │ ├── PID_Nor.c │ ├── ReadME.txt │ ├── example.cpp │ ├── example_sample.cpp │ └── main.c ├── PID_V1.0.1 ├── PID-Auto_Library │ └── PID_AutoTune_v0 │ │ ├── Examples │ │ └── AutoTune_Example │ │ │ └── AutoTune_Example.cpp │ │ ├── PID_AutoTune_v0.cpp │ │ └── PID_AutoTune_v0.h └── PID-Library │ ├── PID_v1.cpp │ ├── PID_v1.h │ └── examples │ ├── PID_AdaptiveTunings │ └── PID_AdaptiveTunings.cpp │ ├── PID_Basic │ └── PID_Basic.cpp │ ├── PID_PonM │ └── PID_PonM.cpp │ └── PID_RelayOutput │ └── PID_RelayOutput.cpp ├── README.md └── 工业级PID控制器设计思路——蒋庭佳.pdf /.vs/PID_Auto_C/v14/.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JiangTingjia/PID_Library_Auto_C/9d4e4336951cc0b20a7491e6d08e5dcc96758a9b/.vs/PID_Auto_C/v14/.suo -------------------------------------------------------------------------------- /PID_Auto_C.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.25420.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PID_Auto_C", "PID_Auto_C\PID_Auto_C.vcxproj", "{D4848ACA-7137-4FEB-8DAE-BD77EC706C6A}" 7 | EndProject 8 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PID_Auto_C_Chinese", "PID_Auto_C_Chinese\PID_Auto_C_Chinese.vcxproj", "{5D3C6B8C-DB91-4F55-8DF0-C33AB207A8FE}" 9 | EndProject 10 | Global 11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 12 | Debug|x64 = Debug|x64 13 | Debug|x86 = Debug|x86 14 | Release|x64 = Release|x64 15 | Release|x86 = Release|x86 16 | EndGlobalSection 17 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 18 | {D4848ACA-7137-4FEB-8DAE-BD77EC706C6A}.Debug|x64.ActiveCfg = Debug|x64 19 | {D4848ACA-7137-4FEB-8DAE-BD77EC706C6A}.Debug|x64.Build.0 = Debug|x64 20 | {D4848ACA-7137-4FEB-8DAE-BD77EC706C6A}.Debug|x86.ActiveCfg = Debug|Win32 21 | {D4848ACA-7137-4FEB-8DAE-BD77EC706C6A}.Debug|x86.Build.0 = Debug|Win32 22 | {D4848ACA-7137-4FEB-8DAE-BD77EC706C6A}.Release|x64.ActiveCfg = Release|x64 23 | {D4848ACA-7137-4FEB-8DAE-BD77EC706C6A}.Release|x64.Build.0 = Release|x64 24 | {D4848ACA-7137-4FEB-8DAE-BD77EC706C6A}.Release|x86.ActiveCfg = Release|Win32 25 | {D4848ACA-7137-4FEB-8DAE-BD77EC706C6A}.Release|x86.Build.0 = Release|Win32 26 | {5D3C6B8C-DB91-4F55-8DF0-C33AB207A8FE}.Debug|x64.ActiveCfg = Debug|x64 27 | {5D3C6B8C-DB91-4F55-8DF0-C33AB207A8FE}.Debug|x64.Build.0 = Debug|x64 28 | {5D3C6B8C-DB91-4F55-8DF0-C33AB207A8FE}.Debug|x86.ActiveCfg = Debug|Win32 29 | {5D3C6B8C-DB91-4F55-8DF0-C33AB207A8FE}.Debug|x86.Build.0 = Debug|Win32 30 | {5D3C6B8C-DB91-4F55-8DF0-C33AB207A8FE}.Release|x64.ActiveCfg = Release|x64 31 | {5D3C6B8C-DB91-4F55-8DF0-C33AB207A8FE}.Release|x64.Build.0 = Release|x64 32 | {5D3C6B8C-DB91-4F55-8DF0-C33AB207A8FE}.Release|x86.ActiveCfg = Release|Win32 33 | {5D3C6B8C-DB91-4F55-8DF0-C33AB207A8FE}.Release|x86.Build.0 = Release|Win32 34 | EndGlobalSection 35 | GlobalSection(SolutionProperties) = preSolution 36 | HideSolutionNode = FALSE 37 | EndGlobalSection 38 | EndGlobal 39 | -------------------------------------------------------------------------------- /PID_Auto_C/PID_Auto_C.vcxproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | Debug 14 | x64 15 | 16 | 17 | Release 18 | x64 19 | 20 | 21 | 22 | {D4848ACA-7137-4FEB-8DAE-BD77EC706C6A} 23 | PID_Auto_C 24 | 8.1 25 | 26 | 27 | 28 | Application 29 | true 30 | v140 31 | MultiByte 32 | 33 | 34 | Application 35 | false 36 | v140 37 | true 38 | MultiByte 39 | 40 | 41 | Application 42 | true 43 | v140 44 | MultiByte 45 | 46 | 47 | Application 48 | false 49 | v140 50 | true 51 | MultiByte 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | E:\Algorithm\PID_Auto_C\PID_Auto_C\PID_Auto_C\include;$(IncludePath) 73 | 74 | 75 | 76 | Level3 77 | Disabled 78 | true 79 | 80 | 81 | 82 | 83 | Level3 84 | Disabled 85 | true 86 | 87 | 88 | 89 | 90 | Level3 91 | MaxSpeed 92 | true 93 | true 94 | true 95 | 96 | 97 | true 98 | true 99 | 100 | 101 | 102 | 103 | Level3 104 | MaxSpeed 105 | true 106 | true 107 | true 108 | 109 | 110 | true 111 | true 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | -------------------------------------------------------------------------------- /PID_Auto_C/PID_Auto_C.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | 头文件 20 | 21 | 22 | 头文件 23 | 24 | 25 | 头文件 26 | 27 | 28 | 头文件 29 | 30 | 31 | 32 | 33 | 源文件 34 | 35 | 36 | 源文件 37 | 38 | 39 | 源文件 40 | 41 | 42 | 源文件 43 | 44 | 45 | 源文件 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /PID_Auto_C/PID_Auto_C.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | false 5 | 6 | -------------------------------------------------------------------------------- /PID_Auto_C/include/PIDRun.h: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------------------------------------- 2 | *Author:JiangTingjia(kyzy_duck@163.com) 3 | *Version:v1.0 4 | *File:PID_Run.h 5 | *Note: This file is used for PID process (Combine with PID control process and autotune process) 6 | ----------------------------------------------------------------------------------------*/ 7 | #include "PIDTemp.h" 8 | 9 | typedef struct 10 | { 11 | double dSetVal; 12 | double dCurVal; 13 | double dOutPut; 14 | }PID_PARM_THREE; 15 | 16 | // system time 17 | extern unsigned int Current_time; 18 | 19 | // Return Value for Runnning Status 20 | extern int iErrorCodeFYP; 21 | extern int iErrorCodeR1; 22 | extern int iErrorCodeR2; 23 | 24 | // instance FYP 25 | extern TEMP_PID_STRUCT sFYP; 26 | extern PID_PARM_THREE sFYP_PARM; 27 | // instance R1 28 | extern TEMP_PID_STRUCT sR1; 29 | extern PID_PARM_THREE sR1_PARM; 30 | 31 | // initial FYP 32 | void PID_Setup_FYP(void); 33 | // initial R1 34 | void PID_Setup_R1(void); 35 | 36 | // Calculate Output CV 37 | int PID_Cal(TEMP_PID_STRUCT *sTemp, double dSetVal, double dCurVal); 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /PID_Auto_C/include/PIDTemp.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JiangTingjia/PID_Library_Auto_C/9d4e4336951cc0b20a7491e6d08e5dcc96758a9b/PID_Auto_C/include/PIDTemp.h -------------------------------------------------------------------------------- /PID_Auto_C/include/PID_Auto.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JiangTingjia/PID_Library_Auto_C/9d4e4336951cc0b20a7491e6d08e5dcc96758a9b/PID_Auto_C/include/PID_Auto.h -------------------------------------------------------------------------------- /PID_Auto_C/include/PID_Nor.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JiangTingjia/PID_Library_Auto_C/9d4e4336951cc0b20a7491e6d08e5dcc96758a9b/PID_Auto_C/include/PID_Nor.h -------------------------------------------------------------------------------- /PID_Auto_C/src/PIDRun.c: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------------------------------------- 2 | *Author:JiangTingjia(kyzy_duck@163.com) 3 | *Version:v1.0 4 | *File:PID_Run.c 5 | *Note: This file is used for PID process (Combine with PID control process and autotune process) 6 | ----------------------------------------------------------------------------------------*/ 7 | #include "../include/PIDRun.h" 8 | 9 | int iErrorCodeFYP = 0; 10 | int iErrorCodeR1 = 0; 11 | 12 | unsigned int Current_time; 13 | // instance 1 14 | TEMP_PID_STRUCT sFYP = { 0 }; 15 | PID_PARM_THREE sFYP_PARM = { 0 }; 16 | double dFYP_MaxOutPut = 0.0; 17 | // instance 2 18 | TEMP_PID_STRUCT sR1 = { 0 }; 19 | PID_PARM_THREE sR1_PARM = { 0 }; 20 | double dR1_MaxOutPut = 0.0; 21 | 22 | // initial instance 1 23 | void PID_Setup_FYP(void) 24 | { 25 | PID_INIT_PARM sInitParmFYP = { 0 }; 26 | // CV limit 27 | dFYP_MaxOutPut = 255; 28 | sFYP_PARM.dCurVal = 0; 29 | sFYP_PARM.dOutPut = 0; 30 | // set SP is 2000, it can be any value for necessary 31 | sFYP_PARM.dSetVal = 2000; 32 | sInitParmFYP.dMin = 0; 33 | sInitParmFYP.dMax = dFYP_MaxOutPut; 34 | // change sample time to 150ms 35 | sInitParmFYP.iSampleTimeNor = 150; 36 | sInitParmFYP.iDirection = DIRECT; 37 | // change KP/KI/KD 38 | sInitParmFYP.KP = 0.05 * sInitParmFYP.dMax; 39 | sInitParmFYP.KI = 0.01; 40 | sInitParmFYP.KD = 0; 41 | sInitParmFYP.iMode = AUTOMATIC; 42 | sInitParmFYP.aTuneLookBack = 5; 43 | sInitParmFYP.aTuneNoise = 5; 44 | sInitParmFYP.aTuneStartValue = 0; 45 | sInitParmFYP.aTuneStep = 0; 46 | sInitParmFYP.iType = 1; 47 | // 3 mimus then begin auto process 48 | sInitParmFYP.iSinTimes = 180000; 49 | sInitParmFYP.iOKTimes = 120000; 50 | setupPID(&sFYP, &(sFYP_PARM.dCurVal), &(sFYP_PARM.dSetVal), &(sFYP_PARM.dOutPut), &Current_time); 51 | setupParm(&sFYP, sInitParmFYP); 52 | } 53 | 54 | // initial instance 1 55 | void PID_Setup_R1(void) 56 | { 57 | PID_INIT_PARM sInitParmR1 = { 0 }; 58 | dR1_MaxOutPut = 255; 59 | sR1_PARM.dCurVal = 0; 60 | sR1_PARM.dOutPut = 0; 61 | sR1_PARM.dSetVal = 2000; 62 | sInitParmR1.dMin = 0; 63 | sInitParmR1.dMax = dR1_MaxOutPut; 64 | sInitParmR1.iSampleTimeNor = 50; 65 | sInitParmR1.iDirection = DIRECT; 66 | sInitParmR1.KP = 0.05 * sInitParmR1.dMax; 67 | sInitParmR1.KI = 0; 68 | sInitParmR1.KD = 0; 69 | sInitParmR1.iMode = AUTOMATIC; 70 | sInitParmR1.aTuneLookBack = 3; 71 | sInitParmR1.aTuneNoise = 50; 72 | sInitParmR1.aTuneStartValue = 0; 73 | sInitParmR1.aTuneStep = 0; 74 | sInitParmR1.iType = 0; 75 | sInitParmR1.iSinTimes = 30000; 76 | sInitParmR1.iOKTimes = 1000; 77 | setupPID(&sR1, &(sR1_PARM.dCurVal), &(sR1_PARM.dSetVal), &(sR1_PARM.dOutPut), &Current_time); 78 | setupParm(&sR1, sInitParmR1); 79 | } 80 | 81 | 82 | int PID_Cal(TEMP_PID_STRUCT *sTemp, double dSetVal, double dCurVal) 83 | { 84 | int iErrorCode = 0; 85 | *(sTemp->inputRun) = dCurVal; 86 | *(sTemp->setpointRun) = dSetVal; 87 | iErrorCode = PID_Operation(sTemp); 88 | return iErrorCode; 89 | } 90 | 91 | 92 | //*********************END*********************// 93 | -------------------------------------------------------------------------------- /PID_Auto_C/src/PIDTemp.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JiangTingjia/PID_Library_Auto_C/9d4e4336951cc0b20a7491e6d08e5dcc96758a9b/PID_Auto_C/src/PIDTemp.c -------------------------------------------------------------------------------- /PID_Auto_C/src/PID_Auto.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JiangTingjia/PID_Library_Auto_C/9d4e4336951cc0b20a7491e6d08e5dcc96758a9b/PID_Auto_C/src/PID_Auto.c -------------------------------------------------------------------------------- /PID_Auto_C/src/PID_Nor.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JiangTingjia/PID_Library_Auto_C/9d4e4336951cc0b20a7491e6d08e5dcc96758a9b/PID_Auto_C/src/PID_Nor.c -------------------------------------------------------------------------------- /PID_Auto_C/src/ReadME.txt: -------------------------------------------------------------------------------- 1 | This library is used in PID autotuner(REALAY METHODS) 2 | PID_NOR: PID Control Process 3 | PID_AUTO: Auto Tuner Process 4 | /*******flower file is delete(some special reasons)***********/ 5 | PID_TEMP: A Process Combine with PID and Autotuner 6 | PID_Run: Some Initial Parmeter Setting 7 | MAIN: A Example for user 8 | //******** Send An email to me for all files above************// 9 | 10 | Author£:JiangTingjia(kyzy_duck@163.com) 11 | -------------------------------------------------------------------------------- /PID_Auto_C/src/main.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JiangTingjia/PID_Library_Auto_C/9d4e4336951cc0b20a7491e6d08e5dcc96758a9b/PID_Auto_C/src/main.c -------------------------------------------------------------------------------- /PID_Auto_C_Chinese/PID_Auto_C_Chinese.vcxproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | Debug 14 | x64 15 | 16 | 17 | Release 18 | x64 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | {5D3C6B8C-DB91-4F55-8DF0-C33AB207A8FE} 36 | PID_Auto_C_Chinese 37 | 8.1 38 | 39 | 40 | 41 | Application 42 | true 43 | v140 44 | MultiByte 45 | 46 | 47 | Application 48 | false 49 | v140 50 | true 51 | MultiByte 52 | 53 | 54 | Application 55 | true 56 | v140 57 | MultiByte 58 | 59 | 60 | Application 61 | false 62 | v140 63 | true 64 | MultiByte 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | E:\Algorithm\PID_Auto_C\PID_Auto_C\PID_Auto_C_Chinese\include;$(IncludePath) 86 | 87 | 88 | 89 | Level3 90 | Disabled 91 | true 92 | 93 | 94 | 95 | 96 | Level3 97 | Disabled 98 | true 99 | 100 | 101 | 102 | 103 | Level3 104 | MaxSpeed 105 | true 106 | true 107 | true 108 | 109 | 110 | true 111 | true 112 | 113 | 114 | 115 | 116 | Level3 117 | MaxSpeed 118 | true 119 | true 120 | true 121 | 122 | 123 | true 124 | true 125 | 126 | 127 | 128 | 129 | 130 | -------------------------------------------------------------------------------- /PID_Auto_C_Chinese/PID_Auto_C_Chinese.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | 源文件 20 | 21 | 22 | 源文件 23 | 24 | 25 | 源文件 26 | 27 | 28 | 源文件 29 | 30 | 31 | 源文件 32 | 33 | 34 | 35 | 36 | 头文件 37 | 38 | 39 | 头文件 40 | 41 | 42 | 头文件 43 | 44 | 45 | 头文件 46 | 47 | 48 | -------------------------------------------------------------------------------- /PID_Auto_C_Chinese/PID_Auto_C_Chinese.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | false 5 | 6 | -------------------------------------------------------------------------------- /PID_Auto_C_Chinese/include/PIDRun.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JiangTingjia/PID_Library_Auto_C/9d4e4336951cc0b20a7491e6d08e5dcc96758a9b/PID_Auto_C_Chinese/include/PIDRun.h -------------------------------------------------------------------------------- /PID_Auto_C_Chinese/include/PIDTemp.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JiangTingjia/PID_Library_Auto_C/9d4e4336951cc0b20a7491e6d08e5dcc96758a9b/PID_Auto_C_Chinese/include/PIDTemp.h -------------------------------------------------------------------------------- /PID_Auto_C_Chinese/include/PID_Auto.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JiangTingjia/PID_Library_Auto_C/9d4e4336951cc0b20a7491e6d08e5dcc96758a9b/PID_Auto_C_Chinese/include/PID_Auto.h -------------------------------------------------------------------------------- /PID_Auto_C_Chinese/include/PID_Nor.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JiangTingjia/PID_Library_Auto_C/9d4e4336951cc0b20a7491e6d08e5dcc96758a9b/PID_Auto_C_Chinese/include/PID_Nor.h -------------------------------------------------------------------------------- /PID_Auto_C_Chinese/src/PIDRun.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JiangTingjia/PID_Library_Auto_C/9d4e4336951cc0b20a7491e6d08e5dcc96758a9b/PID_Auto_C_Chinese/src/PIDRun.c -------------------------------------------------------------------------------- /PID_Auto_C_Chinese/src/PIDTemp.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JiangTingjia/PID_Library_Auto_C/9d4e4336951cc0b20a7491e6d08e5dcc96758a9b/PID_Auto_C_Chinese/src/PIDTemp.c -------------------------------------------------------------------------------- /PID_Auto_C_Chinese/src/PID_Auto.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JiangTingjia/PID_Library_Auto_C/9d4e4336951cc0b20a7491e6d08e5dcc96758a9b/PID_Auto_C_Chinese/src/PID_Auto.c -------------------------------------------------------------------------------- /PID_Auto_C_Chinese/src/PID_Nor.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JiangTingjia/PID_Library_Auto_C/9d4e4336951cc0b20a7491e6d08e5dcc96758a9b/PID_Auto_C_Chinese/src/PID_Nor.c -------------------------------------------------------------------------------- /PID_Auto_C_Chinese/src/ReadME.txt: -------------------------------------------------------------------------------- 1 | 此库按照Realy模式,完成PID自动调谐。 2 | PID_NOR(不需要做任何改动) 是PID控制的控制文件 3 | PID_AUTO(不需要做任何改动) 是自动调谐的控制文件 4 | //********以下文件由于特殊原因被删除了********// 5 | PID_TEMP(不需要做任何改动) 是结合Realy模式,完成从PID控制到自动调参到稳定的过程设计 6 | PID_Run 包含了初始化控制器过程,可根据需要改变必要的控制参数 7 | MAIN 是一个如何调用此库的实例,按照main.c描述的过程即可完成PID控制 8 | //****************如果有需要请邮件于我************// 9 | 作者:JiangTingjia(kyzy_duck@163.com) 10 | -------------------------------------------------------------------------------- /PID_Auto_C_Chinese/src/example.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JiangTingjia/PID_Library_Auto_C/9d4e4336951cc0b20a7491e6d08e5dcc96758a9b/PID_Auto_C_Chinese/src/example.cpp -------------------------------------------------------------------------------- /PID_Auto_C_Chinese/src/example_sample.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JiangTingjia/PID_Library_Auto_C/9d4e4336951cc0b20a7491e6d08e5dcc96758a9b/PID_Auto_C_Chinese/src/example_sample.cpp -------------------------------------------------------------------------------- /PID_Auto_C_Chinese/src/main.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JiangTingjia/PID_Library_Auto_C/9d4e4336951cc0b20a7491e6d08e5dcc96758a9b/PID_Auto_C_Chinese/src/main.c -------------------------------------------------------------------------------- /PID_V1.0.1/PID-Auto_Library/PID_AutoTune_v0/Examples/AutoTune_Example/AutoTune_Example.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JiangTingjia/PID_Library_Auto_C/9d4e4336951cc0b20a7491e6d08e5dcc96758a9b/PID_V1.0.1/PID-Auto_Library/PID_AutoTune_v0/Examples/AutoTune_Example/AutoTune_Example.cpp -------------------------------------------------------------------------------- /PID_V1.0.1/PID-Auto_Library/PID_AutoTune_v0/PID_AutoTune_v0.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JiangTingjia/PID_Library_Auto_C/9d4e4336951cc0b20a7491e6d08e5dcc96758a9b/PID_V1.0.1/PID-Auto_Library/PID_AutoTune_v0/PID_AutoTune_v0.cpp -------------------------------------------------------------------------------- /PID_V1.0.1/PID-Auto_Library/PID_AutoTune_v0/PID_AutoTune_v0.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JiangTingjia/PID_Library_Auto_C/9d4e4336951cc0b20a7491e6d08e5dcc96758a9b/PID_V1.0.1/PID-Auto_Library/PID_AutoTune_v0/PID_AutoTune_v0.h -------------------------------------------------------------------------------- /PID_V1.0.1/PID-Library/PID_v1.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JiangTingjia/PID_Library_Auto_C/9d4e4336951cc0b20a7491e6d08e5dcc96758a9b/PID_V1.0.1/PID-Library/PID_v1.cpp -------------------------------------------------------------------------------- /PID_V1.0.1/PID-Library/PID_v1.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JiangTingjia/PID_Library_Auto_C/9d4e4336951cc0b20a7491e6d08e5dcc96758a9b/PID_V1.0.1/PID-Library/PID_v1.h -------------------------------------------------------------------------------- /PID_V1.0.1/PID-Library/examples/PID_AdaptiveTunings/PID_AdaptiveTunings.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JiangTingjia/PID_Library_Auto_C/9d4e4336951cc0b20a7491e6d08e5dcc96758a9b/PID_V1.0.1/PID-Library/examples/PID_AdaptiveTunings/PID_AdaptiveTunings.cpp -------------------------------------------------------------------------------- /PID_V1.0.1/PID-Library/examples/PID_Basic/PID_Basic.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JiangTingjia/PID_Library_Auto_C/9d4e4336951cc0b20a7491e6d08e5dcc96758a9b/PID_V1.0.1/PID-Library/examples/PID_Basic/PID_Basic.cpp -------------------------------------------------------------------------------- /PID_V1.0.1/PID-Library/examples/PID_PonM/PID_PonM.cpp: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /PID_V1.0.1/PID-Library/examples/PID_RelayOutput/PID_RelayOutput.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JiangTingjia/PID_Library_Auto_C/9d4e4336951cc0b20a7491e6d08e5dcc96758a9b/PID_V1.0.1/PID-Library/examples/PID_RelayOutput/PID_RelayOutput.cpp -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | /********************************************************************************************** 2 | * PID_Library_Auto_C - Version 0.0.0 3 | * by JiangTingjia 4 | * 如果使用KEIL编写STM32,请将PID_V1.0.1目录复制至KEIL工程下,右键项目,选择OPTION中C/C++选项卡,在include path中添加头文件目录,并在Misc control中增加 --cpp11 5 | * 1. PID Control 6 | * 2. Relay Method Autotuning 7 | * 8 | * Reference: Arduino PID Library by Brett Beauregard contact: br3ttb@gmail.com 9 | * (http://playground.arduino.cc/Code/PIDLibrary) 10 | * Copyright (c) 2017 11 | * 12 | * This Library is licensed under the BSD License: 13 | * Redistribution and use in source and binary forms, with or without 14 | * modification, are permitted provided that the following conditions are 15 | * met: 16 | * 17 | * * Redistributions of source code must retain the above copyright 18 | * notice, this list of conditions and the following disclaimer. 19 | * * Redistributions in binary form must reproduce the above copyright 20 | * notice, this list of conditions and the following disclaimer in 21 | * the documentation and/or other materials provided with the distribution 22 | * 23 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 24 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 25 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 26 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 27 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 28 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 29 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 30 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 31 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 32 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 33 | * POSSIBILITY OF SUCH DAMAGE. 34 | **********************************************************************************************/ 35 | -------------------------------------------------------------------------------- /工业级PID控制器设计思路——蒋庭佳.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JiangTingjia/PID_Library_Auto_C/9d4e4336951cc0b20a7491e6d08e5dcc96758a9b/工业级PID控制器设计思路——蒋庭佳.pdf --------------------------------------------------------------------------------