diff --git a/README.md b/README.md
index 9f09f1c..0b478f6 100644
--- a/README.md
+++ b/README.md
@@ -13,10 +13,10 @@
右:10*10cm最终版本
#### 1 软件架构
-在原作者的自平衡控制**电压**算法上进行修改,将电压控制改为**速度**控制。使对模型的控制在物理上更加容易理解。并且代码的调参都可以通过连接ESP32的wifi调整。具体特性如下:
+自平衡控制为LQR算法输出期望**速度**,使动量轮**加速运动**从而控制三角形左右方向。并且代码的调参都可以通过连接ESP32的wifi调整。具体特性如下:
- **基于 Arduino**:运行在 ESP32 Arduino 上
-- **控制模式丰富**:电压控制和速度控制
+- **自带测试模式**:电压测试和速度测试,可以单独输出电压让电机转动,也可以设置指定速度让电机保持速度
![Image text](image/gui.gif)
#### 2 硬件特性
@@ -25,14 +25,14 @@
| ---------------- |---------------------- |
| 莱洛三角形尺寸 | 100*100 mm |
|动量轮尺寸|80*80 mm|
-|电池*3 |厚x长x宽:7.9mmx25mmx40mm|
+|电池*3 |厚x长x宽:7.9mmx25mmx40mm 规格内均可|
| 输入电压 | 3.7v锂电池*3|
|充电电压| 5V 从Type-C口输入|
|充电芯片CS5095|5V输入,最大1.2A充电电流|
-|串口芯片CH340C|需要打开开关才能下载|
+|串口芯片CH340C|需要 打开开关 才能下载|
| 主控芯片 | ESP-WROOM-32 |
|电机驱动芯片L6234PD|引脚:32, 33, 25, 22; 22为enable|
-| AS5600 编码器 |SDA-23 SCL-5 芯片要离磁铁有2mm以上高度|
+| AS5600 编码器 |SDA-23 SCL-5 芯片要离磁铁有 2mm以上高度 |
| MPU6050六轴传感器 | SDA-19 SCL-18 |
@@ -40,15 +40,18 @@
1. 前往灯哥开源[FOCgit](https://gitee.com/ream_d/Deng-s-foc-controller)下载Arduino开发环境(~~也可自行下载Arduino并安装SimpleFOC~~)并打开本项目内的Arduino内的main。
2. 烧录程序到ESP32:选择工具-开发板-esp32 Arduino-ESP32 Dev module,然后连接USB口选择对应的com口,编译上传。
- 1. 如无法正常编译
+ 1. 如无法正常编译
1. 情况1:wifi库重复,删除文件夹Arduino\libraries内的wifi文件夹。
2. 情况2:可能与原有arduino冲突,请卸载原有的arduino。
3. 情况3:文件夹路径含有非法字符,可以把Arduino移动到硬盘根目录下,如D:\Arduino
-3. 打开本项目内的`python_gui`内的`可执行文件_main`内的**main.exe**并连接上WIFI:ESP32。点击设置开始调参。
+3. 打开本项目内的`python_gui`内的`可执行文件_main`内的**main.exe**并连接上WIFI:ESP32 密码:12345678。点击设置开始调参。
+4. 连接成功后,点击disable,然后逆时针拨动动量轮,查看上位机中V参数是否为正值。注意!如果 逆时针转为为负值 那么需要将电机线任意两线互换。
![Image text](image/tiaocan.gif)
-4. K值可以用滑块调整,拖动滑块就会发送参数命令,但是调整到合适值之后需要自行在Arduino的main中修改再烧录一次
+5. 如果电机不能正常运行可以,点击上位机中最下方的 测试部分 ,打开电压或者速度测试,滑动滑条,查看电机能否正常运行。如还不能请检测硬件电路部分。
+6. 如果不能摇摆直立,推荐调整的参数为TA、SA、SV
+7. K值可以用滑块调整,拖动滑块就会发送参数命令,但是调整到合适值之后需要自行在Arduino的main中修改再烧录一次
-5. 滑条:最左边输入框为滑块下限,右边是滑块上限,滑条等分成**200**份,命令是**字符串**,滑动滑块发送**字符串** + **数值**
+8. 滑条:最左边输入框为滑块下限,右边是滑块上限,滑条等分成**200**份,命令是**字符串**,滑动滑块发送**字符串** + **数值**
比如让平衡角度为90度,则输入:TA90,并且会存入eeprom的位置0中 注:wifi发送**命令不能过快**,因为每次都会保存进eeprom,K参数没有保存到EEPROM所以可以使用滑条调整。
@@ -61,11 +64,13 @@
|VI1|速度环的PID的I,1是稳定在平衡角度之前的I值|
|VP2|速度环的PID的P,2是稳定后的P值|
|VI2|速度环的PID的I,2是稳定后的I值|
-|K为LQR参数|第一个数字**1和2**是电压控制稳定前和后**3和4**是速度控制稳定前和后,第二个数字如下|
-|K1**1**|LQR的参数1:角度差值|
-|K1**2**|LQR的参数2:左右倾倒加速度|
-|K1**3**|LQR的参数3:当前速度|
-
+|K为LQR参数|**3和4**是速度控制稳定前和后|
+|K3**1**|LQR的参数1:稳定前的角度差值|
+|K3**2**|LQR的参数2:稳定前的左右倾倒加速度|
+|K3**3**|LQR的参数3:稳定前的当前速度|
+|K4**1**|LQR的参数1:稳定后的角度差值|
+|K4**2**|LQR的参数2:稳定后的左右倾倒加速度|
+|K4**3**|LQR的参数3:稳定后的当前速度|
LQR算法解释:当三角形向←倾斜时,需要产生向→的力回正。
在电压控制下:回正力F直接和输出电压值挂钩,向←倾斜,电机提供正电压V动量轮向**左加速转动**,产生向右的力F。
@@ -84,15 +89,15 @@ LQR算法解释:当三角形向←倾斜时,需要产生向→的力回正
#### 4 硬件设计
使用立创EDA绘制电路原理图,LaserMaker绘制莱洛三角形和动量轮(有激光切割机可以事先切割结构作为参考)。将绘制完的图形导入到立创EDA中可作为PCB的外框。丝印图案分别是**Gawr Gura**、**ouro kronii** ~~helicopter~~
-LaserMaker绘制的plt在**莱洛三角结构**文件夹内
+LaserMaker绘制的plt在**莱洛三角结构**文件夹内,需要重新绘制电路图可以使用
-感谢嘉立创的PCB制板,使DIY电路制作变得非常便利
+感谢嘉立创的PCB制板,使DIY电路制作变得非常便利,点击下方超链接可以前往嘉立创进行PCB制板
[莱洛三角形PCB](https://oshwhub.com/45coll/zi-ping-heng-di-lai-luo-san-jiao_10-10-ban-ben)
[动量轮](https://oshwhub.com/45coll/lai-luo-san-jiao-dong-liang-lun)
-具体需要购买的物品在**物料清单.xlsx**中
+具体需要购买的物品在**物料清单.xlsx**中,如果缺货请自行某宝更换
#### 5 Ctrl+C +V(参考)
Arduino上的控制算法是原作者的LQR,无刷电机控制是灯哥开源FOC。电机控制引脚定义与传感器定义和灯哥开源FOC控制板2.0版一样。
@@ -121,3 +126,5 @@ Python的GUI是SimpleFOC的SimpleFOCStudio。
45coll电子交流QQ群:**824113552**
欢迎交流与沟通
+
+群文件内有PCB、元器件下单以及软件安装的教程视频
diff --git a/image/frist.png b/image/frist.png
deleted file mode 100644
index 4dcf56a..0000000
Binary files a/image/frist.png and /dev/null differ
diff --git a/image/gui.gif b/image/gui.gif
index 7059db1..37613d1 100644
Binary files a/image/gui.gif and b/image/gui.gif differ
diff --git a/image/gui_main.jpg b/image/gui_main.jpg
deleted file mode 100644
index 5a29c2b..0000000
Binary files a/image/gui_main.jpg and /dev/null differ
diff --git a/image/tiaocan.gif b/image/tiaocan.gif
index 620c7b6..74e73a9 100644
Binary files a/image/tiaocan.gif and b/image/tiaocan.gif differ
diff --git a/python_gui/gui/__pycache__/main.cpython-37.pyc b/python_gui/gui/__pycache__/main.cpython-37.pyc
index f701ede..85c05f9 100644
Binary files a/python_gui/gui/__pycache__/main.cpython-37.pyc and b/python_gui/gui/__pycache__/main.cpython-37.pyc differ
diff --git a/python_gui/gui/__pycache__/main_ui.cpython-37.pyc b/python_gui/gui/__pycache__/main_ui.cpython-37.pyc
index 15fecf5..68f5ca5 100644
Binary files a/python_gui/gui/__pycache__/main_ui.cpython-37.pyc and b/python_gui/gui/__pycache__/main_ui.cpython-37.pyc differ
diff --git a/python_gui/gui/main.py b/python_gui/gui/main.py
index 20ba125..7535aee 100644
--- a/python_gui/gui/main.py
+++ b/python_gui/gui/main.py
@@ -15,11 +15,14 @@ class MyWindow(QMainWindow, Ui_MainWindow):
GUIToolKit.MAROON_COLOR, GUIToolKit.ORANGE_COLOR, GUIToolKit.GREEN_COLOR]
signalIcons = ['reddot', 'bluedot', 'purpledot', 'yellowdot', 'maroondot', 'orangedot', 'greendot']
textColors = ['FF5C5C','398AD9','5BEC8D','FD42AC','FF33FF','4B8200','DE87B8']
+ slider_lab = ['horizontalSlider_1', 'horizontalSlider_2','horizontalSlider_3','horizontalSlider_4','horizontalSlider_5']
+
def __init__(self, parent=None):
super(MyWindow, self).__init__(parent)
self.setupUi(self)
# 变量初始化
self.wifi_open_flag = 0
+ self.test_flag = 0
# self.variable_init()
# 设置实例
# self.CreateItems()
@@ -27,9 +30,12 @@ class MyWindow(QMainWindow, Ui_MainWindow):
self.CreateSignalSlot()
# 设置信号与槽
def CreateSignalSlot(self):
- self.horizontalSlider_1.valueChanged.connect(self.horizontalSlider_1_valueChanged)
- self.horizontalSlider_2.valueChanged.connect(self.horizontalSlider_2_valueChanged)
- self.horizontalSlider_3.valueChanged.connect(self.horizontalSlider_3_valueChanged)
+ self.horizontalSlider_1.valueChanged.connect(lambda: self.horizontalSlider_valueChanged(self.horizontalSlider_1))
+ self.horizontalSlider_2.valueChanged.connect(lambda: self.horizontalSlider_valueChanged(self.horizontalSlider_2))
+ self.horizontalSlider_3.valueChanged.connect(lambda: self.horizontalSlider_valueChanged(self.horizontalSlider_3))
+ self.horizontalSlider_4.valueChanged.connect(lambda: self.horizontalSlider_valueChanged(self.horizontalSlider_4))
+ self.horizontalSlider_5.valueChanged.connect(lambda: self.horizontalSlider_valueChanged(self.horizontalSlider_5))
+
self.wifi_config_pushButton.clicked.connect(self.wifi_config_pushButton_clicked)
self.wifi_command_pushButton_1.clicked.connect(self.wifi_command_pushButton_1_clicked)
self.wifi_command_pushButton_2.clicked.connect(self.wifi_command_pushButton_2_clicked)
@@ -44,22 +50,38 @@ class MyWindow(QMainWindow, Ui_MainWindow):
self.raw_pushButton.clicked.connect(self.raw_pushButton_clicked)
self.wave_pushButton.clicked.connect(self.wave_pushButton_clicked)
+
+ self.test_pushButton_voltage.clicked.connect(self.test_pushButton_voltage_clicked)
+ self.test_pushButton_velocity.clicked.connect(self.test_pushButton_velocity_clicked)
def raw_pushButton_clicked(self):
self.change_state = 1
self.stackedWidget.setCurrentIndex(1)
- # for i in range(self.gridLayout.count()):
- # self.gridLayout.removeWidget(self.gridLayout.itemAt(i).widget())
- # self.gridLayout.addWidget(self.raw_line)
def wave_pushButton_clicked(self):
self.change_state = 0
self.stackedWidget.setCurrentIndex(0)
- # for i in range(self.gridLayout.count()):
- # self.gridLayout.removeWidget(self.gridLayout.itemAt(i).widget())
- #
- #
- # self.gridLayout.addWidget(self.plotWidget)
+ def test_pushButton_voltage_clicked(self):
+ self.udp.send_message("TVQ")
+ if self.test_flag == 1:
+ self.test_pushButton_voltage.setText("电压测试打开")
+ self.test_pushButton_velocity.setText("速度测试打开")
+ self.test_flag = 0
+ else:
+ self.test_pushButton_voltage.setText("电压测试关闭")
+ self.test_pushButton_velocity.setText("速度测试打开")
+ self.test_flag = 1
+
+ def test_pushButton_velocity_clicked(self):
+ self.udp.send_message("TVV")
+ if self.test_flag == 2:
+ self.test_pushButton_voltage.setText("电压测试打开")
+ self.test_pushButton_velocity.setText("速度测试打开")
+ self.test_flag = 0
+ else:
+ self.test_pushButton_voltage.setText("电压测试打开")
+ self.test_pushButton_velocity.setText("速度测试关闭")
+ self.test_flag = 2
# 设置实例
def CreateItems(self):
# 定时器-绘图刷新
@@ -68,7 +90,7 @@ class MyWindow(QMainWindow, Ui_MainWindow):
self.timer.start(20)
# wifi udp
self.udp = udp()
- # self.wifi_IP_lineEdit.setText(self.udp.user_ip)
+ # self.wifi_IP_lineEdit.setText(self.udp.user_ip)#设置为当前本机ID
def variable_init(self):
# wifi变量
self.wifi_recv_flag = 0
@@ -122,24 +144,16 @@ class MyWindow(QMainWindow, Ui_MainWindow):
self.signalPlotFlags[i] = False
self.plotWidget.removeItem( self.signalPlots[i] )
# 滑条绑定
- def horizontalSlider_1_valueChanged(self):
- value = self.horizontalSlider_1.value()
- value = float(self.left_lineEdit_1.text())+(value+100)*(float(self.right_lineEdit_1.text())-float(self.left_lineEdit_1.text()))/200
- self.num_lineEdit_1.setText(str(value))
- value = self.command_lineEdit_1.text()+str(value)
- self.udp.send_message(str(value))
- def horizontalSlider_2_valueChanged(self):
- value = self.horizontalSlider_2.value()
- value = float(self.left_lineEdit_2.text())+(value+100)*(float(self.right_lineEdit_2.text())-float(self.left_lineEdit_2.text()))/200
- self.num_lineEdit_2.setText(str(value))
- value = self.command_lineEdit_2.text()+str(value)
- self.udp.send_message(str(value))
- def horizontalSlider_3_valueChanged(self):
- value = self.horizontalSlider_3.value()
- value = float(self.left_lineEdit_3.text())+(value+100)*(float(self.right_lineEdit_3.text())-float(self.left_lineEdit_3.text()))/200
- self.num_lineEdit_3.setText(str(value))
- value = self.command_lineEdit_3.text()+str(value)
+ def horizontalSlider_valueChanged(self,slider):
+ i = self.slider_lab.index(slider.objectName())
+ layout = getattr(self, 'horizontalLayout_{}'.format(i+4))
+ value = layout.itemAt(1).widget().value()
+ value = float(layout.itemAt(0).widget().text()) + (value + 100) * (
+ float(layout.itemAt(2).widget().text()) - float(layout.itemAt(0).widget().text())) / 200
+ layout.itemAt(6).widget().setText(str(value))
+ value = layout.itemAt(4).widget().text() + str(value)
self.udp.send_message(str(value))
+
# command命令发送事件
def wifi_command_pushButton_1_clicked(self):
self.udp.send_message(self.wifi_command_lineEdit_1.text())
diff --git a/python_gui/gui/main.spec b/python_gui/gui/main.spec
new file mode 100644
index 0000000..e4d473f
--- /dev/null
+++ b/python_gui/gui/main.spec
@@ -0,0 +1,44 @@
+# -*- mode: python ; coding: utf-8 -*-
+
+
+block_cipher = None
+
+
+a = Analysis(['main.py'],
+ pathex=[],
+ binaries=[],
+ datas=[],
+ hiddenimports=[],
+ hookspath=[],
+ hooksconfig={},
+ runtime_hooks=[],
+ excludes=[],
+ win_no_prefer_redirects=False,
+ win_private_assemblies=False,
+ cipher=block_cipher,
+ noarchive=False)
+pyz = PYZ(a.pure, a.zipped_data,
+ cipher=block_cipher)
+
+exe = EXE(pyz,
+ a.scripts,
+ [],
+ exclude_binaries=True,
+ name='main',
+ debug=False,
+ bootloader_ignore_signals=False,
+ strip=False,
+ upx=True,
+ console=True,
+ disable_windowed_traceback=False,
+ target_arch=None,
+ codesign_identity=None,
+ entitlements_file=None )
+coll = COLLECT(exe,
+ a.binaries,
+ a.zipfiles,
+ a.datas,
+ strip=False,
+ upx=True,
+ upx_exclude=[],
+ name='main')
diff --git a/python_gui/gui/main_ui.py b/python_gui/gui/main_ui.py
index 5929b95..7717c17 100644
--- a/python_gui/gui/main_ui.py
+++ b/python_gui/gui/main_ui.py
@@ -14,7 +14,7 @@ from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName("MainWindow")
- MainWindow.resize(1187, 707)
+ MainWindow.resize(1129, 767)
self.centralwidget = QtWidgets.QWidget(MainWindow)
self.centralwidget.setObjectName("centralwidget")
self.groupBox = QtWidgets.QGroupBox(self.centralwidget)
@@ -66,39 +66,39 @@ class Ui_MainWindow(object):
self.horizontalLayoutWidget_7 = QtWidgets.QWidget(self.groupBox_3)
self.horizontalLayoutWidget_7.setGeometry(QtCore.QRect(10, 30, 271, 31))
self.horizontalLayoutWidget_7.setObjectName("horizontalLayoutWidget_7")
- self.horizontalLayout_3 = QtWidgets.QHBoxLayout(self.horizontalLayoutWidget_7)
- self.horizontalLayout_3.setContentsMargins(0, 0, 0, 0)
- self.horizontalLayout_3.setObjectName("horizontalLayout_3")
+ self.horizontalLayout_1 = QtWidgets.QHBoxLayout(self.horizontalLayoutWidget_7)
+ self.horizontalLayout_1.setContentsMargins(0, 0, 0, 0)
+ self.horizontalLayout_1.setObjectName("horizontalLayout_1")
self.wifi_command_lineEdit_1 = QtWidgets.QLineEdit(self.horizontalLayoutWidget_7)
self.wifi_command_lineEdit_1.setObjectName("wifi_command_lineEdit_1")
- self.horizontalLayout_3.addWidget(self.wifi_command_lineEdit_1)
+ self.horizontalLayout_1.addWidget(self.wifi_command_lineEdit_1)
self.wifi_command_pushButton_1 = QtWidgets.QPushButton(self.horizontalLayoutWidget_7)
self.wifi_command_pushButton_1.setObjectName("wifi_command_pushButton_1")
- self.horizontalLayout_3.addWidget(self.wifi_command_pushButton_1)
+ self.horizontalLayout_1.addWidget(self.wifi_command_pushButton_1)
self.horizontalLayoutWidget_8 = QtWidgets.QWidget(self.groupBox_3)
self.horizontalLayoutWidget_8.setGeometry(QtCore.QRect(10, 60, 271, 31))
self.horizontalLayoutWidget_8.setObjectName("horizontalLayoutWidget_8")
- self.horizontalLayout_4 = QtWidgets.QHBoxLayout(self.horizontalLayoutWidget_8)
- self.horizontalLayout_4.setContentsMargins(0, 0, 0, 0)
- self.horizontalLayout_4.setObjectName("horizontalLayout_4")
+ self.horizontalLayout_2 = QtWidgets.QHBoxLayout(self.horizontalLayoutWidget_8)
+ self.horizontalLayout_2.setContentsMargins(0, 0, 0, 0)
+ self.horizontalLayout_2.setObjectName("horizontalLayout_2")
self.wifi_command_lineEdit_2 = QtWidgets.QLineEdit(self.horizontalLayoutWidget_8)
self.wifi_command_lineEdit_2.setObjectName("wifi_command_lineEdit_2")
- self.horizontalLayout_4.addWidget(self.wifi_command_lineEdit_2)
+ self.horizontalLayout_2.addWidget(self.wifi_command_lineEdit_2)
self.wifi_command_pushButton_2 = QtWidgets.QPushButton(self.horizontalLayoutWidget_8)
self.wifi_command_pushButton_2.setObjectName("wifi_command_pushButton_2")
- self.horizontalLayout_4.addWidget(self.wifi_command_pushButton_2)
+ self.horizontalLayout_2.addWidget(self.wifi_command_pushButton_2)
self.horizontalLayoutWidget_9 = QtWidgets.QWidget(self.groupBox_3)
self.horizontalLayoutWidget_9.setGeometry(QtCore.QRect(10, 90, 271, 31))
self.horizontalLayoutWidget_9.setObjectName("horizontalLayoutWidget_9")
- self.horizontalLayout_7 = QtWidgets.QHBoxLayout(self.horizontalLayoutWidget_9)
- self.horizontalLayout_7.setContentsMargins(0, 0, 0, 0)
- self.horizontalLayout_7.setObjectName("horizontalLayout_7")
+ self.horizontalLayout_3 = QtWidgets.QHBoxLayout(self.horizontalLayoutWidget_9)
+ self.horizontalLayout_3.setContentsMargins(0, 0, 0, 0)
+ self.horizontalLayout_3.setObjectName("horizontalLayout_3")
self.wifi_command_lineEdit_3 = QtWidgets.QLineEdit(self.horizontalLayoutWidget_9)
self.wifi_command_lineEdit_3.setObjectName("wifi_command_lineEdit_3")
- self.horizontalLayout_7.addWidget(self.wifi_command_lineEdit_3)
+ self.horizontalLayout_3.addWidget(self.wifi_command_lineEdit_3)
self.wifi_command_pushButton_3 = QtWidgets.QPushButton(self.horizontalLayoutWidget_9)
self.wifi_command_pushButton_3.setObjectName("wifi_command_pushButton_3")
- self.horizontalLayout_7.addWidget(self.wifi_command_pushButton_3)
+ self.horizontalLayout_3.addWidget(self.wifi_command_pushButton_3)
self.horizontalLayoutWidget_13 = QtWidgets.QWidget(self.groupBox_3)
self.horizontalLayoutWidget_13.setGeometry(QtCore.QRect(10, 160, 271, 31))
self.horizontalLayoutWidget_13.setObjectName("horizontalLayoutWidget_13")
@@ -222,17 +222,17 @@ class Ui_MainWindow(object):
self.VI2_pushButton.setObjectName("VI2_pushButton")
self.horizontalLayout_22.addWidget(self.VI2_pushButton)
self.groupBox_4 = QtWidgets.QGroupBox(self.centralwidget)
- self.groupBox_4.setGeometry(QtCore.QRect(310, 500, 591, 131))
+ self.groupBox_4.setGeometry(QtCore.QRect(310, 500, 591, 121))
self.groupBox_4.setObjectName("groupBox_4")
self.horizontalLayoutWidget_2 = QtWidgets.QWidget(self.groupBox_4)
self.horizontalLayoutWidget_2.setGeometry(QtCore.QRect(10, 20, 571, 31))
self.horizontalLayoutWidget_2.setObjectName("horizontalLayoutWidget_2")
- self.horizontalLayout_2 = QtWidgets.QHBoxLayout(self.horizontalLayoutWidget_2)
- self.horizontalLayout_2.setContentsMargins(0, 0, 0, 0)
- self.horizontalLayout_2.setObjectName("horizontalLayout_2")
+ self.horizontalLayout_4 = QtWidgets.QHBoxLayout(self.horizontalLayoutWidget_2)
+ self.horizontalLayout_4.setContentsMargins(0, 0, 0, 0)
+ self.horizontalLayout_4.setObjectName("horizontalLayout_4")
self.left_lineEdit_1 = QtWidgets.QLineEdit(self.horizontalLayoutWidget_2)
self.left_lineEdit_1.setObjectName("left_lineEdit_1")
- self.horizontalLayout_2.addWidget(self.left_lineEdit_1)
+ self.horizontalLayout_4.addWidget(self.left_lineEdit_1)
self.horizontalSlider_1 = QtWidgets.QSlider(self.horizontalLayoutWidget_2)
self.horizontalSlider_1.setMinimum(-100)
self.horizontalSlider_1.setMaximum(100)
@@ -240,29 +240,29 @@ class Ui_MainWindow(object):
self.horizontalSlider_1.setTickPosition(QtWidgets.QSlider.TicksAbove)
self.horizontalSlider_1.setTickInterval(10)
self.horizontalSlider_1.setObjectName("horizontalSlider_1")
- self.horizontalLayout_2.addWidget(self.horizontalSlider_1)
+ self.horizontalLayout_4.addWidget(self.horizontalSlider_1)
self.right_lineEdit_1 = QtWidgets.QLineEdit(self.horizontalLayoutWidget_2)
self.right_lineEdit_1.setObjectName("right_lineEdit_1")
- self.horizontalLayout_2.addWidget(self.right_lineEdit_1)
+ self.horizontalLayout_4.addWidget(self.right_lineEdit_1)
self.label = QtWidgets.QLabel(self.horizontalLayoutWidget_2)
self.label.setObjectName("label")
- self.horizontalLayout_2.addWidget(self.label)
+ self.horizontalLayout_4.addWidget(self.label)
self.command_lineEdit_1 = QtWidgets.QLineEdit(self.horizontalLayoutWidget_2)
self.command_lineEdit_1.setObjectName("command_lineEdit_1")
- self.horizontalLayout_2.addWidget(self.command_lineEdit_1)
+ self.horizontalLayout_4.addWidget(self.command_lineEdit_1)
self.label_4 = QtWidgets.QLabel(self.horizontalLayoutWidget_2)
self.label_4.setObjectName("label_4")
- self.horizontalLayout_2.addWidget(self.label_4)
+ self.horizontalLayout_4.addWidget(self.label_4)
self.num_lineEdit_1 = QtWidgets.QLineEdit(self.horizontalLayoutWidget_2)
self.num_lineEdit_1.setObjectName("num_lineEdit_1")
- self.horizontalLayout_2.addWidget(self.num_lineEdit_1)
- self.horizontalLayout_2.setStretch(0, 1)
- self.horizontalLayout_2.setStretch(1, 18)
- self.horizontalLayout_2.setStretch(2, 1)
- self.horizontalLayout_2.setStretch(3, 1)
- self.horizontalLayout_2.setStretch(4, 1)
- self.horizontalLayout_2.setStretch(5, 1)
- self.horizontalLayout_2.setStretch(6, 1)
+ self.horizontalLayout_4.addWidget(self.num_lineEdit_1)
+ self.horizontalLayout_4.setStretch(0, 1)
+ self.horizontalLayout_4.setStretch(1, 18)
+ self.horizontalLayout_4.setStretch(2, 1)
+ self.horizontalLayout_4.setStretch(3, 1)
+ self.horizontalLayout_4.setStretch(4, 1)
+ self.horizontalLayout_4.setStretch(5, 1)
+ self.horizontalLayout_4.setStretch(6, 1)
self.horizontalLayoutWidget_3 = QtWidgets.QWidget(self.groupBox_4)
self.horizontalLayoutWidget_3.setGeometry(QtCore.QRect(10, 50, 571, 31))
self.horizontalLayoutWidget_3.setObjectName("horizontalLayoutWidget_3")
@@ -341,9 +341,96 @@ class Ui_MainWindow(object):
self.horizontalLayout_6.setStretch(4, 1)
self.horizontalLayout_6.setStretch(5, 1)
self.horizontalLayout_6.setStretch(6, 1)
+ self.groupBox_5 = QtWidgets.QGroupBox(self.centralwidget)
+ self.groupBox_5.setGeometry(QtCore.QRect(10, 620, 791, 91))
+ self.groupBox_5.setObjectName("groupBox_5")
+ self.horizontalLayoutWidget_11 = QtWidgets.QWidget(self.groupBox_5)
+ self.horizontalLayoutWidget_11.setGeometry(QtCore.QRect(110, 50, 671, 31))
+ self.horizontalLayoutWidget_11.setObjectName("horizontalLayoutWidget_11")
+ self.horizontalLayout_8 = QtWidgets.QHBoxLayout(self.horizontalLayoutWidget_11)
+ self.horizontalLayout_8.setContentsMargins(0, 0, 0, 0)
+ self.horizontalLayout_8.setObjectName("horizontalLayout_8")
+ self.left_lineEdit_5 = QtWidgets.QLineEdit(self.horizontalLayoutWidget_11)
+ self.left_lineEdit_5.setObjectName("left_lineEdit_5")
+ self.horizontalLayout_8.addWidget(self.left_lineEdit_5)
+ self.horizontalSlider_5 = QtWidgets.QSlider(self.horizontalLayoutWidget_11)
+ self.horizontalSlider_5.setMinimum(-100)
+ self.horizontalSlider_5.setMaximum(100)
+ self.horizontalSlider_5.setOrientation(QtCore.Qt.Horizontal)
+ self.horizontalSlider_5.setTickPosition(QtWidgets.QSlider.TicksAbove)
+ self.horizontalSlider_5.setTickInterval(10)
+ self.horizontalSlider_5.setObjectName("horizontalSlider_5")
+ self.horizontalLayout_8.addWidget(self.horizontalSlider_5)
+ self.right_lineEdit_5 = QtWidgets.QLineEdit(self.horizontalLayoutWidget_11)
+ self.right_lineEdit_5.setObjectName("right_lineEdit_5")
+ self.horizontalLayout_8.addWidget(self.right_lineEdit_5)
+ self.label_3 = QtWidgets.QLabel(self.horizontalLayoutWidget_11)
+ self.label_3.setObjectName("label_3")
+ self.horizontalLayout_8.addWidget(self.label_3)
+ self.command_lineEdit_5 = QtWidgets.QLineEdit(self.horizontalLayoutWidget_11)
+ self.command_lineEdit_5.setObjectName("command_lineEdit_5")
+ self.horizontalLayout_8.addWidget(self.command_lineEdit_5)
+ self.label_10 = QtWidgets.QLabel(self.horizontalLayoutWidget_11)
+ self.label_10.setObjectName("label_10")
+ self.horizontalLayout_8.addWidget(self.label_10)
+ self.num_lineEdit_5 = QtWidgets.QLineEdit(self.horizontalLayoutWidget_11)
+ self.num_lineEdit_5.setObjectName("num_lineEdit_5")
+ self.horizontalLayout_8.addWidget(self.num_lineEdit_5)
+ self.horizontalLayout_8.setStretch(0, 1)
+ self.horizontalLayout_8.setStretch(1, 15)
+ self.horizontalLayout_8.setStretch(2, 1)
+ self.horizontalLayout_8.setStretch(3, 1)
+ self.horizontalLayout_8.setStretch(4, 1)
+ self.horizontalLayout_8.setStretch(5, 1)
+ self.horizontalLayout_8.setStretch(6, 1)
+ self.test_pushButton_velocity = QtWidgets.QPushButton(self.groupBox_5)
+ self.test_pushButton_velocity.setGeometry(QtCore.QRect(10, 20, 99, 28))
+ self.test_pushButton_velocity.setObjectName("test_pushButton_velocity")
+ self.test_pushButton_voltage = QtWidgets.QPushButton(self.groupBox_5)
+ self.test_pushButton_voltage.setGeometry(QtCore.QRect(10, 50, 99, 28))
+ self.test_pushButton_voltage.setObjectName("test_pushButton_voltage")
+ self.horizontalLayoutWidget_10 = QtWidgets.QWidget(self.groupBox_5)
+ self.horizontalLayoutWidget_10.setGeometry(QtCore.QRect(110, 20, 671, 31))
+ self.horizontalLayoutWidget_10.setObjectName("horizontalLayoutWidget_10")
+ self.horizontalLayout_7 = QtWidgets.QHBoxLayout(self.horizontalLayoutWidget_10)
+ self.horizontalLayout_7.setContentsMargins(0, 0, 0, 0)
+ self.horizontalLayout_7.setObjectName("horizontalLayout_7")
+ self.left_lineEdit_4 = QtWidgets.QLineEdit(self.horizontalLayoutWidget_10)
+ self.left_lineEdit_4.setObjectName("left_lineEdit_4")
+ self.horizontalLayout_7.addWidget(self.left_lineEdit_4)
+ self.horizontalSlider_4 = QtWidgets.QSlider(self.horizontalLayoutWidget_10)
+ self.horizontalSlider_4.setMinimum(-100)
+ self.horizontalSlider_4.setMaximum(100)
+ self.horizontalSlider_4.setOrientation(QtCore.Qt.Horizontal)
+ self.horizontalSlider_4.setTickPosition(QtWidgets.QSlider.TicksAbove)
+ self.horizontalSlider_4.setTickInterval(10)
+ self.horizontalSlider_4.setObjectName("horizontalSlider_4")
+ self.horizontalLayout_7.addWidget(self.horizontalSlider_4)
+ self.right_lineEdit_4 = QtWidgets.QLineEdit(self.horizontalLayoutWidget_10)
+ self.right_lineEdit_4.setObjectName("right_lineEdit_4")
+ self.horizontalLayout_7.addWidget(self.right_lineEdit_4)
+ self.label_2 = QtWidgets.QLabel(self.horizontalLayoutWidget_10)
+ self.label_2.setObjectName("label_2")
+ self.horizontalLayout_7.addWidget(self.label_2)
+ self.command_lineEdit_4 = QtWidgets.QLineEdit(self.horizontalLayoutWidget_10)
+ self.command_lineEdit_4.setObjectName("command_lineEdit_4")
+ self.horizontalLayout_7.addWidget(self.command_lineEdit_4)
+ self.label_9 = QtWidgets.QLabel(self.horizontalLayoutWidget_10)
+ self.label_9.setObjectName("label_9")
+ self.horizontalLayout_7.addWidget(self.label_9)
+ self.num_lineEdit_4 = QtWidgets.QLineEdit(self.horizontalLayoutWidget_10)
+ self.num_lineEdit_4.setObjectName("num_lineEdit_4")
+ self.horizontalLayout_7.addWidget(self.num_lineEdit_4)
+ self.horizontalLayout_7.setStretch(0, 1)
+ self.horizontalLayout_7.setStretch(1, 15)
+ self.horizontalLayout_7.setStretch(2, 1)
+ self.horizontalLayout_7.setStretch(3, 1)
+ self.horizontalLayout_7.setStretch(4, 1)
+ self.horizontalLayout_7.setStretch(5, 1)
+ self.horizontalLayout_7.setStretch(6, 1)
MainWindow.setCentralWidget(self.centralwidget)
self.menubar = QtWidgets.QMenuBar(MainWindow)
- self.menubar.setGeometry(QtCore.QRect(0, 0, 1187, 26))
+ self.menubar.setGeometry(QtCore.QRect(0, 0, 1129, 26))
self.menubar.setObjectName("menubar")
MainWindow.setMenuBar(self.menubar)
self.statusbar = QtWidgets.QStatusBar(MainWindow)
@@ -399,3 +486,18 @@ class Ui_MainWindow(object):
self.command_lineEdit_3.setText(_translate("MainWindow", "K33"))
self.label_8.setText(_translate("MainWindow", "num:"))
self.num_lineEdit_3.setText(_translate("MainWindow", "0"))
+ self.groupBox_5.setTitle(_translate("MainWindow", "测试模式"))
+ self.left_lineEdit_5.setText(_translate("MainWindow", "-12"))
+ self.right_lineEdit_5.setText(_translate("MainWindow", "12"))
+ self.label_3.setText(_translate("MainWindow", "command:"))
+ self.command_lineEdit_5.setText(_translate("MainWindow", "VQ"))
+ self.label_10.setText(_translate("MainWindow", "num:"))
+ self.num_lineEdit_5.setText(_translate("MainWindow", "0"))
+ self.test_pushButton_velocity.setText(_translate("MainWindow", "速度测试打开"))
+ self.test_pushButton_voltage.setText(_translate("MainWindow", "电压测试打开"))
+ self.left_lineEdit_4.setText(_translate("MainWindow", "-100"))
+ self.right_lineEdit_4.setText(_translate("MainWindow", "100"))
+ self.label_2.setText(_translate("MainWindow", "command:"))
+ self.command_lineEdit_4.setText(_translate("MainWindow", "VV"))
+ self.label_9.setText(_translate("MainWindow", "num:"))
+ self.num_lineEdit_4.setText(_translate("MainWindow", "0"))
diff --git a/python_gui/gui/main_ui.ui b/python_gui/gui/main_ui.ui
index ed57e99..0058387 100644
--- a/python_gui/gui/main_ui.ui
+++ b/python_gui/gui/main_ui.ui
@@ -6,8 +6,8 @@
0
0
- 1187
- 707
+ 1129
+ 767
@@ -138,7 +138,7 @@
31
-
+
-
@@ -160,7 +160,7 @@
31
-
+
-
@@ -182,7 +182,7 @@
31
-
+
-
@@ -463,7 +463,7 @@
310
500
591
- 131
+ 121
@@ -478,7 +478,7 @@
31
-
+
-
@@ -689,13 +689,198 @@
+
+
+
+ 10
+ 620
+ 791
+ 91
+
+
+
+ 测试模式
+
+
+
+
+ 110
+ 50
+ 671
+ 31
+
+
+
+ -
+
+
+ -12
+
+
+
+ -
+
+
+ -100
+
+
+ 100
+
+
+ Qt::Horizontal
+
+
+ QSlider::TicksAbove
+
+
+ 10
+
+
+
+ -
+
+
+ 12
+
+
+
+ -
+
+
+ command:
+
+
+
+ -
+
+
+ VQ
+
+
+
+ -
+
+
+ num:
+
+
+
+ -
+
+
+ 0
+
+
+
+
+
+
+
+
+ 10
+ 20
+ 99
+ 28
+
+
+
+ 速度测试打开
+
+
+
+
+
+ 10
+ 50
+ 99
+ 28
+
+
+
+ 电压测试打开
+
+
+
+
+
+ 110
+ 20
+ 671
+ 31
+
+
+
+ -
+
+
+ -100
+
+
+
+ -
+
+
+ -100
+
+
+ 100
+
+
+ Qt::Horizontal
+
+
+ QSlider::TicksAbove
+
+
+ 10
+
+
+
+ -
+
+
+ 100
+
+
+
+ -
+
+
+ command:
+
+
+
+ -
+
+
+ VV
+
+
+
+ -
+
+
+ num:
+
+
+
+ -
+
+
+ 0
+
+
+
+
+
+