力值曲线的问题
这是我力值标定的曲线。
10吨传感器,标定6个点。标定完,得到码值,还有力值。
根据力值和码值的比例关系计算采集的力值。
代码:
Private Sub CalibrateSixDot() '标定六个点
If (StrgenthRec < ZeroDot) Then '力值
DrawValue = 0
ElseIf (StrgenthRec < FirstDot) Then
DrawValue = LittleCoefficient * (StrgenthRec - ZeroDot) / (FirstDot - ZeroDot)
ElseIf (StrgenthRec < SecondDot) Then
DrawValue = (LargeCoefficient - LittleCoefficient) * (StrgenthRec - FirstDot) / (SecondDot - FirstDot) + LittleCoefficient
ElseIf (StrgenthRec < ThreeDot) Then
DrawValue = (ThreeCoefficient - LargeCoefficient) * (StrgenthRec - SecondDot) / (ThreeDot - SecondDot) + LargeCoefficient
ElseIf (StrgenthRec < FourDot) Then
DrawValue = (FourCoefficient - ThreeCoefficient) * (StrgenthRec - ThreeDot) / (FourDot - ThreeDot) + ThreeCoefficient
ElseIf (StrgenthRec < FiveDot) Then
DrawValue = (FiveCoefficient - FourCoefficient) * (StrgenthRec - FourDot) / (FiveDot - FourDot) + FourCoefficient
Else
DrawValue = FiveCoefficient * (StrgenthRec - ZeroDot) / (FiveDot - ZeroDot)
End If
Call KNNKggkgfFormat
End Sub
StrgenthRec是实时采集的采样值,ZeroDot是第一个点标定的码值,
FirstDot是第二个点标定的码值,SecondDot是第三个点标定的码值,
ThreeDot是第四个点标定的码值,FourDot是第五个点标定的码值,
FiveDot是第六个点标定的码值。
LittleCoefficient代表20KN,LargeCoefficient代表40KN,
ThreeCoefficient代表60KN,FourCoefficient 代表80KN,
FiveCoefficient代表100KN.
我觉得计算公式没错呀,为什么曲线是那个鸟样呢?请大神指教,谢谢!
[此贴子已经被作者于2019-8-21 10:38编辑过]