@@ -22,8 +22,8 @@ def sisotool(sys, initial_gain=None, xlim_rlocus=None, ylim_rlocus=None,
22
22
plotstr_rlocus = 'C0' , rlocus_grid = False , omega = None , dB = None ,
23
23
Hz = None , deg = None , omega_limits = None , omega_num = None ,
24
24
margins_bode = True , tvect = None , kvect = None ):
25
- """
26
- Sisotool style collection of plots inspired by MATLAB's sisotool.
25
+ """Sisotool style collection of plots inspired by MATLAB's sisotool.
26
+
27
27
The left two plots contain the bode magnitude and phase diagrams.
28
28
The top right plot is a clickable root locus plot, clicking on the
29
29
root locus will change the gain of the system. The bottom left plot
@@ -32,52 +32,52 @@ def sisotool(sys, initial_gain=None, xlim_rlocus=None, ylim_rlocus=None,
32
32
Parameters
33
33
----------
34
34
sys : LTI object
35
- Linear input/output systems. If sys is SISO, use the same
36
- system for the root locus and step response. If it is desired to
37
- see a different step response than feedback(K*sys,1), such as a
38
- disturbance response, sys can be provided as a two-input, two-output
39
- system (e.g. by using :func:`bdgalg.connect' or
40
- :func:`iosys.interconnect`). For two-input, two-output
41
- system, sisotool inserts the negative of the selected gain K between
42
- the first output and first input and uses the second input and output
43
- for computing the step response. To see the disturbance response,
44
- configure your plant to have as its second input the disturbance input.
45
- To view the step response with a feedforward controller, give your
46
- plant two identical inputs, and sum your feedback controller and your
47
- feedforward controller and multiply them into your plant's second
48
- input. It is also possible to accomodate a system with a gain in the
49
- feedback.
35
+ Linear input/output systems. If sys is SISO, use the same system for
36
+ the root locus and step response. If it is desired to see a different
37
+ step response than feedback(K*sys,1), such as a disturbance response,
38
+ sys can be provided as a two-input, two-output system (e.g. by using
39
+ :func:`bdgalg.connect' or :func:`iosys.interconnect`). For two-input,
40
+ two-output system, sisotool inserts the negative of the selected gain
41
+ K between the first output and first input and uses the second input
42
+ and output for computing the step response. To see the disturbance
43
+ response, configure your plant to have as its second input the
44
+ disturbance input. To view the step response with a feedforward
45
+ controller, give your plant two identical inputs, and sum your
46
+ feedback controller and your feedforward controller and multiply them
47
+ into your plant's second input. It is also possible to accomodate a
48
+ system with a gain in the feedback.
50
49
initial_gain : float, optional
51
50
Initial gain to use for plotting root locus. Defaults to 1
52
51
(config.defaults['sisotool.initial_gain']).
53
52
xlim_rlocus : tuple or list, optional
54
- control of x-axis range, normally with tuple
53
+ Control of x-axis range, normally with tuple
55
54
(see :doc:`matplotlib:api/axes_api`).
56
55
ylim_rlocus : tuple or list, optional
57
56
control of y-axis range
58
57
plotstr_rlocus : :func:`matplotlib.pyplot.plot` format string, optional
59
- plotting style for the root locus plot(color, linestyle, etc)
58
+ Plotting style for the root locus plot(color, linestyle, etc).
60
59
rlocus_grid : boolean (default = False)
61
60
If True plot s- or z-plane grid.
62
61
omega : array_like
63
- List of frequencies in rad/sec to be used for bode plot
62
+ List of frequencies in rad/sec to be used for bode plot.
64
63
dB : boolean
65
- If True, plot result in dB for the bode plot
64
+ If True, plot result in dB for the bode plot.
66
65
Hz : boolean
67
- If True, plot frequency in Hz for the bode plot (omega must be provided in rad/sec)
66
+ If True, plot frequency in Hz for the bode plot (omega must be
67
+ provided in rad/sec).
68
68
deg : boolean
69
- If True, plot phase in degrees for the bode plot (else radians)
69
+ If True, plot phase in degrees for the bode plot (else radians).
70
70
omega_limits : array_like of two values
71
- Limits of the to generate frequency vector.
72
- If Hz=True the limits are in Hz otherwise in rad/s. Ignored if omega
73
- is provided, and auto-generated if omitted.
71
+ Limits of the to generate frequency vector. If Hz=True the limits
72
+ are in Hz otherwise in rad/s. Ignored if omega is provided, and
73
+ auto-generated if omitted.
74
74
omega_num : int
75
75
Number of samples to plot. Defaults to
76
76
config.defaults['freqplot.number_of_samples'].
77
77
margins_bode : boolean
78
- If True, plot gain and phase margin in the bode plot
78
+ If True, plot gain and phase margin in the bode plot.
79
79
tvect : list or ndarray, optional
80
- List of timesteps to use for closed loop step response
80
+ List of timesteps to use for closed loop step response.
81
81
82
82
Examples
83
83
--------
@@ -207,7 +207,7 @@ def rootlocus_pid_designer(plant, gain='P', sign=+1, input_signal='r',
207
207
plot = True ):
208
208
"""Manual PID controller design based on root locus using Sisotool
209
209
210
- Uses `Sisotool ` to investigate the effect of adding or subtracting an
210
+ Uses `sisotool ` to investigate the effect of adding or subtracting an
211
211
amount `deltaK` to the proportional, integral, or derivative (PID) gains of
212
212
a controller. One of the PID gains, `Kp`, `Ki`, or `Kd`, respectively, can
213
213
be modified at a time. `Sisotool` plots the step response, frequency
@@ -275,18 +275,18 @@ def rootlocus_pid_designer(plant, gain='P', sign=+1, input_signal='r',
275
275
Parameters
276
276
----------
277
277
plant : :class:`LTI` (:class:`TransferFunction` or :class:`StateSpace` system)
278
- The dynamical system to be controlled
278
+ The dynamical system to be controlled.
279
279
gain : string (optional)
280
280
Which gain to vary by `deltaK`. Must be one of `'P'`, `'I'`, or `'D'`
281
- (proportional, integral, or derative)
281
+ (proportional, integral, or derative).
282
282
sign : int (optional)
283
- The sign of deltaK gain perturbation
283
+ The sign of deltaK gain perturbation.
284
284
input : string (optional)
285
285
The input used for the step response; must be `'r'` (reference) or
286
- `'d'` (disturbance) (see figure above)
286
+ `'d'` (disturbance) (see figure above).
287
287
Kp0, Ki0, Kd0 : float (optional)
288
288
Initial values for proportional, integral, and derivative gains,
289
- respectively
289
+ respectively.
290
290
deltaK : float (optional)
291
291
Perturbation value for gain specified by the `gain` keywoard.
292
292
tau : float (optional)
@@ -307,6 +307,11 @@ def rootlocus_pid_designer(plant, gain='P', sign=+1, input_signal='r',
307
307
closedloop : class:`StateSpace` system
308
308
The closed-loop system using initial gains.
309
309
310
+ Notes
311
+ -----
312
+ When running using iPython or Jupyter, use `%matplotlib` to configure
313
+ the session for interactive support.
314
+
310
315
"""
311
316
312
317
if plant .ninputs == 1 :
0 commit comments