耐久场景测试,将采集规则由固定时间间隔,修改为固定运动动作周期

This commit is contained in:
fanmingfu 2025-03-11 15:16:47 +08:00
parent 0fb4e43482
commit 62200a9fe4
9 changed files with 69 additions and 27 deletions

View File

@ -386,7 +386,7 @@
<c name="addr_2nd" type="2" value="0"/> <c name="addr_2nd" type="2" value="0"/>
<c name="bit_bias" type="2" value="0"/> <c name="bit_bias" type="2" value="0"/>
<c name="byte_bias" type="4" value="0"/> <c name="byte_bias" type="4" value="0"/>
<c name="description" type="10" value="pc to robot告诉 xCore 可以开始运行了"/> <c name="description" type="10" value=""/>
<c name="dev_name" type="10" value="autotest"/> <c name="dev_name" type="10" value="autotest"/>
<c name="dev_type" type="10" value="MODBUS"/> <c name="dev_type" type="10" value="MODBUS"/>
<c name="end_addr" type="2" value="40100"/> <c name="end_addr" type="2" value="40100"/>
@ -397,7 +397,7 @@
<c name="rw" type="10" value="rd"/> <c name="rw" type="10" value="rd"/>
<c name="type" type="10" value="bool"/> <c name="type" type="10" value="bool"/>
<c name="value"/> <c name="value"/>
<c name="value_single" type="10" value="true"/> <c name="value_single" type="10" value="false"/>
<c name="bias" type="2" value="0"/> <c name="bias" type="2" value="0"/>
</l> </l>
<l> <l>
@ -457,7 +457,7 @@
<c name="rw" type="10" value="rdwr"/> <c name="rw" type="10" value="rdwr"/>
<c name="type" type="10" value="bool"/> <c name="type" type="10" value="bool"/>
<c name="value"/> <c name="value"/>
<c name="value_single" type="10" value="false"/> <c name="value_single" type="10" value="true"/>
<c name="bias" type="2" value="0"/> <c name="bias" type="2" value="0"/>
</l> </l>
<l> <l>
@ -786,7 +786,7 @@
<c name="addr_2nd" type="2" value="0"/> <c name="addr_2nd" type="2" value="0"/>
<c name="bit_bias" type="2" value="0"/> <c name="bit_bias" type="2" value="0"/>
<c name="byte_bias" type="4" value="0"/> <c name="byte_bias" type="4" value="0"/>
<c name="description" type="10" value="robot to pc表示 xCore 已经准备好开始运动了"/> <c name="description" type="10" value=""/>
<c name="dev_name" type="10" value="autotest"/> <c name="dev_name" type="10" value="autotest"/>
<c name="dev_type" type="10" value="MODBUS"/> <c name="dev_type" type="10" value="MODBUS"/>
<c name="end_addr" type="2" value="40600"/> <c name="end_addr" type="2" value="40600"/>
@ -806,7 +806,7 @@
<c name="addr_2nd" type="2" value="0"/> <c name="addr_2nd" type="2" value="0"/>
<c name="bit_bias" type="2" value="0"/> <c name="bit_bias" type="2" value="0"/>
<c name="byte_bias" type="4" value="0"/> <c name="byte_bias" type="4" value="0"/>
<c name="description" type="10" value="robot to pc场景时间"/> <c name="description" type="10" value=""/>
<c name="dev_name" type="10" value="autotest"/> <c name="dev_name" type="10" value="autotest"/>
<c name="dev_type" type="10" value="MODBUS"/> <c name="dev_type" type="10" value="MODBUS"/>
<c name="end_addr" type="2" value="40602"/> <c name="end_addr" type="2" value="40602"/>
@ -817,7 +817,26 @@
<c name="rw" type="10" value="rdwr"/> <c name="rw" type="10" value="rdwr"/>
<c name="type" type="10" value="float"/> <c name="type" type="10" value="float"/>
<c name="value"/> <c name="value"/>
<c name="value_single" type="10" value="35.047000885009766"/> <c name="value_single" type="10" value="0"/>
<c name="bias" type="2" value="0"/> <c name="bias" type="2" value="0"/>
</l> </l>
<l>
<c name="addr" type="2" value="40603"/>
<c name="addr_1st" type="2" value="0"/>
<c name="addr_2nd" type="2" value="0"/>
<c name="bit_bias" type="2" value="0"/>
<c name="byte_bias" type="4" value="0"/>
<c name="description" type="10" value=""/>
<c name="dev_name" type="10" value="autotest"/>
<c name="dev_type" type="10" value="MODBUS"/>
<c name="end_addr" type="2" value="40603"/>
<c name="function" type="10" value=""/>
<c name="len" type="2" value="1"/>
<c name="name" type="10" value="capture_start"/>
<c name="retain" type="1" value="false"/>
<c name="rw" type="10" value="rdwr"/>
<c name="type" type="10" value="bool"/>
<c name="value"/>
<c name="value_single" type="10" value="false"/>
</l>
</m> </m>

