Package: smartPID
The smartPID Library1. BackgroundThis library contains three kinds of PID controller algorithms, which are position PID controller, incremental PID controller and single neural PID controller. According to different scenarios, different types of controller algorithms can be called after loading the library.2. About the authorThis library is compiled by Qi Zhu from the People's Republic of China.3. EnvironmentThis library is written in Python 3.7.4. Dependent LibrariesThis library needs to use thetimelibrary, so before using this library, you need to make sure that your environment already contains thetimelibrary.5. How to use the libraryThe first step is to download the library.pipinstallsmartPIDThen load the library where you need it.importsmartPID5.1 Position PID ControllerWhen you need to call the position PID controller, you can refer to the following code.The variableinput_signalhere refers to the feedback value of the measurement.smartPID.position(input_signal)You can use the following methods to set the PID parameters of the controller. (When we assume P = 0.2, I=0.5, D=0.1)smartPID.set_PID(0.2,0.5,0.1)You can use the following methods to set the setpoint of the PID controller. (When we assume setpoint = 5)smartPID.set_set_point(5)You can use the following methods to set the sampletime of the PID controller. (When we assume sampletime = 0.01)smartPID.set_sampletime(0.01)You can use the following methods to display the parameter of the PID controller.smartPID.display_PIDvalue()5.2 Incremental PID ControllerWhen you need to call the incremental PID controller, you can refer to the following code.The variableinput_signalhere refers to the feedback value of the measurement.smartPID.incremental(input_signal)You can use the following methods to set the PID parameters of the controller. (When we assume P = 0.2, I=0.5, D=0.1)smartPID.set_PID(0.2,0.5,0.1)You can use the following methods to set the setpoint of the PID controller. (When we assume setpoint = 5)smartPID.set_set_point(5)You can use the following methods to set the sampletime of the PID controller. (When we assume sampletime = 0.01)smartPID.set_sampletime(0.01)You can use the following methods to display the parameter of the PID controller.smartPID.display_PIDvalue()5.3 Single Neural PID ControllerWhen you need to call the single neural PID controller, you can refer to the following code.The variableinput_signalhere refers to the feedback value of the measurement.smartPID.SNPID(input_signal)You can use the following methods to set the learning rate of the whole single neural PID controller and each link. (When we assume the whole single neural PID learning rate is 0.03, the P link learning rate is 0.4,  the I link learning rate is 0.2, the D link learning rate is 0.1)smartPID.set_SNPID_LR(0.03,0.4,0.2,0.1)You can use the following methods to set the initial values of the P link, I link and D link. (When we assume the initial value of the P link is 1.5, the initial value of the I link is 0.3, the initial value of the D link is 0.1)smartPID.set_SNPID_IW(1.5,0.3,0.1)You can use the following methods to set the setpoint of the single neural PID controller. (When we assume setpoint = 5)smartPID.set_set_point(5)You can use the following methods to set the sampletime of the single neural PID controller. (When we assume sampletime = 0.01)smartPID.set_sampletime(0.01)You can use the following methods to display the parameter of the single neural PID controller.smartPID.display_SNPIDvalue()5.4 Default parameters for the libraryThe default parameters of the position PID controller are as follows:P=0.2I=0.0D=0.0sampletime=0.01The default parameters of the incremental PID controller are as follows:P=0.2I=0.0D=0.0sampletime=0.01The default parameters of the single neural PID controller are as follows:thewholesingleneuralPIDlearningrateis0.03thePlinklearningrateis0.1theIlinklearningrateis0.1theDlinklearningrateis0.1theinitialvalueofthePlinkis0.1theinitialvalueoftheIlinkis0.1theinitialvalueoftheDlinkis0.1sampletime=0.01