@@ -331,26 +331,21 @@ def rootlocus_pid_designer(plant, gain='P', sign=+1, input_signal='r',
331331 u_summer = summing_junction (['ufb' , 'uff' , 'd' ], 'u' )
332332
333333 if isctime (plant ):
334- prop = tf (1 , 1 )
335- integ = tf (1 , [1 , 0 ])
336- deriv = tf ([1 , 0 ], [tau , 1 ])
334+ prop = tf (1 , 1 , inputs = 'e' , outputs = 'prop_e' )
335+ integ = tf (1 , [1 , 0 ], inputs = 'e' , outputs = 'int_e' )
336+ deriv = tf ([1 , 0 ], [tau , 1 ], inputs = 'y' , outputs = 'deriv' )
337337 else : # discrete-time
338- prop = tf (1 , 1 , dt )
339- integ = tf ([dt / 2 , dt / 2 ], [1 , - 1 ], dt )
340- deriv = tf ([1 , - 1 ], [dt , 0 ], dt )
338+ prop = tf (1 , 1 , dt , inputs = 'e' , outputs = 'prop_e' )
339+ integ = tf ([dt / 2 , dt / 2 ], [1 , - 1 ], dt , inputs = 'e' , outputs = 'int_e' )
340+ deriv = tf ([1 , - 1 ], [dt , 0 ], dt , inputs = 'y' , outputs = 'deriv' )
341341
342- # add signal names by turning into iosystems
343- prop = tf2io (prop , inputs = 'e' , outputs = 'prop_e' )
344- integ = tf2io (integ , inputs = 'e' , outputs = 'int_e' )
345342 if derivative_in_feedback_path :
346- deriv = tf2io (- deriv , inputs = 'y' , outputs = 'deriv' )
347- else :
348- deriv = tf2io (deriv , inputs = 'e' , outputs = 'deriv' )
343+ deriv = - deriv
349344
350345 # create gain blocks
351- Kpgain = tf2io ( tf (Kp0 , 1 ), inputs = 'prop_e' , outputs = 'ufb' )
352- Kigain = tf2io ( tf (Ki0 , 1 ), inputs = 'int_e' , outputs = 'ufb' )
353- Kdgain = tf2io ( tf (Kd0 , 1 ), inputs = 'deriv' , outputs = 'ufb' )
346+ Kpgain = tf (Kp0 , 1 , inputs = 'prop_e' , outputs = 'ufb' )
347+ Kigain = tf (Ki0 , 1 , inputs = 'int_e' , outputs = 'ufb' )
348+ Kdgain = tf (Kd0 , 1 , inputs = 'deriv' , outputs = 'ufb' )
354349
355350 # for the gain that is varied, replace gain block with a special block
356351 # that has an 'input' and an 'output' that creates loop transfer function
0 commit comments