View File

@ -6,8 +6,8 @@ VSVersionInfo(
ffi=FixedFileInfo( ffi=FixedFileInfo(
# filevers and prodvers should be always a tuple with four items: (1, 2, 3, 4) # filevers and prodvers should be always a tuple with four items: (1, 2, 3, 4)
# Set not needed items to zero 0. # Set not needed items to zero 0.
filevers=(0, 3, 1, 5), filevers=(0, 3, 1, 6),
prodvers=(0, 3, 1, 5), prodvers=(0, 3, 1, 6),
# Contains a bitmask that specifies the valid bits 'flags'r # Contains a bitmask that specifies the valid bits 'flags'r
mask=0x3f, mask=0x3f,
# Contains a bitmask that specifies the Boolean attributes of the file. # Contains a bitmask that specifies the Boolean attributes of the file.
@ -31,12 +31,12 @@ VSVersionInfo(
'040904b0', '040904b0',
[StringStruct('CompanyName', 'Rokae - https://www.rokae.com/'), [StringStruct('CompanyName', 'Rokae - https://www.rokae.com/'),
StringStruct('FileDescription', 'All in one automatic toolbox'), StringStruct('FileDescription', 'All in one automatic toolbox'),
StringStruct('FileVersion', '0.3.1.5 (2025-03-10)'), StringStruct('FileVersion', '0.3.1.6 (2025-03-21)'),
StringStruct('InternalName', 'AIO.exe'), StringStruct('InternalName', 'AIO.exe'),
StringStruct('LegalCopyright', '© 2024-2025 Manford Fan'), StringStruct('LegalCopyright', '© 2024-2025 Manford Fan'),
StringStruct('OriginalFilename', 'AIO.exe'), StringStruct('OriginalFilename', 'AIO.exe'),
StringStruct('ProductName', 'AIO'), StringStruct('ProductName', 'AIO'),
StringStruct('ProductVersion', '0.3.1.5 (2025-03-10)')]) StringStruct('ProductVersion', '0.3.1.6 (2025-03-21)')])
]), ]),
VarFileInfo([VarStruct('Translation', [1033, 1200])]) VarFileInfo([VarStruct('Translation', [1033, 1200])])
] ]

View File

@ -480,4 +480,11 @@ v0.3.1.3(2025/02/12)
1. 修改自动测试(制动)的打开关闭曲线逻辑,开始时打开,完整测试结束时关闭 1. 修改自动测试(制动)的打开关闭曲线逻辑,开始时打开,完整测试结束时关闭
v0.3.1.3(2025/02/13) v0.3.1.3(2025/02/13)
1. 修改自动测试电机电流的数据处理方法从以前的Multiprocessing->threading因为Intel CPU遇到Multiprocessing会重新打开一个AIO实例 1. 修改自动测试电机电流的数据处理方法从以前的Multiprocessing->threading因为Intel CPU遇到Multiprocessing会重新打开一个AIO实例
v0.3.1.5(2025/03/10)
1. 因公司网络环境调整修改服务器校验IP
v0.3.1.6(2025/03/21)
1. 调整耐久(场景)测试工程,以及相应的数据采集逻辑,将采集规则由固定时间间隔,修改为固定运动动作周期
> Tips工程以及寄存器文件均有变动

View File

@ -1 +1 @@
0.3.1.5@03/10/2025 0.3.1.6@03/21/2025

View File

