Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions GAMs/PyGAM/pid.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@

#Past history required for pid
global y_1, x_1, x_2, x_fact, x_1_fact, x_2_fact
y_1 = np.float(0.)
x_1 = np.float(0.)
x_2 = np.float(0.)
y_1 = float(0.)
x_1 = float(0.)
x_2 = float(0.)
#PID factors in Z, computed once for all
x_fact = 0
x_1_fact = 0
Expand All @@ -48,9 +48,9 @@ def setup():
print('Kd: '+str(Kd))
print('T: '+str(T))

x_fact = np.float(Kp + T*Ki + Kd/T)
x_1_fact = np.float(-(Kp+2.*Kd/T))
x_2_fact = np.float(Kd/T)
x_fact = float(Kp + T*Ki + Kd/T)
x_1_fact = float(-(Kp+2.*Kd/T))
x_2_fact = float(Kd/T)

def execute(x):
global y_1
Expand Down