Appearance
电池顶盖平面度高度测量
工程背景
测量背景
随着新能源汽车、消费电子和其他依赖高效能电池系统的领域快速发展,对于电池组件的质量要求也日益提高。电池盖板作为电池结构中的关键部件之一,其平面度和高度的精确性直接关系到电池的安全性能、密封效果以及整体装配质量。任何微小的偏差都可能导致电池内部短路、泄漏等严重问题,进而影响产品的可靠性和用户安全。
因此,为了确保每一个出厂的电池都具备最高标准的质量,制造商需要引入一套精准且高效的电池盖板平面度和高度检测系统。该系统旨在通过自动化手段实现对电池盖板关键尺寸参数的严格监控,以保证产品的一致性和可靠性。
相机选型
深视SR7080
测量项
电池盖板表面平面度及正负极高度
解决方案
AI-Vision首先对点云图进行定位,接着确定电池表面基准面之后测量表面平面度,最后分别对正负极高度进行测量。
设计思路
执行效果展示
工程结果展示
- 检测结果
项目流程
一、初始化
[00] 使用加载点云工具
,加载需要处理的点云图。
[01] 使用Lua脚本工具
,初始化需要保存的csv文件的表头。
lua
--CSV文件名
local filename = "./Data.csv"
SetVariable("DataPath",filename)
-- 生成保存检测数据的csv文件
-- 表头
write = ""
if FileSize(filename) <= 0 then
write = write .. "Time,"
write = write .. "F1" .. ","
write = write .. "NPH1_Mean" .. ","
write = write .. "NPH2_Mean" .. ","
write = write .. "NPH3_Mean" .. ","
write = write .. "NPH4_Mean" .. ","
write = write .. "PPH1_Mean" .. ","
write = write .. "PPH2_Mean" .. ","
write = write .. "PPH3_Mean" .. ","
write = write .. "PPH4_Mean" .. ","
write = write .. "NPH_Max" .. ","
write = write .. "NPH_Min" .. ","
write = write .. "PPH_Max" .. ","
write = write .. "PPH_Min" .. ","
write = write .. "Height_N" .. ","
write = write .. "Height_R"
end
--将表头写入表格
fprint(filename, write.. "\n")
二、定位
[02] 使用3D方形探针工具
,找到电池点云下边直线。
[03] 使用3D方形探针工具
,找到电池点云左边直线。
[04] 使用3D几何交点工具
,根据上两个工具检测的直线,计算两直线交点。
[05] 使用3D位置调整工具
,调整定位到到两直线交点位置。
三、盖板平面度测量
[06-14] 使用3D区域工具
,选择拟合平面的区域。
[15] 使用3D平面工具
,根据上个工具选择的区域,拟合平面并将其设置为零平面。
[16] 使用3D平面度工具
,选择19个区域测量平面度。
[17] 使用Lua脚本工具
,在对应IM显示平面度结果
lua
--读取盖板平面度的补偿值
offset_F1 = GetVariable("OffSet_F1")
-- 平面度+补偿值
F1= GetMeasure(0) + offset_F1
SetVariable("Flatness1" , tointeger(F1*1000)/1000)
-- 结果判断显示
if 0<F1 and F1<0.8 then
DrawOverlay(1,25,54,20,16,"green","盖板平面度OK:" .. string.format("%3f",F1))
else
DrawOverlay(1,25,54,20,16,"red","盖板平面度NG:" .. string.format("%3f",F1))
end
四、正极高度测量
[18-21] 使用3D高度工具
,选择四个区域测量正极高度。
[22] 使用Lua脚本工具
,获取正极高度并求正极平均高度
lua
--读取正极高度的补偿值
offset_H_R = GetVariable("OffSet_H_R")
OffSet_H_R_Single1 = GetVariable("OffSet_H_R_Single1")
OffSet_H_R_Single2 = GetVariable("OffSet_H_R_Single2")
OffSet_H_R_Single3 = GetVariable("OffSet_H_R_Single3")
OffSet_H_R_Single4 = GetVariable("OffSet_H_R_Single4")
--正极高度1+补偿值1
PPH1_Mean = GetMeasure(6) + OffSet_H_R_Single1
SetVariable("PPH1_Mean" ,tointeger(PPH1_Mean*1000)/1000 )
--正极高度2+补偿值2
PPH2_Mean = GetMeasure(4) + OffSet_H_R_Single2
SetVariable("PPH2_Mean" ,tointeger(PPH2_Mean*1000)/1000 )
--正极高度3+补偿值3
PPH3_Mean = GetMeasure(2) + OffSet_H_R_Single3
SetVariable("PPH3_Mean" ,tointeger(PPH3_Mean*1000)/1000 )
--正极高度4+补偿值4
PPH4_Mean = GetMeasure(0) + OffSet_H_R_Single4
SetVariable("PPH4_Mean" ,tointeger(PPH4_Mean*1000)/1000 )
-- 求正极平均高度
PPH1 = GetVariable("PPH1_Mean")
PPH2 = GetVariable("PPH2_Mean")
PPH3 = GetVariable("PPH3_Mean")
PPH4 = GetVariable("PPH4_Mean")
PPH = (PPH1+PPH2+PPH3+PPH4)/4 + offset_H_R
SetVariable("Height_R" , tointeger(PPH*1000)/1000)
五、负极高度测量
[23-27] 负极高度测量步骤与正极高度测量相同
六、数据保存
[28] 使用Lua脚本工具
,获取电池盖板及正负极高度信息并保存到csv文件
lua
-- 获取平面度
F1 = GetVariable("Flatness")
if F1 <= 0 then
F1 = 0.555
elseif F1 >= 1.0 then
F1 = 0.555
else
end
-- 获取负极高度
NPH1_Mean = GetVariable("NPH1_Mean")
if NPH1_Mean <= 0 then
NPH1_Mean = 9.999
elseif NPH1_Mean >= 10 then
NPH1_Mean = 9.999
else
end
NPH2_Mean = GetVariable("NPH2_Mean")
if NPH2_Mean <= 0 then
NPH2_Mean = 9.999
elseif NPH2_Mean >= 10 then
NPH2_Mean = 9.999
else
end
NPH3_Mean = GetVariable("NPH3_Mean")
if NPH3_Mean <= 0 then
NPH3_Mean = 9.999
elseif NPH3_Mean >= 10 then
NPH3_Mean = 9.999
else
end
NPH4_Mean = GetVariable("NPH4_Mean")
if NPH4_Mean <= 0 then
NPH4_Mean = 9.999
elseif NPH4_Mean >= 10 then
NPH4_Mean = 9.999
else
end
--获取正极高度
PPH1_Mean = GetVariable("PPH1_Mean")
if PPH1_Mean <= 0 then
PPH1_Mean = 9.999
elseif PPH1_Mean >= 10 then
PPH1_Mean = 9.999
else
end
PPH2_Mean = GetVariable("PPH2_Mean")
if PPH2_Mean <= 0 then
PPH2_Mean = 9.999
elseif PPH2_Mean >= 10 then
PPH2_Mean = 9.999
else
end
PPH3_Mean = GetVariable("PPH3_Mean")
if PPH3_Mean <= 0 then
PPH3_Mean = 9.999
elseif PPH3_Mean >= 10 then
PPH3_Mean = 9.999
else
end
PPH4_Mean = GetVariable("PPH4_Mean")
if PPH4_Mean <= 0 then
PPH4_Mean = 9.999
elseif PPH4_Mean >= 10 then
PPH4_Mean = 9.999
else
end
--负极四个高度的最大值
NPH_Max = math.max(NPH1_Mean,NPH2_Mean,NPH3_Mean,NPH4_Mean)
if NPH_Max <= 0 then
NPH_Max = 9.999
elseif NPH_Max >= 10 then
NPH_Max = 9.999
else
end
SetVariable("NPH_Max", NPH_Max)
--负极四个高度的最小值
NPH_Min = math.min(NPH1_Mean,NPH2_Mean,NPH3_Mean,NPH4_Mean)
if NPH_Min <= 0 then
NPH_Min = 9.999
elseif NPH_Min >= 10 then
NPH_Min = 9.999
else
end
SetVariable("NPH_Min", NPH_Min)
--正极四个高度的最大值
PPH_Max = math.max(PPH1_Mean,PPH2_Mean,PPH3_Mean,PPH4_Mean)
if PPH_Max <= 0 then
PPH_Max = 9.999
elseif PPH_Max >= 10 then
PPH_Max = 9.999
else
end
SetVariable("PPH_Max", PPH_Max)
--正极四个高度的最小值
PPH_Min = math.min(PPH1_Mean,PPH2_Mean,PPH3_Mean,PPH4_Mean)
if PPH_Min <= 0 then
PPH_Min = 9.999
elseif PPH_Min >= 10 then
PPH_Min = 9.999
else
end
SetVariable("PPH_Min", PPH_Min)
--负极平均高度
Height_N = GetVariable("Height_N")
if Height_N <= 0 then
Height_N = 9.999
elseif Height_N >= 10 then
Height_N = 9.999
else
end
--正极平均高度
Height_R = GetVariable("Height_R")
if Height_R <= 0 then
Height_R = 9.999
elseif Height_R >= 10 then
Height_R = 9.999
else
end
--拼接字符串
send = ""
send = send .. string.format("%.3f", F1).. ","
send = send .. string.format("%.3f", NPH1_Mean).. ","
send = send .. string.format("%.3f", NPH2_Mean).. ","
send = send .. string.format("%.3f", NPH3_Mean).. ","
send = send .. string.format("%.3f", NPH4_Mean).. ","
send = send .. string.format("%.3f", PPH1_Mean).. ","
send = send .. string.format("%.3f", PPH2_Mean).. ","
send = send .. string.format("%.3f", PPH3_Mean).. ","
send = send .. string.format("%.3f", PPH4_Mean).. ","
send = send .. string.format("%.3f", NPH_Max).. ","
send = send .. string.format("%.3f", NPH_Min).. ","
send = send .. string.format("%.3f", PPH_Max).. ","
send = send .. string.format("%.3f", PPH_Min).. ","
send = send .. string.format("%.3f", Height_N).. ","
send = send .. string.format("%.3f", Height_R)..","
SetVariable("send", send)
--写入表格
Filename = GetVariable("DataPath")
write = ""
write = write .. os.date("%Y_%m_%d %H:%M:%S") .. ","
write = write .. string.format("%.3f", F1).. ","
write = write .. string.format("%.3f", NPH1_Mean).. ","
write = write .. string.format("%.3f", NPH2_Mean).. ","
write = write .. string.format("%.3f", NPH3_Mean).. ","
write = write .. string.format("%.3f", NPH4_Mean).. ","
write = write .. string.format("%.3f", PPH1_Mean).. ","
write = write .. string.format("%.3f", PPH2_Mean).. ","
write = write .. string.format("%.3f", PPH3_Mean).. ","
write = write .. string.format("%.3f", PPH4_Mean).. ","
write = write .. string.format("%.3f", NPH_Max).. ","
write = write .. string.format("%.3f", NPH_Min).. ","
write = write .. string.format("%.3f", PPH_Max).. ","
write = write .. string.format("%.3f", PPH_Min).. ","
write = write .. string.format("%.3f", Height_N).. ","
write = write .. string.format("%.3f", Height_R)
fprint(Filename, write)