Skip to main content

This library contains three controller algorithms.

Project description

The smartPID Library

1. Background

This 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 author

This library is compiled by Qi Zhu from the People's Republic of China.

3. Environment

This library is written in Python 3.7.

4. Dependent Libraries

This library needs to use the time library, so before using this library, you need to make sure that your environment already contains the time library.

5. How to use the library

The first step is to download the library.

pip install smartPID

Then load the library where you need it.

import smartPID

5.1 Position PID Controller

When you need to call the position PID controller, you can refer to the following code.The variable input_signal here 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 Controller

When you need to call the incremental PID controller, you can refer to the following code.The variable input_signal here 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 Controller

When you need to call the single neural PID controller, you can refer to the following code.The variable input_signal here 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 library

The default parameters of the position PID controller are as follows:

P=0.2

I=0.0

D=0.0

sampletime=0.01

The default parameters of the incremental PID controller are as follows:

P=0.2

I=0.0

D=0.0

sampletime=0.01

The default parameters of the single neural PID controller are as follows:

the whole single neural PID learning rate is 0.03

the P link learning rate is 0.1

the I link learning rate is 0.1

the D link learning rate is 0.1

the initial value of the P link is 0.1

the initial value of the I link is 0.1

the initial value of the D link is 0.1

sampletime=0.01

Project details


Release history Release notifications | RSS feed

This version

1.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

smartPID-1.0.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

smartPID-1.0-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file smartPID-1.0.tar.gz.

File metadata

  • Download URL: smartPID-1.0.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.6.1 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5

File hashes

Hashes for smartPID-1.0.tar.gz
Algorithm Hash digest
SHA256 6c5231f2cb5819d567311fc466e73ff8afce824598febf03667404b1da4880d6
MD5 d2db834bb0a52e4f9c0071e31004b9b4
BLAKE2b-256 af93aff81c44f1f0d0715e48e2fac585e2ddb4afcd751c6365b948b0cf673e62

See more details on using hashes here.

File details

Details for the file smartPID-1.0-py3-none-any.whl.

File metadata

  • Download URL: smartPID-1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.6.1 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5

File hashes

Hashes for smartPID-1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a50433f536ae0d6f5d1c1468055f4e97770ae39fbd1e23894526527863802cea
MD5 de101572fd14f314caf244ff855f2553
BLAKE2b-256 d50d8c40047d5fabec14e6529dc5376c64f3eff0af21b02b33dd824684fb3df8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page