- refactored dt
This commit is contained in:
@@ -13,9 +13,8 @@ class States(Enum):
|
||||
|
||||
|
||||
class TempController(AttributeChange):
|
||||
def __init__(self, params):
|
||||
def __init__(self, dt, params):
|
||||
AttributeChange.__init__(self)
|
||||
dt = params['dt']
|
||||
self.pid_hold = Pid(dt)
|
||||
self.pid_rate = Pid(dt)
|
||||
self.theta_ist_set = 20
|
||||
@@ -108,8 +107,9 @@ class TempController(AttributeChange):
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
dt = 1.0
|
||||
|
||||
tc_params = {
|
||||
"dt": 1.0,
|
||||
"Kalman": {
|
||||
"var_P" : 1.0,
|
||||
"var_Q" : 0.0001,
|
||||
@@ -130,7 +130,6 @@ if __name__ == '__main__':
|
||||
}
|
||||
|
||||
pot_params = {
|
||||
"dt" : 1.0,
|
||||
"theta" : 20,
|
||||
"C" : 4190,
|
||||
"M" : 20,
|
||||
@@ -141,8 +140,8 @@ if __name__ == '__main__':
|
||||
|
||||
temp_ist = 0
|
||||
temp_soll = 20
|
||||
ctrl = TempController(tc_params)
|
||||
plant = Pot(pot_params)
|
||||
ctrl = TempController(dt, tc_params)
|
||||
plant = Pot(dt, pot_params)
|
||||
_temp_ist = np.empty(0)
|
||||
_temp_soll = np.empty(0)
|
||||
_y = np.empty(0)
|
||||
|
||||
Reference in New Issue
Block a user