fix: restore simulated pressure model and fast prescan
This commit is contained in:
@@ -39,10 +39,10 @@ class SimulatedDevice:
|
||||
if not self.connected or dt == 0:
|
||||
return
|
||||
|
||||
# MT2AM8 的行程控制在当前程序中是反向阀位:较小行程表示更大
|
||||
# 进气。模型因此让压力向由行程决定的目标值缓慢靠近。
|
||||
opening = max(0.0, min(1.0, 1.0 - self.position / 1000.0))
|
||||
target_pressure = self.pressure_range * opening
|
||||
# 行程与阀门开度反向:行程越大,阀门开度越小。阀门开度减小
|
||||
# 时系统压力升高;默认量程下行程 0/1000 分别对应 10/400 kPa。
|
||||
travel_ratio = max(0.0, min(1.0, self.position / 1000.0))
|
||||
target_pressure = 10.0 + (self.pressure_range - 10.0) * travel_ratio
|
||||
response = min(1.0, dt / 8.0)
|
||||
self.pressure += (target_pressure - self.pressure) * response
|
||||
|
||||
|
||||
Reference in New Issue
Block a user