
Lightweight, extensible PID controller offering customizable kp/ki/kd, time-based integration/derivative, anti-windup, output limits and auto-mode — easy to embed in control loops with deterministic math.
A lightweight and extensible PID controller library written in Kotlin Multiplatform (KMP) — designed to bring precise control algorithms to Android, iOS, and desktop systems with minimal effort.
This project is a refactored and extended version of the original Simple PID Controller by Mark Lundberg.
While the core logic was inspired by Lundberg’s work, this implementation was rebuilt from scratch in Kotlin, focusing on cross-platform performance, type safety, and developer experience.
kp, ki, kd).Available on Maven Central:
<dependency>
<groupId>io.github.murilo-migliati</groupId>
<artifactId>controllerPidKmp</artifactId>
<version>1.0.1</version>
</dependency>implementation "io.github.murilo-migliati:controllerPidKmp:1.0.1"implementation("io.github.murilo-migliati:controllerPidKmp:1.0.1")✅ Note: Always check the latest version on Maven Central.
// The correct import (based on your 'namespace')
import com.murilomigliati.pid.PIDController
fun main() {
val pid = PIDController(
kp = 1.2,
ki = 0.8,
kd = 0.4,
setpoint = 100.0
)
var humidity = 80.0
// Simulates a control loop
repeat(5) {
val output = pid.call(humidity)
println("PID output: $output")
// Simulates humidity changing based on the output
if (output != null) {
humidity += output / 10.0
}
}
}This project is licensed under the MIT License.
It includes conceptual work derived from Mark Lundberg’s Simple PID Controller.
MIT License
Copyright (c) 2025 Murilo Migliati
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files ...
| Platform | Status | Notes |
|---|---|---|
| Android | ✅ | Fully supported |
| JVM | ✅ | Compatible with any JVM project |
| iOS | ✅ | Build with KMM native targets |
| macOS / Linux | ✅ | Via Kotlin/Native |
This library focuses on:
Double.Original idea by Mark Lundberg — Simple PID Controller
Refactored and modernized for Kotlin Multiplatform by Murilo Migliati
Contributions are welcome!
Feel free to open issues or submit pull requests to improve performance, portability, or API clarity.
A lightweight and extensible PID controller library written in Kotlin Multiplatform (KMP) — designed to bring precise control algorithms to Android, iOS, and desktop systems with minimal effort.
This project is a refactored and extended version of the original Simple PID Controller by Mark Lundberg.
While the core logic was inspired by Lundberg’s work, this implementation was rebuilt from scratch in Kotlin, focusing on cross-platform performance, type safety, and developer experience.
kp, ki, kd).Available on Maven Central:
<dependency>
<groupId>io.github.murilo-migliati</groupId>
<artifactId>controllerPidKmp</artifactId>
<version>1.0.1</version>
</dependency>implementation "io.github.murilo-migliati:controllerPidKmp:1.0.1"implementation("io.github.murilo-migliati:controllerPidKmp:1.0.1")✅ Note: Always check the latest version on Maven Central.
// The correct import (based on your 'namespace')
import com.murilomigliati.pid.PIDController
fun main() {
val pid = PIDController(
kp = 1.2,
ki = 0.8,
kd = 0.4,
setpoint = 100.0
)
var humidity = 80.0
// Simulates a control loop
repeat(5) {
val output = pid.call(humidity)
println("PID output: $output")
// Simulates humidity changing based on the output
if (output != null) {
humidity += output / 10.0
}
}
}This project is licensed under the MIT License.
It includes conceptual work derived from Mark Lundberg’s Simple PID Controller.
MIT License
Copyright (c) 2025 Murilo Migliati
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files ...
| Platform | Status | Notes |
|---|---|---|
| Android | ✅ | Fully supported |
| JVM | ✅ | Compatible with any JVM project |
| iOS | ✅ | Build with KMM native targets |
| macOS / Linux | ✅ | Via Kotlin/Native |
This library focuses on:
Double.Original idea by Mark Lundberg — Simple PID Controller
Refactored and modernized for Kotlin Multiplatform by Murilo Migliati
Contributions are welcome!
Feel free to open issues or submit pull requests to improve performance, portability, or API clarity.