einride
pid-go
Go

PID controllers for Go.

Last updated May 18, 2026
100
Stars
6
Forks
1
Issues
0
Stars/day
Attention Score
37
Language breakdown
No language data available.
Files click to expand
README

PID Go

PkgGoDev GoReportCard Codecov

logo

PID controllers for Go.

Examples

pid.Controller

A basic PID controller.

import (
	"fmt"
	"time"

"go.einride.tech/pid" )

func ExampleController() { // Create a PID controller. c := pid.Controller{ Config: pid.ControllerConfig{ ProportionalGain: 2.0, IntegralGain: 1.0, DerivativeGain: 1.0, }, } // Update the PID controller. c.Update(pid.ControllerInput{ ReferenceSignal: 10, ActualSignal: 0, SamplingInterval: 100 * time.Millisecond, }) fmt.Printf("%+v\n", c.State) // Reset the PID controller. c.Reset() fmt.Printf("%+v\n", c.State) // Output: // {ControlError:10 ControlErrorIntegral:1 ControlErrorDerivative:100 ControlSignal:121} // {ControlError:0 ControlErrorIntegral:0 ControlErrorDerivative:0 ControlSignal:0} }

\Reference ≫\

pid.AntiWindupController

A PID-controller with low-pass filtering of the derivative term, feed forward term, a saturated control output and anti-windup.

Reference ≫

pid.TrackingController

a PID-controller with low-pass filtering of the derivative term, feed forward term, anti-windup and bumpless transfer using tracking mode control.

Reference ≫

🔗 More in this category

© 2026 GitRepoTrend · einride/pid-go · Updated daily from GitHub