二自由度之PI-D与I-PD控制
- import control as ctrl
- from control.matlab import *
- import sympy as sp
- import matplotlib.pyplot as plt
- import numpy as np
-
- #--------------------------------------------------------
- def linestyle_generator():
- linestyle = ['-', '--', '-.', ':']
- lineID = 0
- while True:
- yield linestyle[lineID]
- lineID = (lineID + 1) % len(linestyle)
-
- def plot_set(fig_ax, *argv):
- fig_ax.set_xlabel(argv[0])
- fig_ax.set_ylabel(argv[1])
-
- fig_ax.grid(ls=':')
- if len(argv) == 3:
- fig_ax.legend(loc=argv[2])
-
- def bodeplot_set(fig_ax, *argv):
- fig_ax[0].grid(which='both', ls=':')
- fig_ax[0].set_ylabel('Gain [dB')
-
- fig_ax[1].grid(which='both', ls=':')
- fig_ax[1].set_xlabel('$\omega$ [rad/s]')
- fig_ax[1].set_ylabel('Phase [deg')
-
- if len(argv) > 0: