Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

autotuner-pi-controller

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

autotuner-pi-controller

`autotuner-pi-controller` is a Proportional-Integral (PI) controller that uses the Relay Feedback Test for auto-tuning. The Relay Feedback Test is used to estimate the ultimate gain (Ku) and ultimate period$

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Relay Auto-Tuning PI Controller

Overview

autotuner-pi-controller is a Proportional-Integral (PI) controller that uses the Relay Feedback Test for auto-tuning. The Relay Feedback Test is used to estimate the ultimate gain (Ku) and ultimate period (Pu) of a process. These parameters are then used to calculate the PI gains.

Installation

Copy the autotuner-pi-controller/index.js file to your project directory or install it using npm install autotuner-pi-controller in your project directory

Usage

const RelayAutoTuningPIController = require('./path/to/autotuner-pi-controller/index.js');

// Create a new controller with initial parameters
const piController = new RelayAutoTuningPIController(1.0, 0.0, 1.0);

// Simulate a process and auto-tune the controller
const setpoint = 50;
let measuredValue = 40;
let controlOutput = piController.autoTune(setpoint, measuredValue);

// Use the controller to calculate the control output
controlOutput = piController.update(setpoint, measuredValue);

Methods

  • update(setpoint, measuredValue): Calculates the control output based on the setpoint and measured value.
  • relayFeedbackTest(measuredValue): Implements the relay feedback test.
  • calculateUltimateGainAndPeriod(): Calculates the ultimate gain (Ku) and ultimate period (Pu) based on the recorded cycle times.
  • setTuningParameters(Ku, Pu): Sets the PI gains based on the calculated Ku and Pu.
  • autoTune(setpoint, measuredValue): Performs the relay feedback test, calculates Ku and Pu, sets the PI gains, and then calculates the control output.
  • enterErrorState(): Enters an error state and resets integral and cycle times when abnormal conditions are detected.
  • exitErrorState(): Exits the error state and attempts to recover normal operation.

Error Handling

The controller includes error handling and recovery mechanisms. When abnormal conditions are detected (e.g., unusually large errors or invalid tuning parameters), the controller enters an error state. In this state, the controller stops normal operation and returns a safe control output. The controller can attempt to recover from an error state by calling the exitErrorState() method.

License

Apache-2.0

Author

Harshad Joshi @ Bufferstack.IO Analytics Technology LLP, Pune

Keywords

FAQs

Package last updated on 17 Aug 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc