From 9edb39b695fe0c61a9dcb955b647645391bd008c Mon Sep 17 00:00:00 2001 From: hanqiangqiang <1364346467@qq.com> Date: Sun, 16 Jun 2024 10:05:43 +0800 Subject: [PATCH] =?UTF-8?q?1=E7=A3=81=E6=B5=81=E4=BD=93=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E8=BF=9E=E8=B4=AF=E8=AE=BE=E7=BD=AE=EF=BC=8C=E5=86=99AO?= =?UTF-8?q?=EF=BC=8C=E7=BD=AE=E4=BD=8DDO=202=E6=B7=BB=E5=8A=A0Load?= =?UTF-8?q?=E5=A4=8D=E4=BD=8D=E7=8A=B6=E6=80=81=E8=AE=B0=E5=BD=95=EF=BC=8C?= =?UTF-8?q?=E6=9C=AA=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Devices/IoCheckLoadLidClose.cs | 44 +++++++++++ .../Devices/SicMultipleServo.cs | 76 ++++++++++++------- .../MECF.Framework.RT.EquipmentLibrary.csproj | 1 + 3 files changed, 94 insertions(+), 27 deletions(-) create mode 100644 MECF.Framework.RT.EquipmentLibrary/Devices/IoCheckLoadLidClose.cs diff --git a/MECF.Framework.RT.EquipmentLibrary/Devices/IoCheckLoadLidClose.cs b/MECF.Framework.RT.EquipmentLibrary/Devices/IoCheckLoadLidClose.cs new file mode 100644 index 0000000..87bf941 --- /dev/null +++ b/MECF.Framework.RT.EquipmentLibrary/Devices/IoCheckLoadLidClose.cs @@ -0,0 +1,44 @@ +using Aitex.Core.RT.DataCenter; +using Aitex.Core.RT.Device; +using Aitex.Core.RT.IOCore; +using Aitex.Core.RT.OperationCenter; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace MECF.Framework.RT.EquipmentLibrary.Devices +{ + public class IoCheckLoadLidClose : BaseDevice, IDevice + { + protected readonly DIAccessor _diLoaderLidClosed; + + + + public bool LoaderLidClose { get; set; } + + public bool Initialize() + { + DATA.Subscribe($"{Module}.{Name}.ServoReady", () => LoaderLidClose); + return true; + } + + protected override void HandleMonitor() + { + + } + + public void Terminate() + { + + } + + public void Reset() + { + + } + + + } +} diff --git a/MECF.Framework.RT.EquipmentLibrary/Devices/SicMultipleServo.cs b/MECF.Framework.RT.EquipmentLibrary/Devices/SicMultipleServo.cs index 5f20eea..0d6a1f3 100644 --- a/MECF.Framework.RT.EquipmentLibrary/Devices/SicMultipleServo.cs +++ b/MECF.Framework.RT.EquipmentLibrary/Devices/SicMultipleServo.cs @@ -34,6 +34,7 @@ namespace Aitex.Core.RT.Device.Devices private readonly AOAccessor _aoSpindleLoadAngle; private readonly AOAccessor _aoSpindleUnloadAngle; + private readonly AOAccessor _aoSpindleJogSpeed; private readonly DIAccessor _diServoHome; private readonly DIAccessor _diSpindleMoveComplete; @@ -154,6 +155,7 @@ namespace Aitex.Core.RT.Device.Devices _aoSpindleLoadAngle = ParseAoNode("aoSpindleLoadAngle", node, ioModule); _aoSpindleUnloadAngle = ParseAoNode("aoSpindleUnloadAngle", node, ioModule); + _aoSpindleJogSpeed = ParseAoNode("aoSpindleJogSpeed", node, ioModule); _diServoHome = ParseDiNode("diServoHome", node, ioModule); _diServoEnable = ParseDiNode("diServoEnable", node, ioModule); @@ -288,6 +290,24 @@ namespace Aitex.Core.RT.Device.Devices return true; } + public void SetActualSpeed(float target, int time) + { + SpeedSetpoint = target; + SetPulse(_doSpindleSpeedRun); + } + + public void LoadAngleRun(float angle) + { + SpindleLoadAngleSet = angle; + SetPulse(_doSpindleLoadAngleRun); + } + + public void UnloadAngleRun(float angle) + { + SpindleUnloadAngle = angle; + SetPulse(_doSpindleUnloadAngleRun); + } + private void SetPulse(DOAccessor doAccessor) { if (doAccessor?.Value == false) @@ -381,35 +401,37 @@ namespace Aitex.Core.RT.Device.Devices return true; } - public void SetActualSpeed(float target, int time) - { - //取消检查 - //if (!ServoReady) - //{ - // EV.PostWarningLog(Module, "Servo is not ready!"); - // return; - //} + - if (target == 0 && ServoEnable) - { - _setValueIsZero = true; - } - else - { - _setValueIsZero = false; - } + //public void SetActualSpeed(float target, int time) + //{ + // //取消检查 + // //if (!ServoReady) + // //{ + // // EV.PostWarningLog(Module, "Servo is not ready!"); + // // return; + // //} - //if (target > 0 && !ServoEnable) - //{ - // SetServoEnable(true, out _); - //} + // if (target == 0 && ServoEnable) + // { + // _setValueIsZero = true; + // } + // else + // { + // _setValueIsZero = false; + // } - _rampTimer.Stop(); - _rampInitValue = _aoSpindleSpeedSet.Value; //ramp 初始值取当前设定值,而非实际读取值.零漂问题 - _rampTime = time; - _rampTarget = target; - _rampTimer.Start(_rampTime); - } + // //if (target > 0 && !ServoEnable) + // //{ + // // SetServoEnable(true, out _); + // //} + + // _rampTimer.Stop(); + // _rampInitValue = _aoSpindleSpeedSet.Value; //ramp 初始值取当前设定值,而非实际读取值.零漂问题 + // _rampTime = time; + // _rampTarget = target; + // _rampTimer.Start(_rampTime); + //} public void SetAccSpeed(float dValue) { @@ -484,7 +506,7 @@ namespace Aitex.Core.RT.Device.Devices protected override void HandleMonitor() { - MonitorRamping(); + //MonitorRamping(); MonitorSet(); _trigEnable.CLK = ServoEnable; diff --git a/MECF.Framework.RT.EquipmentLibrary/MECF.Framework.RT.EquipmentLibrary.csproj b/MECF.Framework.RT.EquipmentLibrary/MECF.Framework.RT.EquipmentLibrary.csproj index a62c4c8..d4cd93d 100644 --- a/MECF.Framework.RT.EquipmentLibrary/MECF.Framework.RT.EquipmentLibrary.csproj +++ b/MECF.Framework.RT.EquipmentLibrary/MECF.Framework.RT.EquipmentLibrary.csproj @@ -78,6 +78,7 @@ +