Questions tagged [pid-controller]

A proportional-integral-derivative controller (PID controller) is a control loop feedback mechanism (controller) widely used in industrial control systems.

A proportional-integral-derivative controller (PID controller) is a control loop feedback mechanism (controller) widely used in industrial control systems. A PID controller calculates an "error" value as the difference between a measured process variable and a desired setpoint. The controller attempts to minimize the error by adjusting the process control outputs.

The PID controller algorithm involves three separate constant parameters, and is accordingly sometimes called three-term control: the proportional, the integral and derivative values, denoted P, I, and D. Simply put, these values can be interpreted in terms of time: P depends on the present error, I on the accumulation of past errors, and D is a prediction of future errors, based on current rate of change. The weighted sum of these three actions is used to adjust the process via a control element such as the position of a control valve, a damper, or the power supplied to a heating element.

In the absence of knowledge of the underlying process, a PID controller has historically been considered to be the best controller. By tuning the three parameters in the PID controller algorithm, the controller can provide control action designed for specific process requirements. The response of the controller can be described in terms of the responsiveness of the controller to an error, the degree to which the controller overshoots the setpoint, and the degree of system oscillation. Note that the use of the PID algorithm for control does not guarantee optimal control of the system or system stability.

Some applications may require using only one or two actions to provide the appropriate system control. This is achieved by setting the other parameters to zero. A PID controller will be called a PI, PD, P or I controller in the absence of the respective control actions. PI controllers are fairly common, since derivative action is sensitive to measurement noise, whereas the absence of an integral term may prevent the system from reaching its target value due to the control action.

170 questions
3
votes
1 answer

PID controllers for travelling an exact distance with velocity

I am trying to make a robot in a simulation move an exact distance by sending messages with a linear velocity. Right now my implementation doesn't make the robot move an exact distance. This is some sample code: void Robot::travel(double x, double…
Jigglypuff
  • 1,433
  • 6
  • 24
  • 38
2
votes
1 answer

Python GEKKO for PID Tuning

I'm working through the (excellent!) Process Dynamics and Control course at apmonitor.com and have a question about using GEKKO for simulating (and optimizing) PID control parameters. Starting with Example 14. PID_Control_Tuning I am wondering how…
2
votes
2 answers

Scipy fitting to function (FOPDT model identification)

I have data from a doublet test and I'm trying to identify the mathematical model in order to tune a PID controller. This is the plotted data ... I'm pouring hot water (m [kg/s]) into a water tank and displace the colder water inside. The aim of…
cheesus
  • 1,111
  • 1
  • 16
  • 44
2
votes
4 answers

PID controller and transfer function in C++

I have a PID controller working in simulink, but I want to pass it to C++ code. I found how to make a PID with code, something like this: error = input - refeed; iError += error * sampleTime; dError = (error - lastError)/ sampleTime; //PID…
Sik
  • 41
  • 1
  • 1
  • 4
2
votes
2 answers

Asymmetric PID Control Loop

I am writing code for a robotic slide lift. I can accurately get the position of of the lift but I would like to be able to keep the position of lift with little to no oscillation (small high frequency oscillations should be fine). I am using a PID…
Dylan Siegler
  • 742
  • 8
  • 23
2
votes
0 answers

Stabilization - Reducing position error with maximum acceleration, maximum deceleration, and maximum velocity

There is a problem I am struggling with, and I need some help. I will try to explain it thoroughly. I am working on a simulation of a tank. The tank is composed this way: I have the chassis. On the chassis is the turret, which can rotate only in…
2
votes
1 answer

implementing PID algorithm in line following robot

I'm working on a small project with NXT mindstorms set. My intention was to build a Robot that can follow a line very smoothly and as fast as possible. Therefore after a small research I found the PID algorithm and I was able to understand and…
james
  • 153
  • 1
  • 13
2
votes
1 answer

throttling an await delay for inbound messages to a number of messages per second

I am trying to throttle a loop (which is sending messages) to a particular number of messages per second. _throttle is the number of messages per second. My initial algorithm is depicted below, but the delays are not smooth. What improvements can I…
Jim
  • 14,952
  • 15
  • 80
  • 167
2
votes
0 answers

Quadcopter stability pid code

I'm building a quad-copter using an accelerometer and gyro. The form looks like this one: My pitch is controlled by the front and back motors. My roll is controlled by the left and right motors. I used PID and servo libraries. Here's my pitch…
Goor Lavi
  • 412
  • 3
  • 16
2
votes
1 answer

D portion of PID calculation

I am implementing PID control for motor speed control. In the specification I have been told to implement filtering technique using the following equation for D part. I am done with Implementing the PI control and it works perfectly fine for me.…
SPandya
  • 1,161
  • 4
  • 26
  • 63
2
votes
1 answer

PID loop controll what is dt ?? term

What is the actual roll of dt in PID loop and how to set dt value in PID loop. I read about dt, it say dt is loop time means which loop..executation of loop time (20ms) or call PID loop in interrupt part (5s). We use PIC24f controller and in that…
Alpesh
  • 21
  • 1
  • 3
2
votes
2 answers

Limit output of PID controller by second variable in Simulink

I have a problem where I need to limit the output of a PID controller, so it needs to "monitor" two values. I have a swinging system, say a pendulum swinging with angle phi. I want to reduce this swinging with an other system, this is a gyroscope.…
Jasper
  • 2,389
  • 4
  • 25
  • 40
2
votes
1 answer

PID controller returning a positive value even for nagetive angles

My over all goal was to write a PID controller that allowed a rigid body to use torque to rotate to a specific angle based on player location (Aim/shoot pretty basic stuff). Here is the problem. It derps out and just spins around in circles. the…
2
votes
0 answers

How to digitalize CT controller?

I have created CT cascade controller which now needs to be implemented in bigger DT structure to add sensor connections etc. My controller is based mostly on PIDs and a few MatLab functions, and it has been tested with CT dynamics model through…
2
votes
1 answer

How do I obtain the step response of this PID controller in Matlab?

I'm relatively new to Control systems. I'm trying to obtain a graph for the step response of a PID controller of the form Is this possible to plot in mat lab because I get the error that the function cannot plot the step response of a system…
Emmanuel N K
  • 8,710
  • 1
  • 31
  • 37
1
2
3
11 12