@ -37,7 +37,7 @@ class App:
self.label_pages_logs = ctk.StringVar() self.label_pages_logs = ctk.StringVar()
self.label_pages_logs.set("-.-.-.-.-.-") self.label_pages_logs.set("-.-.-.-.-.-")
self.entry_tips_v = None self.entry_tips_v = None
self.server_vers = None self.server_vers = ""
self.tv_cols = {1: ["ID", 1], 2: ["time", 160], 3: ["level", 25], 4: ["module", 30], 5: ["content", 700]} self.tv_cols = {1: ["ID", 1], 2: ["time", 160], 3: ["level", 25], 4: ["module", 30], 5: ["content", 700]}
self.chk_box_v = ctk.BooleanVar() self.chk_box_v = ctk.BooleanVar()
self.chk_box_v.set(False) self.chk_box_v.set(False)
@ -143,12 +143,14 @@ class App:
self.label_tips = ctk.CTkLabel(self.frame_status, textvariable=var_tips, compound="left", bg_color="#C9C9C9", font=self.f_status, anchor="e") self.label_tips = ctk.CTkLabel(self.frame_status, textvariable=var_tips, compound="left", bg_color="#C9C9C9", font=self.f_status, anchor="e")
self.__auth_and_vercheck() self.__auth_and_vercheck()
if local_vers == self.server_vers: if local_vers == self.server_vers:
# if True:
image = ctk.CTkImage(Image.open(f"{clibs.PREFIX}/media/updated.png"), size=(16, 16)) image = ctk.CTkImage(Image.open(f"{clibs.PREFIX}/media/updated.png"), size=(16, 16))
var_tips.set(" 当前是最新版本,继续保持! ") var_tips.set(" 当前是最新版本,继续保持! ")
self.label_tips.configure(text_color="#0D8A3D", image=image) self.label_tips.configure(text_color="#0D8A3D", image=image)
else: elif local_vers > self.server_vers:
if self.server_vers is None: pass
elif local_vers < self.server_vers:
if self.server_vers == "":
messagebox.showerror(title="错误", message=f"服务器版本校验失败,退出...")
return return
image = ctk.CTkImage(Image.open(f"{clibs.PREFIX}/media/upgrade.png"), size=(16, 16)) image = ctk.CTkImage(Image.open(f"{clibs.PREFIX}/media/upgrade.png"), size=(16, 16))
var_tips.set(f" {self.server_vers.split('@')[0]}已经发布,尽快更新至最新版本! ") var_tips.set(f" {self.server_vers.split('@')[0]}已经发布,尽快更新至最新版本! ")

View File

@ -314,7 +314,7 @@ class ModbusRequest(object):
result = self.__c.convert_from_registers(registers=results.registers, data_type=self.__c.DATATYPE.FLOAT32, word_order="little") result = self.__c.convert_from_registers(registers=results.registers, data_type=self.__c.DATATYPE.FLOAT32, word_order="little")
return result return result
def read_brake_done(self): def read_capture_start(self):
result = self.__c.read_holding_registers(40603, count=1) result = self.__c.read_holding_registers(40603, count=1)
return result.registers[0] return result.registers[0]

View File

@ -4,7 +4,6 @@ import time
import pandas import pandas
import math import math
import csv import csv
import numpy
from common import clibs from common import clibs
@ -122,12 +121,12 @@ def run_rl(path, params, curves, hr, md, w2t):
while True: while True:
scenario_time = float(f"{float(md.read_scenario_time()):.2f}") scenario_time = float(f"{float(md.read_scenario_time()):.2f}")
if scenario_time != 0: if scenario_time != 0:
w2t(f"耐久工程的周期时间:{scenario_time}s | 单轮次执行时间:{scenario_time+interval}\n") w2t(f"耐久工程的周期时间:{scenario_time}s | 单轮次执行时间:{scenario_time+interval}~{scenario_time*2+interval}\n")
break break
else: else:
time.sleep(1) time.sleep(1)
if (time.time() - t_start) > 300: if (time.time() - t_start) > 900:
w2t(f"300s 内未收到耐久工程的周期时间需要确认RL程序和工具通信交互是否正常执行...\n", "red", "GetScenarioTimeError") w2t(f"900s 内未收到耐久工程的周期时间需要确认RL程序和工具通信交互是否正常执行...\n", "red", "GetScenarioTimeError")
# 6. 准备数据保存文件 # 6. 准备数据保存文件
for curve in curves: for curve in curves:
@ -141,11 +140,19 @@ def run_rl(path, params, curves, hr, md, w2t):
count = 0 count = 0
while clibs.running: while clibs.running:
this_time = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(time.time())) this_time = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(time.time()))
next_time = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(time.time()+scenario_time+interval+1)) next_time_1 = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(time.time()+scenario_time+interval+1))
w2t(f"[{this_time}] 当前次数:{count:09d} | 预计下次数据更新时间:{next_time}\n", "#008B8B") next_time_2 = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(time.time()+scenario_time+interval+1+scenario_time))
w2t(f"[{this_time}] 当前次数:{count:09d} | 预计下次数据更新时间:{next_time_1}~{next_time_2}\n", "#008B8B")
count += 1 count += 1
# 固定间隔,更新一次数据,打开曲线,获取周期内电流,关闭曲线 # 固定间隔,更新一次数据,打开曲线,获取周期内电流,关闭曲线
time.sleep(interval) time.sleep(interval)
while True:
capture_start = md.read_capture_start()
if capture_start == 1:
break
else:
time.sleep(0.1)
change_curve_state(hr, curves, True, True) change_curve_state(hr, curves, True, True)
time.sleep(scenario_time) time.sleep(scenario_time)
end_time = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(time.time())) end_time = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(time.time()))
@ -194,7 +201,7 @@ def proc_device_servo_trq_feedback(records, params, w2t):
for axis in range(6): for axis in range(6):
df = pandas.DataFrame.from_dict({"device_servo_trq_feedback": d_trq[axis]}) df = pandas.DataFrame.from_dict({"device_servo_trq_feedback": d_trq[axis]})
_ = math.sqrt(df.apply(lambda x: numpy.power((rcs[axis] * float(x.iloc[0]) / 1000), 2)).sum() / len(df)) _ = math.sqrt((df[df.columns[0]] * rcs[axis] / 1000).pow(2).sum() / len(df))
results.append(_) results.append(_)
path = "/".join(params["prj_file"].split("/")[:-1]) path = "/".join(params["prj_file"].split("/")[:-1])

View File

@ -60,7 +60,7 @@
- 原理:使用 xCore socket 协议获取诊断数据,包括速度,力矩等信息,结合 modbus 和外部通信执行急停等动作 - 原理:使用 xCore socket 协议获取诊断数据,包括速度,力矩等信息,结合 modbus 和外部通信执行急停等动作
- 必要条件: - 必要条件:
- RL 工程,参考 `assets/files/projects/`,需要详细阅读对应的注释 - RL 工程brake任务,参考 `assets/files/projects/`,需要详细阅读对应的注释
- 需要有一个配置文件,命名为 configs.xlsx - 需要有一个配置文件,命名为 configs.xlsx
- 需要有三个结果文件,命名为 reach33/66/100_xxxxxxxx.xlsx - 需要有三个结果文件,命名为 reach33/66/100_xxxxxxxx.xlsx
@ -68,9 +68,15 @@
- 原理:使用 xCore socket 协议获取诊断数据,包括速度,力矩等信息,结合 modbus 和外部通信执行急停等动作 - 原理:使用 xCore socket 协议获取诊断数据,包括速度,力矩等信息,结合 modbus 和外部通信执行急停等动作
- 必要条件: - 必要条件:
- RL 工程,参考 `assets/files/projects/`,需要详细阅读对应的注释 - RL 工程current任务,参考 `assets/files/projects/`,需要详细阅读对应的注释
- 需要有一个结果文件,命名为 T_电机电流.xlsx - 需要有一个结果文件,命名为 T_电机电流.xlsx
## 三、耐久测试数据采集
- 原理:根据设置的时间间隔,采集相应的场景周期指标数据
- 必要条件:
- RL 工程factory任务参考 `assets/files/projects/`,需要详细阅读对应的注释
## 三、注意事项 ## 三、注意事项
> **!!仅内网使用!!** > **!!仅内网使用!!**
@ -78,10 +84,11 @@
1. 仅适用于 xCore 2.3.0.7 及以上的版本 1. 仅适用于 xCore 2.3.0.7 及以上的版本
2. 仅适配了六轴工业/协作机型其他机型可能会存在使用上的问题具体可以找fanmingfu@rokae.com确认 2. 仅适配了六轴工业/协作机型其他机型可能会存在使用上的问题具体可以找fanmingfu@rokae.com确认
3. 单轴电机电流数据处理,至少需要三个完整周期,使用本工具采集一般不会有问题,主要是针对手动采集命名的数据 3. 单轴电机电流数据处理,至少需要三个完整周期,使用本工具采集一般不会有问题,主要是针对手动采集命名的数据
4. 执行制动测试/电机电流采集/耐久测试的时候,执行过程中停止,再次运行需要等待一分钟左右,输出框会有提示 4. 执行制动测试/电机电流采集/耐久测试的时候,执行过程中停止,需要重新关闭软件再次打开,才能正常使用
5. RL工程/寄存器文件/configs.xlsx文件已更新需要使用新版其他使用方法和之前工具一致 5. RL工程/寄存器文件/configs.xlsx文件已更新需要使用新版其他使用方法和之前工具一致
6. 基恩士采集数据时不同轮次每5次测试数据时间间隔最好大于 2 倍的周期时间,否则会出现采集的轮数不正确的情况,但数据是完整的 6. 基恩士采集数据时不同轮次每5次测试数据时间间隔最好大于 2 倍的周期时间,否则会出现采集的轮数不正确的情况,但数据是完整的
7. 激光数据处理只支持英文版本的数据文件 7. 激光数据处理只支持英文版本的数据文件
8. 耐久(场景)指标数据采集的工程运行周期需要小于 300s否则会出现异常
> **需要使用 assets/files/projects/ 下的工程,寄存器文件以及配置文件等!!!** > **需要使用 assets/files/projects/ 下的工程,寄存器文件以及配置文件等!!!**