Skip to content

Commit

Permalink
Update PythonPID_Simulator.pyw
Browse files Browse the repository at this point in the history
  • Loading branch information
Destination2Unknown committed Jul 14, 2022
1 parent 9f84e8d commit 2354958
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions PythonPID_Simulator.pyw
Original file line number Diff line number Diff line change
Expand Up @@ -227,11 +227,11 @@ def refresh():
plt.show()

if __name__ == "__main__":
#Random Noise between -0.1 and 0.1, same set used for each run. Created once at runtime.
#Random Noise between -0.25 and 0.25, same set used for each run. Created once at runtime.
minsize=600
maxsize=7200
noise= np.random.rand(minsize)/5
noise-=0.1
noise= np.random.rand(minsize)/2
noise-=0.25

#Gui
root = tk.Tk()
Expand All @@ -242,17 +242,19 @@ if __name__ == "__main__":
#Labels
tk.Label(root, text=" ").grid(row=0,column=0)
tk.Label(root, text="FOPDT").grid(row=0,column=1)
tk.Label(root, text="Model Gain").grid(row=1)
tk.Label(root, text="Model TimeConstant (s) ").grid(row=2)
tk.Label(root, text="Model DeadTime (s) ").grid(row=3)
tk.Label(root, text=" ").grid(row=0,column=2)
tk.Label(root, text=" ").grid(row=1,column=2)
tk.Label(root, text=" ").grid(row=2,column=2)
tk.Label(root, text=" ").grid(row=3,column=2)
tk.Label(root, text="Model Gain: ").grid(row=1,sticky="E")
tk.Label(root, text="TimeConstant: ").grid(row=2,sticky="E")
tk.Label(root, text="DeadTime: ").grid(row=3,sticky="E")
tk.Label(root, text=" ").grid(row=0,column=2,sticky="W")
tk.Label(root, text=" ").grid(row=1,column=2,sticky="W")
tk.Label(root, text="sec ").grid(row=2,column=2,sticky="W")
tk.Label(root, text="sec ").grid(row=3,column=2,sticky="W")
tk.Label(root, text="PID Gains").grid(row=0,column=4)
tk.Label(root, text="Kp").grid(row=1,column=3)
tk.Label(root, text="Ki").grid(row=2,column=3)
tk.Label(root, text="Kd").grid(row=3,column=3)
tk.Label(root, text="Kp:").grid(row=1,column=3)
tk.Label(root, text="Ki:").grid(row=2,column=3)
tk.Label(root, text="Kd:").grid(row=3,column=3)
tk.Label(root, text="1/sec").grid(row=2,column=5,sticky="W")
tk.Label(root, text="sec").grid(row=3,column=5,sticky="W")

#Entry Boxes
tK = tk.Entry(root,width=8)
Expand Down

0 comments on commit 2354958

Please sign in to comment.