Maintenance will be performed on git.ligo.org, chat.ligo.org, containers.ligo.org, and docs.ligo.org on Tuesday 26 May 2020 starting at approximately 10am CDT. It is expected to take around 30 minutes and will involve a short period of downtime, around 5 minutes, towards the end of the maintenance period. Please address any questions, comments, or concerns to uwm-help@cgca.uwm.edu.

Commit ed073376 authored by Andrew Wade's avatar Andrew Wade

Fixed formating errors rejected by pep8 flake8 checker.

parent b8f524a5
......@@ -31,9 +31,9 @@ def main(args, param):
u_init = RCPID.read(param.actuator, log=False)
print("Starting value of actuator = " + str(u_init) + "\n")
# init Variables
D = u = 0
D = u = 0
uprev = u_init
avoidedJump=0
avoidedJump = 0
pprev = RCPID.read(param.process)
I = RCPID.read(param.actuator)
......@@ -47,7 +47,7 @@ def main(args, param):
if ANDChannels(param.requiredstates): # all binary chans true
# Read sign of PID parameters to use
if param.PIDsign is not None:
PIDsign = -2.0*(RCPID.read(param.PIDsign))+ 1.0
PIDsign = -2.0*(RCPID.read(param.PIDsign)) + 1.0
else:
PIDsign = 1.0
# Read the PID parameters, in case they have changed
......@@ -93,15 +93,15 @@ def main(args, param):
v = P + I + D + param.offset
u = np.clip(v, param.hard_stops[0], param.hard_stops[1])
#Actuate only if there is no jump in actuation more than 0.5
if np.abs(u-uprev)>0.5 and avoidedJump==0:
# Actuate only if there is no jump in actuation more than 0.5
if np.abs(u-uprev) > 0.5 and avoidedJump == 0:
RCPID.write(param.actuator, uprev, monitor=False)
avoidedJump = 1
print("Avoided a jump!")
else:
RCPID.write(param.actuator, u, monitor=False)
avoidedJump = 0
#RCPID.write(param.actuator, u, monitor=False)
# RCPID.write(param.actuator, u, monitor=False)
# Compute values for next iteration of loop
I = I + ki * e + kt * (u - v)
......@@ -327,7 +327,6 @@ class ImportConfig():
self.hard_actuator_limits_all = config.items("HardActuatorLimits")
if __name__ == "__main__":
args = grabInputArgs() # import cmdline arguments
param = ImportConfig(args.configfile) # import config file
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment