v0.1.9.2(2024/07/13)

1. [APIs: do_current.py]
   - 删除多余的时序矫正语句——item['value'].reverse(),使输出的曲线为平滑的自然顺序
2. [current: current.py]
   - max功能计算逻辑矫正,应该是取绝对值的最大值
   - 整体梳理了trq/trqh的传递路径,现已修正完毕
This commit is contained in:
gitea 2024-07-13 15:40:13 +08:00
parent 718db9ec45
commit d35858e14e
3 changed files with 14 additions and 14 deletions

View File

@ -473,5 +473,9 @@ v0.1.9.2(2024/07/13)
- 调整单轴测试时间为35s适配大负载机型调整堵转电流持续时间15s适当减少测试时间 - 调整单轴测试时间为35s适配大负载机型调整堵转电流持续时间15s适当减少测试时间
- 将act信号置为False的动作放在初始化增加程序健壮性 - 将act信号置为False的动作放在初始化增加程序健壮性
- 修改所有输出文件的命名,在扩展名之前加入时间戳 - 修改所有输出文件的命名,在扩展名之前加入时间戳
3. [current: current.py]: 在find_point函数种当无法找到正确点位时继续执行而不是直接终止执行 - 删除多余的时序矫正语句——item['value'].reverse(),使输出的曲线为平滑的自然顺序
3. [current: current.py]
- 在find_point函数种当无法找到正确点位时继续执行而不是直接终止执行
- max功能计算逻辑矫正应该是取绝对值的最大值
- 整体梳理了trq/trqh的传递路径现已修正完毕

View File

@ -120,10 +120,8 @@ def data_proc_regular(path, filename, channel, scenario_time):
for item in data: for item in data:
item['value'].reverse() item['value'].reverse()
if item.get('channel', None) == channel and item.get('name', None) == 'hw_joint_vel_feedback': if item.get('channel', None) == channel and item.get('name', None) == 'hw_joint_vel_feedback':
item['value'].reverse()
_d2d_vel['hw_joint_vel_feedback'].extend(item['value']) _d2d_vel['hw_joint_vel_feedback'].extend(item['value'])
elif item.get('channel', None) == channel and item.get('name', None) == 'device_servo_trq_feedback': elif item.get('channel', None) == channel and item.get('name', None) == 'device_servo_trq_feedback':
item['value'].reverse()
_d2d_trq['device_servo_trq_feedback'].extend(item['value']) _d2d_trq['device_servo_trq_feedback'].extend(item['value'])
df1 = pandas.DataFrame.from_dict(_d2d_vel) df1 = pandas.DataFrame.from_dict(_d2d_vel)

View File

@ -79,7 +79,7 @@ def initialization(path, sub, w2t):
return data_files return data_files
def current_max(data_files, rcs, trqh, w2t): def current_max(data_files, rcs, trq, w2t):
current = {1: [], 2: [], 3: [], 4: [], 5: [], 6: [], 7: []} current = {1: [], 2: [], 3: [], 4: [], 5: [], 6: [], 7: []}
for data_file in data_files: for data_file in data_files:
if data_file.endswith('.data'): if data_file.endswith('.data'):
@ -93,8 +93,8 @@ def current_max(data_files, rcs, trqh, w2t):
axis = int(data_file.split('\\')[-1].split('_')[0].removeprefix('j')) axis = int(data_file.split('\\')[-1].split('_')[0].removeprefix('j'))
rca = rcs[axis-1] rca = rcs[axis-1]
col = df.columns.values[trqh-1] col = df.columns.values[trq-1]
c_max = df[col].max() c_max = df[col].abs().max()
scale = 1 if data_file.endswith('.csv') else 1000 scale = 1 if data_file.endswith('.csv') else 1000
_ = abs(c_max/scale*rca) _ = abs(c_max/scale*rca)
@ -118,7 +118,7 @@ def current_max(data_files, rcs, trqh, w2t):
return current return current
def current_avg(data_files, rcs, trqh, w2t): def current_avg(data_files, rcs, trq, w2t):
current = {1: [], 2: [], 3: [], 4: [], 5: [], 6: [], 7: []} current = {1: [], 2: [], 3: [], 4: [], 5: [], 6: [], 7: []}
for data_file in data_files: for data_file in data_files:
if data_file.endswith('.data'): if data_file.endswith('.data'):
@ -132,7 +132,7 @@ def current_avg(data_files, rcs, trqh, w2t):
axis = int(data_file.split('\\')[-1].split('_')[0].removeprefix('j')) axis = int(data_file.split('\\')[-1].split('_')[0].removeprefix('j'))
rca = rcs[axis-1] rca = rcs[axis-1]
col = df.columns.values[trqh - 1] col = df.columns.values[trq-1]
c_std = df[col].std() c_std = df[col].std()
c_avg = df[col].mean() c_avg = df[col].mean()
@ -223,8 +223,7 @@ def find_point(data_file, pos, flag, df, _row_s, _row_e, w2t, exitcode, threshol
else: else:
return _row_s, _row_e return _row_s, _row_e
else: else:
# w2t(f"[{pos}] {data_file}数据有误,需要检查,无法找到第{exitcode}个有效点...", 0, exitcode, 'red') w2t(f"[{pos}] {data_file}数据有误,需要检查,无法找到第{exitcode}个有效点...", 0, exitcode, 'red')
w2t(f"[{pos}] {data_file}数据有误,需要检查,无法找到第{exitcode}个有效点...", 0, 0, 'red')
elif flag == 'gt': elif flag == 'gt':
while _row_e > end_point: while _row_e > end_point:
speed_avg = df.iloc[_row_s:_row_e, 0].abs().mean() speed_avg = df.iloc[_row_s:_row_e, 0].abs().mean()
@ -235,8 +234,7 @@ def find_point(data_file, pos, flag, df, _row_s, _row_e, w2t, exitcode, threshol
else: else:
return _row_s, _row_e return _row_s, _row_e
else: else:
# w2t(f"[{pos}] {data_file}数据有误,需要检查,无法找到有效起始点或结束点...", 0, exitcode, 'red') w2t(f"[{pos}] {data_file}数据有误,需要检查,无法找到有效起始点或结束点...", 0, exitcode, 'red')
w2t(f"[{pos}] {data_file}数据有误,需要检查,无法找到有效起始点或结束点...", 0, 0, 'red')
def p_single(wb, single, vel, trq, rpms, w2t): def p_single(wb, single, vel, trq, rpms, w2t):
@ -395,9 +393,9 @@ def main(path, sub, dur, vel, trq, trqh, w2t):
data_files = initialization(path, sub, w2t) data_files = initialization(path, sub, w2t)
rpms, rcs = get_configs(path + '\\configs.xlsx', w2t) rpms, rcs = get_configs(path + '\\configs.xlsx', w2t)
if sub == 'max': if sub == 'max':
current_max(data_files, rcs, trqh, w2t) current_max(data_files, rcs, trq, w2t)
elif sub == 'avg': elif sub == 'avg':
current_avg(data_files, rcs, trqh, w2t) current_avg(data_files, rcs, trq, w2t)
elif sub == 'cycle': elif sub == 'cycle':
current_cycle(dur, data_files, rcs, vel, trq, trqh, rpms, w2t) current_cycle(dur, data_files, rcs, vel, trq, trqh, rpms, w2t)
else: else: