npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

easy-pi-tuner

v1.0.0

Published

Self Tuning PI Controller at work

Downloads

1

Readme

easy-pi-tuner

A Proportional-Integral (PI) controller that self-tunes its gains based on the system's response to minimize the error over time.

Design Philosophy

Traditional PI controllers rely on fixed gains that are manually tuned based on empirical testing or system analysis. While these controllers are effective in many scenarios, they may not adapt well to systems with changing dynamics or external disturbances.

The easy-pi-tuner is designed to address this limitation. By dynamically adjusting its gains based on the system's response, it can adapt to varying conditions, potentially offering more robust control in diverse scenarios.

Working

The SelfTuningPIController class calculates the control output based on the difference between the setpoint (desired value) and the measured value. The control output is a combination of:

  • Proportional Term: Proportional to the current error.
  • Integral Term: Accumulates the error over time.

The unique feature of this controller is its ability to adjust the proportional (Kp) and integral (Ki) gains dynamically. If the error increases, the gains are adjusted to try to reduce the error, and vice versa.

Applications

The easy-pi-tuner can be beneficial in:

  • Systems with Changing Dynamics: For systems where the dynamics change over time, such as processes that have different phases or stages.
  • Noisy Environments: In scenarios where there's a lot of external disturbances or noise, the controller can adapt its gains to maintain control.
  • Situations where Manual Tuning is Challenging: In complex systems where manual tuning is difficult or time-consuming.

Installation

npm install easy-pi-tuner

Usage

To use the SelfTuningPIController, first import the module:

const SelfTuningPIController = require('easy-pi-tuner');

Then, create a new instance of the controller:

const controller = new SelfTuningPIController();

You can set desired values and update the controller based on measured values:

const desiredValue = 100; // Example setpoint
const measuredValue = 90; // Example current value

const controlOutput = controller.update(desiredValue, measuredValue);

The controlOutput can then be used to control your system, and the controller will automatically adjust its gains based on the system's response.

License

This project is licensed under the Apache License, Version 2.0. See the LICENSE file for details.

Example

Check example.js included with this module

Author

Harshad Joshi @ Bufferstack.IO Analytics Technology LLP, Pune