|
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 |
@@ -269,7 +269,13 @@ def printImproperTfError(self): |
269 | 269 | def createPidLayout(self): |
270 | 270 | layout_pid = QFormLayout() |
271 | 271 |
|
272 | | - layout_pid.addRow(QLabel("Ideal/Standard: Kp * [1 + Ki + Kd]\t(Parallel: Kp + Ki + Kd)")) |
| 272 | + layout_structure = QHBoxLayout() |
| 273 | + layout_structure.addWidget(QLabel("Ideal/Standard: Kp * [1 + Ki + Kd]\t(Parallel: Kp + Ki + Kd)")) |
| 274 | + self.pid_no_zero_box = QCheckBox("PI no-zero", self) |
| 275 | + self.pid_no_zero_box.setChecked(False) |
| 276 | + self.pid_no_zero_box.stateChanged.connect(self.updateClosedLoop) |
| 277 | + layout_structure.addWidget(self.pid_no_zero_box) |
| 278 | + layout_pid.addRow(layout_structure) |
273 | 279 |
|
274 | 280 | layout_k = QHBoxLayout() |
275 | 281 | self.slider_k = DoubleSlider(Qt.Horizontal) |
@@ -585,7 +591,7 @@ def updateClosedLoop(self): |
585 | 591 | p_control = ctrl.TransferFunction([kc], [1], dt, inputs='id_out', outputs='pid_out') |
586 | 592 | sum_control = ctrl.summing_junction(inputs=['pid_out', 'ff_out'], output='u') |
587 | 593 |
|
588 | | - remove_zero = False |
| 594 | + remove_zero = self.pid_no_zero_box.isChecked() |
589 | 595 | no_derivative_kick = True |
590 | 596 |
|
591 | 597 | if remove_zero: |
|
0 commit comments