Coder Social home page Coder Social logo

godot-pid-controller's Introduction

godot-pid-controller

PID and PD controller classes for godot

What is a PID controller?

A PID controller is a feedback control algorithm that continuously calculates and adjusts the control output based on the error between the desired setpoint and the measured process variable. It consists of three components:

Proportional (P) term: Produces an output proportional to the current error. Integral (I) term: Integrates the error over time to eliminate steady-state errors. Derivative (D) term: Predicts the future trend of the error based on its rate of change.

How to use it in Godot?

  1. Copy pd_controller.gd and/or pid_controller.gd to your project addons/godot-pid-controller folder
  2. setup your process loop:
var my_pid = PIDController.new()
...
func _process(delta):
  my_pid.setpoint = desired_target_value
  my_actual_value -= my_pid.step(my_actual_value, delta)
  1. Tune your pid controller Ki, Kp and Kd values for your case

Check out : https://github.com/TD-Dan/godot-pid-controller-examples

godot-pid-controller's People

Contributors

td-dan avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.