|
37 | 37 | """ |
38 | 38 |
|
39 | 39 | import sys |
40 | | -from PyQt5.QtWidgets import QDialog, QApplication, QLabel, QRadioButton, QSlider, QPushButton, QVBoxLayout, QHBoxLayout, QFormLayout, QFileDialog, QLineEdit, QSpinBox, QDoubleSpinBox, QMessageBox, QTableWidget, QTableWidgetItem, QHeaderView |
| 40 | +from PyQt5.QtWidgets import QDialog, QApplication, QLabel, QRadioButton, QSlider, QPushButton, QVBoxLayout, QHBoxLayout, QFormLayout, QFileDialog, QLineEdit, QSpinBox, QDoubleSpinBox, QMessageBox, QCheckBox, QTableWidget, QTableWidgetItem, QHeaderView |
41 | 41 | from PyQt5.QtCore import Qt |
42 | 42 |
|
43 | 43 | from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas |
@@ -270,7 +270,13 @@ def printImproperTfError(self): |
270 | 270 | def createPidLayout(self): |
271 | 271 | layout_pid = QFormLayout() |
272 | 272 |
|
273 | | - layout_pid.addRow(QLabel("Ideal/Standard: Kp * [1 + Ki + Kd]\t(Parallel: Kp + Ki + Kd)")) |
| 273 | + layout_structure = QHBoxLayout() |
| 274 | + layout_structure.addWidget(QLabel("Ideal/Standard: Kp * [1 + Ki + Kd]\t(Parallel: Kp + Ki + Kd)")) |
| 275 | + self.pid_no_zero_box = QCheckBox("PI no-zero", self) |
| 276 | + self.pid_no_zero_box.setChecked(False) |
| 277 | + self.pid_no_zero_box.stateChanged.connect(self.updateClosedLoop) |
| 278 | + layout_structure.addWidget(self.pid_no_zero_box) |
| 279 | + layout_pid.addRow(layout_structure) |
274 | 280 |
|
275 | 281 | layout_k = QHBoxLayout() |
276 | 282 | self.slider_k = DoubleSlider(Qt.Horizontal) |
@@ -586,7 +592,7 @@ def updateClosedLoop(self): |
586 | 592 | p_control = ctrl.TransferFunction([kc], [1], dt, inputs='id_out', outputs='pid_out') |
587 | 593 | sum_control = ctrl.summing_junction(inputs=['pid_out', 'ff_out'], output='u') |
588 | 594 |
|
589 | | - remove_zero = False |
| 595 | + remove_zero = self.pid_no_zero_box.isChecked() |
590 | 596 | no_derivative_kick = True |
591 | 597 |
|
592 | 598 | if remove_zero: |
|
0 commit comments