Skip to main content

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

Metadata

Release files for smartPID 1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for smartPID 1.0
File Size Uploaded Provenance Actions
smartPID-1.0.tar.gz 3.5 kB Without provenance Details for smartPID-1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for smartPID 1.0
File Interpreter ABI Platform Actions
smartPID-1.0-py3-none-any.whl Python 3 none any Details for smartPID-1.0-py3-none-any.whl

Total release size: 7.7 kB

Release files / smartPID-1.0.tar.gz

Download URL smartPID-1.0.tar.gz
Size 3.5 kB
Tags Source
SHA-256 checksum
How to use checksums
6c5231f2cb5819d567311fc466e73ff8afce824598febf03667404b1da4880d6
BLAKE2b-256 checksum
How to use checksums
af93aff81c44f1f0d0715e48e2fac585e2ddb4afcd751c6365b948b0cf673e62
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / smartPID-1.0-py3-none-any.whl

Download URL smartPID-1.0-py3-none-any.whl
Size 4.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a50433f536ae0d6f5d1c1468055f4e97770ae39fbd1e23894526527863802cea
BLAKE2b-256 checksum
How to use checksums
d50d8c40047d5fabec14e6529dc5376c64f3eff0af21b02b33dd824684fb3df8
Upload date
Uploaded using Trusted Publishing?
What is 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

Security for smartPID 1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page