PidSharp 1.0.0.1

dotnet add package PidSharp --version 1.0.0.1                
NuGet\Install-Package PidSharp -Version 1.0.0.1                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="PidSharp" Version="1.0.0.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add PidSharp --version 1.0.0.1                
#r "nuget: PidSharp, 1.0.0.1"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install PidSharp as a Cake Addin
#addin nuget:?package=PidSharp&version=1.0.0.1

// Install PidSharp as a Cake Tool
#tool nuget:?package=PidSharp&version=1.0.0.1                

PidSharp

A pid controller written in CSharp and runs on dotnet 5.
PID控制器的C#实现,基于.net5运行环境

Codacy Badge

What is this? 是什么?

PID算法是工业上常用的一种算法。理想情况下,调教完成的PID控制器接收实际值、目标值,然后传出控制量,该控制量可使得实际值接近或等于目标值。
例如,你正控制一个火炉的温度,则PID算法可以接收当前温度(实际值),设定期望达到的温度(目标值),传出所需的加热功率增量(控制量)。
A PID controller takes your current value, desired value and returns the control variable you need to get to the desired value.
For example, say you are trying to maintain the temperature of an oven. PID takes in current temperature, desired temperature and returns the heating power you need to add.

WikiPedia - PID Controller

How to use? 如何使用?

首先导入这个项目或者nuget包。
First import this project or nuget pack.

示例代码:
See example code below:

PidController controller = new PidController(1,1,1,0,10); //P=1,I=1,D=1,Output between 0 and 100 输出从0到100
controller.TargetValue = 10;//Set target at 10. 设定读数目标是10
while(true){
  controller.CurrentValue = SomeSensor.Value;//Sensor read. 传感器读数.
  SomeActuator.Value += controller.ControlOutput;//Use output to control actuator. 用输出控制执行机构
}

假设PID=(1,1,1)是适合使用场景的参数,传感器读数SomeSensor.Value会在控制下逐渐接近目标值controller.TargetValue,也就是设定的10。
If PID=(1,1,1) is the proper value for the use case, SomeSensor.Value will get closer and closer to controller.TargetValue which is 10.

Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net5.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on PidSharp:

Repository Stars
project-sbc/Handheld-Control-Panel
Version Downloads Last updated
1.0.0.1 625 7/8/2021

Pid Controller written in CSharp and runs on dotnet 5.