Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hemei
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
潘栩锋
hemei
Commits
5c918f29
Commit
5c918f29
authored
Nov 04, 2020
by
潘栩锋
🚴
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复 对位失败问题
parent
cf55d925
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
11 deletions
+27
-11
HeatBuf.cs
...Y.FeedbackRenZiJia/FLY.FeedbackRenZiJia/Server/HeatBuf.cs
+16
-6
HeatCell.cs
....FeedbackRenZiJia/FLY.FeedbackRenZiJia/Server/HeatCell.cs
+11
-5
No files found.
Project.FLY.FeedbackRenZiJia/FLY.FeedbackRenZiJia/Server/HeatBuf.cs
View file @
5c918f29
...
@@ -391,21 +391,29 @@ namespace FLY.FeedbackRenZiJia.Server
...
@@ -391,21 +391,29 @@ namespace FLY.FeedbackRenZiJia.Server
goto
_error
;
goto
_error
;
}
}
if
((
d
.
ThickAvg
<=
0
)
if
(
d
.
ThickAvg
<=
0
)
||
(
Math
.
Abs
(((
double
)(
d_last
.
ThickAvg
-
d
.
ThickAvg
))
/
d
.
ThickAvg
)
>
0.1
))
{
{
//厚度
变化10%, 不能比较
//厚度
为负数异常
Stability
=
STABILITY
.
ERROR_THICK_CHANGED
;
Stability
=
STABILITY
.
ERROR_THICK_CHANGED
;
goto
_error
;
goto
_error
;
}
}
double
thk_diff
=
Math
.
Abs
((
double
)(
d_last
.
ThickAvg
-
d
.
ThickAvg
));
if
(
thk_diff
>
10
)
{
if
(
thk_diff
/
d
.
ThickAvg
>
0.15
)
{
//厚度变化15%, 不能比较
Stability
=
STABILITY
.
ERROR_THICK_CHANGED
;
goto
_error
;
}
}
//获取 厚度%偏差,与 加热%偏差,大小都为 ChannelCnt
//thickpercents_diff = d.ThickPercents - d_last.ThickPercents
//thickpercents_diff = d.ThickPercents - d_last.ThickPercents
//heatpercents_diff = d_last.ThickPercents - d.ThickPercents
//heatpercents_diff = d_last.ThickPercents - d.ThickPercents
GetPercentDatas3
(
d
,
d_last
,
GetPercentDatas3
(
d
,
d_last
,
out
double
[]
thickpercents_diff
,
out
double
[]
heatpercents_diff
);
out
double
[]
thickpercents_diff
,
out
double
[]
heatpercents_diff
);
//通过简单的范围比较计算相关性
//通过简单的范围比较计算稳定性
//当Kp, 错位,就会另 稳定性的值很低
CalR
(
thickpercents_diff
,
heatpercents_diff
,
out
bool
[]
isStables
);
CalR
(
thickpercents_diff
,
heatpercents_diff
,
out
bool
[]
isStables
);
double
currR
=
1.0
*
isStables
.
Count
(
b
=>
b
)
/
isStables
.
Count
();
double
currR
=
1.0
*
isStables
.
Count
(
b
=>
b
)
/
isStables
.
Count
();
CurrR
=
currR
;
CurrR
=
currR
;
...
@@ -442,6 +450,7 @@ namespace FLY.FeedbackRenZiJia.Server
...
@@ -442,6 +450,7 @@ namespace FLY.FeedbackRenZiJia.Server
if
(
d
.
thickHeat
.
Time
-
d_last
.
thickHeat
.
Time
>
TimeSpan
.
FromMinutes
(
120
))
if
(
d
.
thickHeat
.
Time
-
d_last
.
thickHeat
.
Time
>
TimeSpan
.
FromMinutes
(
120
))
{
{
mData
.
RemoveRange
(
0
,
index
);
mData
.
RemoveRange
(
0
,
index
);
//因为是从尾到前找, 所以这个超时的,已经是最前一个,可以结束了
break
;
break
;
}
}
...
@@ -450,6 +459,7 @@ namespace FLY.FeedbackRenZiJia.Server
...
@@ -450,6 +459,7 @@ namespace FLY.FeedbackRenZiJia.Server
if
(
d_last
.
thickHeat
.
HTime
==
last_h_t
)
if
(
d_last
.
thickHeat
.
HTime
==
last_h_t
)
{
{
//认为加热一样的,厚度也是一样,不比较了
//认为加热一样的,厚度也是一样,不比较了
//加热一样,只用最新的那幅数据
continue
;
continue
;
}
}
}
}
...
...
Project.FLY.FeedbackRenZiJia/FLY.FeedbackRenZiJia/Server/HeatCell.cs
View file @
5c918f29
...
@@ -213,24 +213,28 @@ namespace FLY.FeedbackRenZiJia.Server
...
@@ -213,24 +213,28 @@ namespace FLY.FeedbackRenZiJia.Server
AutoONoId1
=
0
;
AutoONoId1
=
0
;
}
}
void
AutoONoOnPoll
()
void
checkResetAuto
()
{
{
if
(
mHeatBuf
.
Stability
!=
STABILITY
.
OK_CORREL
)
if
(
mHeatBuf
.
Stability
!=
STABILITY
.
OK_CORREL
)
return
;
return
;
if
(
Heats
.
All
(
h
=>
h
==
0
))
if
(
Heats
.
All
(
h
=>
h
==
0
))
{
{
//加热全部为0
//加热全部为0
//复位状态
//复位状态
ResetAuto
();
ResetAuto
();
}
}
}
void
AutoONoOnPoll
()
{
checkResetAuto
();
switch
(
AutoONoStatus
)
switch
(
AutoONoStatus
)
{
{
case
AutoONoStatusEnum
.
Init
:
case
AutoONoStatusEnum
.
Init
:
{
{
//
if (mHeatBuf.Stability != STABILITY.OK_CORREL)
if
(
mHeatBuf
.
Stability
!=
STABILITY
.
OK_CORREL
)
//
break;
break
;
if
(
Heats
.
All
(
h
=>
h
==
0
))
if
(
Heats
.
All
(
h
=>
h
==
0
))
{
{
...
@@ -302,6 +306,7 @@ namespace FLY.FeedbackRenZiJia.Server
...
@@ -302,6 +306,7 @@ namespace FLY.FeedbackRenZiJia.Server
break
;
break
;
case
AutoONoStatusEnum
.
Step2
:
case
AutoONoStatusEnum
.
Step2
:
{
{
//不需要等 STABILITY.OK_CORREL
if
(
mHeatBuf
.
MaxR_Id1
==
mHeatBuf
.
mData
.
Last
().
thickHeat
.
ID
)
//算出结果
if
(
mHeatBuf
.
MaxR_Id1
==
mHeatBuf
.
mData
.
Last
().
thickHeat
.
ID
)
//算出结果
{
{
string
msg
=
"对位完成"
;
string
msg
=
"对位完成"
;
...
@@ -337,6 +342,7 @@ namespace FLY.FeedbackRenZiJia.Server
...
@@ -337,6 +342,7 @@ namespace FLY.FeedbackRenZiJia.Server
//对位完成
//对位完成
AutoONoStatus
=
AutoONoStatusEnum
.
Success
;
AutoONoStatus
=
AutoONoStatusEnum
.
Success
;
AutoONoMsg
=
msg
;
AutoONoMsg
=
msg
;
AutoONoId0
=
mHeatBuf
.
MaxR_Id0
;
AutoONoId1
=
mHeatBuf
.
MaxR_Id1
;
AutoONoId1
=
mHeatBuf
.
MaxR_Id1
;
return
;
return
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment