Skip to content

Commit abdc0ea

Browse files
committed
Update pidmayuresh.py
1 parent 7df21db commit abdc0ea

1 file changed

Lines changed: 3 additions & 16 deletions

File tree

tools/pidmayuresh.py

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -36,30 +36,17 @@ def pid_controller(Prev_Error, I, ym):
3636

3737
concore.default_maxtime(150)
3838
concore.delay = 0.02
39-
init_simtime_u = "[0.0, 0.0,0.0]"
4039
init_simtime_ym = "[0.0, 70.0,91]"
41-
u = np.array([concore.initval(init_simtime_u)]).T
42-
print("Mayuresh's and Shannon's PID controller: sp is "+str(sp))
40+
ym = np.array(concore.initval(init_simtime_ym))
41+
print("Mayuresh's PID controller: sp is "+str(sp))
4342
print(concore.params)
4443
while(concore.simtime<concore.maxtime):
4544
while concore.unchanged():
4645
ym = concore.read(1,"ym",init_simtime_ym)
4746
ym = np.array(ym)
48-
49-
if concore.simtime < 0:
50-
ustar = np.array([0.0,30.0])
51-
else:
52-
(Prev_Error, I, ustar) = pid_controller(Prev_Error, I, ym)
53-
47+
(Prev_Error, I, ustar) = pid_controller(Prev_Error, I, ym)
5448
print(str(concore.simtime) + " u="+str(ustar) + "ym="+str(ym))
5549
concore.write(1,"u",list(ustar),delta=0)
5650

5751

5852

59-
#from ast import literal_eval
60-
#try:
61-
# params = literal_eval(open(concore.inpath+"1/concore.params").read())
62-
#except:
63-
# params = dict()
64-
65-

0 commit comments

Comments
 (0)