Package controlsystems :: Module pid_simulation
[hide private]

Module pid_simulation

source code

PID Controller Simulation

This module implements some PID tuning methods for simulation, based on the reaction curve. Take care to choose a total time after the system stabilization. This issue will be fixed soon.

See: http://wikis.controltheorypro.com/index.php?title=PID_Control

Functions [hide private]
 
ZieglerNichols(g, sample_time, total_time, n_method)
ZieglerNichols tuning method
source code
 
CohenCoon(g, sample_time, total_time, n_method)
CohenCoon tuning method
source code
 
ChienHronesReswick0(g, sample_time, total_time, n_method)
ChienHronesReswick0 tuning method
source code
 
ChienHronesReswick20(g, sample_time, total_time, n_method)
ChienHronesReswick20 tuning method
source code
 
get_time_near(t, y, point)
Get time near
source code
Variables [hide private]
  __package__ = None
hash(x)
Function Details [hide private]

ZieglerNichols(g, sample_time, total_time, n_method)

source code 

ZieglerNichols tuning method

Returns the 'kp', 'ki' and 'kd' gains to a PID controller, using the Ziegler-Nichols tuning method, based on the reaction curve. For example (using Euler to discretize):

>>> g = TransferFunction([1], [1, 2, 3])
>>> kp, ki, kd = ZieglerNichols(g, 0.01, 10, Euler)
>>> print kp
7.25920108978
>>> print ki
11.9003296554
>>> print kd
1.10702816619

CohenCoon(g, sample_time, total_time, n_method)

source code 

CohenCoon tuning method

Returns the 'kp', 'ki' and 'kd' gains to a PID controller, using the Cohen-Coon tuning method, based on the reaction curve. For example (using Euler to discretize):

>>> g = TransferFunction([1], [1, 2, 3])
>>> kp, ki, kd = CohenCoon(g, 0.01, 10, Euler)
>>> print kp
5.38204782425
>>> print ki
8.56051231163
>>> print kd
1.26879134141

ChienHronesReswick0(g, sample_time, total_time, n_method)

source code 

ChienHronesReswick0 tuning method

Returns the 'kp', 'ki' and 'kd' gains to a PID controller, using the Chien-Hrones-Reswick (0%) tuning method, based on the reaction curve. For example (using Euler to discretize):

>>> g = TransferFunction([1], [1, 2, 3])
>>> kp, ki, kd = ChienHronesReswick0(g, 0.01, 10, Euler)
>>> print kp
3.62960054489
>>> print ki
5.90178950389
>>> print kd
0.553514083096

ChienHronesReswick20(g, sample_time, total_time, n_method)

source code 

ChienHronesReswick20 tuning method

Returns the 'kp', 'ki' and 'kd' gains to a PID controller, using the Chien-Hrones-Reswick (20%) tuning method, based on the reaction curve. For example (using Euler to discretize):

>>> g = TransferFunction([1], [1, 2, 3])
>>> kp, ki, kd = ChienHronesReswick20(g, 0.01, 10, Euler)
>>> print kp
5.74686752941
>>> print ki
6.6746428913
>>> print kd
0.823813460341

get_time_near(t, y, point)

source code 

Get time near

Auxiliary function. Returns the time 't' of the point 'y' more near of the desired point 'point'.