Numerical integration and differentation in the PID algorithm: Difference between revisions

From wikiluntti
Line 21: Line 21:
== Theory ==
== Theory ==


If applying only proportional coding, the steering is affected by the amount of difference in reflectance from the average. The integral term is a sum (or integral) of the previous (historical) errors, and differential is used to forecast the next error based on the previous errors.  
If applying only proportional coding, the steering is affected by the amount of difference in reflectance from the average. The integral term is a sum (or integral) of the previous (historical) errors, and that is used to correct steering if it has been wrong for a while. The differential is used to forecast the next error based on the previous errors, and we use it to steer more or less depending on the previous error.


{|
{|

Revision as of 12:28, 17 October 2020

Introduction

PID is elaborated algorithm to use in numerous ways. Though it might difficult to set up the parameters correctly, it makes the robot move more smoothly and thus more rapid. The P is for Proportional, I is the Integral and D is Differential. We use PID in line following.

Aim

Proportion, Integration and Derivation.

Plotting, Error function.

Robot

Almost any robot will do, but we will use Asimov 2/ Verne robot.

Sensors

A light sensor is used.

Example Video

Theory

If applying only proportional coding, the steering is affected by the amount of difference in reflectance from the average. The integral term is a sum (or integral) of the previous (historical) errors, and that is used to correct steering if it has been wrong for a while. The differential is used to forecast the next error based on the previous errors, and we use it to steer more or less depending on the previous error.

Term Math Meaning
Error Sensor value - target value
Integral Integral + error
Derivative Error - previous error

Steering is .

We use three different parameters , and . Furthermore, the integral needs to forget the very old data, and thus we need an term (which can be multiplied together to already). Of course, the parameters depend on the line and robot.

Exercises

References

See [PID Controller For Lego Mindstorms Robots]

Back to Mahtavaa Matematiikkaa 2020