|
|
@@ -2,6 +2,7 @@
|
|
|
using Aitex.Core.RT.Log;
|
|
|
using Aitex.Core.RT.Routine;
|
|
|
using Aitex.Core.Util;
|
|
|
+using MECF.Framework.Common.Alarm;
|
|
|
using MECF.Framework.Common.Beckhoff.Station;
|
|
|
using MECF.Framework.Common.CommonData.PowerSupplier;
|
|
|
using MECF.Framework.Common.RecipeCenter;
|
|
|
@@ -70,10 +71,6 @@ namespace PunkHPX8_RT.Modules.PlatingCell
|
|
|
/// </summary>
|
|
|
private bool _isZeroCurrent = false;
|
|
|
/// <summary>
|
|
|
- /// 是否双有双向旋转
|
|
|
- /// </summary>
|
|
|
- private bool _isBiRotation = false;
|
|
|
- /// <summary>
|
|
|
/// 是否启动smart spin
|
|
|
/// </summary>
|
|
|
private bool _isSmartSpin = false;
|
|
|
@@ -115,10 +112,12 @@ namespace PunkHPX8_RT.Modules.PlatingCell
|
|
|
public RState Monitor()
|
|
|
{ //没有上电保护,此刻给电
|
|
|
Runner.RunIf(RunRecipeStep.RunPowerStep, _recipe.IsEntryTypeCold, StartPowerStep, _delay_1ms)
|
|
|
+ //检验步阶电流是否完成
|
|
|
+ .WaitWithStopCondition(RunRecipeStep.RunPowerStepWait, CheckRecipeStepEndStatus, CheckRecipeStepStopStatus, false, _delay_1ms)
|
|
|
.LoopStart(RunRecipeStep.LoopRotationStart, "Start rotation cycle",_recipe.DepStepCount,NullFun)
|
|
|
//vertical 调整位置(第一步不用调,entry过程已经走到位置了)
|
|
|
.LoopRunIf(RunRecipeStep.LoopVerticalGotoOffSet, _recipe.DepSteps[_depositionStepIndex].PlatingZoffset!=0 && _depositionStepIndex!=0, () => StartVertical("Plate", _recipe.DepSteps[_depositionStepIndex].PlatingZoffset),_delay_1ms)
|
|
|
- .LoopRunIf(RunRecipeStep.LoopVerticalGotoOffSetCheck, _recipe.DepSteps[_depositionStepIndex].PlatingZoffset!=0 && _depositionStepIndex != 0, CheckVerticalEnd, CheckVerticalError)
|
|
|
+ .LoopRunIfWithStopStatus(RunRecipeStep.LoopVerticalGotoOffSetCheck, _recipe.DepSteps[_depositionStepIndex].PlatingZoffset!=0 && _depositionStepIndex != 0, CheckVerticalEnd, CheckVerticalError)
|
|
|
|
|
|
//不带双向旋转,时间到了直接变速(如果当前电机是停止状态,启动起来)
|
|
|
.LoopRunIf(RunRecipeStep.LoopRotationStartIfCurrentIsStoped, CheckRotationIsIdle() && !_recipe.DepSteps[_depositionStepIndex].BiDireaction,
|
|
|
@@ -137,9 +136,6 @@ namespace PunkHPX8_RT.Modules.PlatingCell
|
|
|
() => CommonFunction.CheckRoutineEndState(_rotationBiDirectionRoutine),
|
|
|
() => CommonFunction.CheckRoutineStopState(_rotationBiDirectionRoutine))
|
|
|
.LoopEnd(RunRecipeStep.LoopEnd, UpdateDepositionIndex, _delay_1ms)
|
|
|
- //检验步阶电流是否完成
|
|
|
- .WaitWithStopCondition(RunRecipeStep.RunPowerStepWait, CheckRecipeStepEndStatus, CheckRecipeStepStopStatus,false,_delay_1ms)
|
|
|
-
|
|
|
//如果电镀最后一步带双向旋转,后续电机会停止,需要再把电机启动起来
|
|
|
.RunIf(RunRecipeStep.RotationStartIfCurrentIsStoped, CheckRotationIsIdle(), () => { return StartRotation(ROTATION_FAR_POSITION); }, _delay_1ms)
|
|
|
.End(RunRecipeStep.End, NullFun);
|
|
|
@@ -275,6 +271,56 @@ namespace PunkHPX8_RT.Modules.PlatingCell
|
|
|
return _verticalEntity.IsError;
|
|
|
}
|
|
|
/// <summary>
|
|
|
+ /// 检验电流和电压合理性
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="current"></param>
|
|
|
+ /// <param name="voltage"></param>
|
|
|
+ /// <param name="side"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ private bool CheckSidePowerInvalid(double current, double voltage)
|
|
|
+ {
|
|
|
+ double maxVoltage = _recipe.DepMaxVoltageFault;
|
|
|
+ double warnVoltage = _recipe.DepMaxVoltageWarning;
|
|
|
+ if (voltage > maxVoltage)
|
|
|
+ {
|
|
|
+ NotifyError(eEvent.ERR_PLATINGCELL, $" voltage {voltage} is large than recipe max voltage {maxVoltage}", 0);
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ if (voltage > warnVoltage)
|
|
|
+ {
|
|
|
+ string str = $" voltage is {voltage} in warning";
|
|
|
+ if (AlarmListManager.Instance.AddWarn(Module, $"voltage", str))
|
|
|
+ {
|
|
|
+ LOG.WriteLog(eEvent.WARN_METAL, Module, str);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ double maxErrorCurrent = _powerSupplierStepPeriodDatas[_depositionStepIndex].Current * (double)(1 + _recipe.DepCurrentFault * 0.01);
|
|
|
+ double minErrorCurrent = _powerSupplierStepPeriodDatas[_depositionStepIndex].Current * (double)(1 - _recipe.DepCurrentFault * 0.01);
|
|
|
+ double maxWarnCurrent = _powerSupplierStepPeriodDatas[_depositionStepIndex].Current * (double)(1 + _recipe.DepCurrentWarning * 0.01);
|
|
|
+ double minWarnCurrent = _powerSupplierStepPeriodDatas[_depositionStepIndex].Current * (double)(1 - _recipe.DepCurrentWarning * 0.01);
|
|
|
+ if (current > maxErrorCurrent)
|
|
|
+ {
|
|
|
+ NotifyError(eEvent.ERR_PLATINGCELL, $" current {current} is large than recipe max current {maxErrorCurrent}", 0);
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ if (current < minErrorCurrent)
|
|
|
+ {
|
|
|
+ NotifyError(eEvent.ERR_PLATINGCELL, $" current {current} is less than recipe min current {minErrorCurrent}", 0);
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ if ((current <= maxErrorCurrent && current >= maxWarnCurrent) || (current >= minErrorCurrent && current <= minWarnCurrent))
|
|
|
+ {
|
|
|
+ string str = $" current {current} is in warning";
|
|
|
+ if (AlarmListManager.Instance.AddWarn(Module, $" current", str))
|
|
|
+ {
|
|
|
+ LOG.WriteLog(eEvent.ERR_PLATINGCELL, Module, str);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
/// 启动
|
|
|
/// </summary>
|
|
|
/// <param name="objs"></param>
|
|
|
@@ -283,9 +329,7 @@ namespace PunkHPX8_RT.Modules.PlatingCell
|
|
|
{
|
|
|
_recipe = (DepRecipe)objs[0];
|
|
|
_isZeroCurrent = (bool)objs[1];
|
|
|
- _isBiRotation = (bool)objs[2];
|
|
|
- _powerSupplierStepPeriodDatas = (List<PowerSupplierStepPeriodData>)objs[3];
|
|
|
- _platingStartTime = (DateTime)objs[4];
|
|
|
+ _powerSupplierStepPeriodDatas = (List<PowerSupplierStepPeriodData>)objs[2];
|
|
|
_rotationAxis = DEVICE.GetDevice<JetAxisBase>($"{Module}.Rotation");
|
|
|
_device = DEVICE.GetDevice<PlatingCellDevice>(Module);
|
|
|
_depositionStepIndex = 0;
|