Example #1
0
        /// <summary>
        /// 螺杆阀的非Polyline的打胶逻辑
        /// </summary>
        /// <returns></returns>
        private Result SvValveNotPolyLogic(Line line, List <PointD> primaryPoints, List <PointD> simulPoints)
        {
            Result ret = Result.OK;

            //如果坐标点总数不是偶数(正常情况下不可能存在)
            if (primaryPoints.Count % 2 != 0)
            {
                return(Result.FAILED);
            }

            for (int i = 0; i < (primaryPoints.Count / 2); i++)
            {
                SvValveFludLineParam primaryLineParam = this.GetSvValveParam(line, primaryPoints[0 * 2], primaryPoints[0 * 2 + 1], line.LineCoordinateList[i]);
                SvValveFludLineParam simulLineParam   = this.GetSvValveParam(line, simulPoints[0 * 2], simulPoints[0 * 2 + 1], line.LineCoordinateList[i]);

                double currZ = Machine.Instance.Robot.PosZ;
                double targZ = 0;
                if (Machine.Instance.Laser.Laserable.Vendor == Drive.Sensors.HeightMeasure.Laser.Vendor.Disable)
                {
                    targZ = line.Program.RuntimeSettings.BoardZValue + line.LineCoordinateList[i].Param.DispenseGap;
                }
                else
                {
                    targZ = Converter.NeedleBoard2Z(line.LineCoordinateList[i].Param.DispenseGap, line.CurMeasureHeightValue);
                }

                ret = this.SvValveMoveToLineStart(line, primaryPoints[i * 2], simulPoints[i * 2], currZ, targZ, line.LineCoordinateList[i].Param);
                if (!ret.IsOk)
                {
                    return(ret);
                }

                ret = this.SvValveStartSpary(line, primaryLineParam, simulLineParam);
                if (!ret.IsOk)
                {
                    return(ret);
                }

                ret = this.SvValveStopSpary(line, line.LineCoordinateList[i].Param);
                if (!ret.IsOk)
                {
                    return(ret);
                }
            }

            return(ret);
        }
Example #2
0
        private Result SvValveWetAndDryLogic(Arc arc)
        {
            Result ret = Result.OK;

            //主阀的相关点
            PointD start  = arc.Start.ToNeedle(arc.Valve);
            PointD end    = arc.End.ToNeedle(arc.Valve);
            PointD center = arc.Center.ToNeedle(arc.Valve);

            //副阀的起点
            PointD simulStart = this.GetSimulPos(arc, start);

            SvValveFludLineParam arcParam = this.GetSvValveArcParam(arc, start, end, center);

            double currZ = Machine.Instance.Robot.PosZ;
            double targZ = 0;

            if (Machine.Instance.Laser.Laserable.Vendor == Drive.Sensors.HeightMeasure.Laser.Vendor.Disable)
            {
                targZ = arc.Program.RuntimeSettings.BoardZValue + arc.Param.DispenseGap;
            }
            else
            {
                targZ = Converter.NeedleBoard2Z(arc.Param.DispenseGap, arc.CurMeasureHeightValue);
            }

            ret = this.SvValveMoveToArcStart(arc, start, simulStart, currZ, targZ);
            if (!ret.IsOk)
            {
                return(ret);
            }

            ret = this.SvValveStartSpary(arc, arcParam, center);
            if (!ret.IsOk)
            {
                return(ret);
            }

            ret = this.SvValveStopSpary(arc);
            if (!ret.IsOk)
            {
                return(ret);
            }

            return(ret);
        }
Example #3
0
        private Result SvValveStartSpary(Line line, SvValveFludLineParam primaryLineParam, SvValveFludLineParam simulLineParam)
        {
            Result ret = Result.OK;

            if (line.RunnableModule.Mode == ModuleMode.MainMode && Machine.Instance.Setting.DualValveMode == DualValveMode.异步)
            {
                ret = Machine.Instance.DualValve.FluidLine(primaryLineParam, simulLineParam, FluidProgram.Current.MotionSettings.WeightAcc);
            }
            else
            {
                ret = Machine.Instance.Valve1.FluidLine(primaryLineParam, FluidProgram.Current.MotionSettings.WeightAcc);
            }
            if (!ret.IsOk)
            {
                return(ret);
            }
            return(ret);
        }
Example #4
0
        /// <summary>
        /// 开始走圆弧轨迹并出胶
        /// </summary>
        /// <param name="end"></param>
        /// <param name="center"></param>
        /// <returns></returns>
        private Result SvValveStartSpary(Arc arc, SvValveFludLineParam arcParam, PointD center)
        {
            Result ret = Result.OK;

            if (arc.RunnableModule.Mode == ModuleMode.MainMode && Machine.Instance.Setting.DualValveMode == DualValveMode.异步)
            {
                ret = Machine.Instance.DualValve.FluidArc(arcParam, center, arc.ClockWise, FluidProgram.Current.MotionSettings.WeightAcc);
            }
            else
            {
                ret = Machine.Instance.Valve1.FluidArc(arcParam, center, arc.ClockWise, FluidProgram.Current.MotionSettings.WeightAcc);
            }
            if (!ret.IsOk)
            {
                return(ret);
            }
            return(ret);
        }
Example #5
0
        /// <summary>
        /// 螺杆阀CV模式模式下的运行逻辑
        /// </summary>
        /// <returns></returns>
        private Result SvValveCVLogic(MultiTraces multiTraces)
        {
            Result ret = Result.OK;

            ret = Machine.Instance.Robot.MoveSafeZAndReply();
            if (!ret.IsOk)
            {
                return(ret);
            }

            if (multiTraces.Traces.Count == 0)
            {
                return(ret);
            }
            // 移动到轨迹起点
            ret = Machine.Instance.Robot.MovePosXYAndReply(multiTraces.Traces[0].Start,
                                                           FluidProgram.Current.MotionSettings.VelXY,
                                                           FluidProgram.Current.MotionSettings.AccXY);
            if (!ret.IsOk)
            {
                return(ret);
            }
            SvValveFludLineParam primaryLineParam = this.GetSvValveParam(multiTraces, multiTraces.Traces);

            // 连续插补
            double[] vels = new double[multiTraces.Traces.Count];
            for (int i = 0; i < vels.Length; i++)
            {
                vels[i] = this.getLineParam(multiTraces, multiTraces.Traces[i]).Speed;
            }
            List <ICrdable> crdList = Valve.GetCrdsBy(multiTraces.Traces, vels, FluidProgram.Current.MotionSettings.AccXY);

            ret = Machine.Instance.Robot.MoveTrcXYReply(crdList);
            if (!ret.IsOk)
            {
                return(ret);
            }
            List <ICrdable> backCrdList = Valve.GetCrdsBy(primaryLineParam.backTransTraces, primaryLineParam.backTrackVel, FluidProgram.Current.MotionSettings.AccXY);

            return(Machine.Instance.Robot.MoveTrcXYReply(backCrdList));
        }
Example #6
0
        /// <summary>
        /// 螺杆阀的Poly线的打胶逻辑
        /// </summary>
        /// <param name="primaryPoints"></param>
        /// <param name="simulPoints"></param>
        /// <returns></returns>
        private Result SvValvePolyLogic(Line line, List <PointD> primaryPoints, List <PointD> simulPoints)
        {
            Result ret = Result.OK;

            SvValveFludLineParam primaryLineParam = this.GetSvValveParam(line, primaryPoints, line.LineCoordinateList);
            SvValveFludLineParam simulLineParam   = this.GetSvValveParam(line, simulPoints, line.LineCoordinateList);

            double currZ = Machine.Instance.Robot.PosZ;
            double targZ = 0;

            if (Machine.Instance.Laser.Laserable.Vendor == Drive.Sensors.HeightMeasure.Laser.Vendor.Disable)
            {
                targZ = line.Program.RuntimeSettings.BoardZValue + line.LineCoordinateList[0].Param.DispenseGap;
            }
            else
            {
                targZ = Converter.NeedleBoard2Z(line.LineCoordinateList[0].Param.DispenseGap, line.CurMeasureHeightValue);
            }

            ret = this.SvValveMoveToLineStart(line, primaryPoints[0], simulPoints[0], currZ, targZ, line.LineCoordinateList[0].Param);
            if (!ret.IsOk)
            {
                return(ret);
            }

            ret = this.SvValveStartSpary(line, primaryLineParam, simulLineParam);
            if (!ret.IsOk)
            {
                return(ret);
            }

            ret = this.SvValveStopSpary(line, line.LineCoordinateList[0].Param);
            if (!ret.IsOk)
            {
                return(ret);
            }

            return(ret);
        }
Example #7
0
        /// <summary>
        /// 螺杆阀的轨迹线的打胶逻辑
        /// </summary>
        /// <param name="primaryPoints"></param>
        /// <param name="simulPoints"></param>
        /// <returns></returns>
        private Result SvValveTracesLogic(MultiTraces multiTraces, List <TraceBase> primaryTraces, List <TraceBase> simulTraces)
        {
            Result ret = Result.OK;

            SvValveFludLineParam primaryLineParam = this.GetSvValveParam(multiTraces, primaryTraces);
            SvValveFludLineParam simulLineParam   = this.GetSvValveParam(multiTraces, simulTraces);

            double currZ = Machine.Instance.Robot.PosZ;
            double targZ = 0;

            if (Machine.Instance.Laser.Laserable.Vendor == Drive.Sensors.HeightMeasure.Laser.Vendor.Disable)
            {
                targZ = multiTraces.Program.RuntimeSettings.BoardZValue + this.getLineParam(multiTraces, multiTraces.Traces[0]).DispenseGap;
            }
            else
            {
                targZ = Converter.NeedleBoard2Z(this.getLineParam(multiTraces, multiTraces.Traces[0]).DispenseGap, multiTraces.CurMeasureHeightValue);
            }

            ret = this.SvValveMoveToLineStart(multiTraces, primaryTraces[0].Start, simulTraces[0].Start, currZ, targZ, this.getLineParam(multiTraces, multiTraces.Traces[0]));
            if (!ret.IsOk)
            {
                return(ret);
            }

            ret = this.SvValveStartSpary(multiTraces, primaryLineParam, simulLineParam);
            if (!ret.IsOk)
            {
                return(ret);
            }

            ret = this.SvValveStopSpary(multiTraces, this.getLineParam(multiTraces, multiTraces.Traces[0]));
            if (!ret.IsOk)
            {
                return(ret);
            }

            return(ret);
        }
Example #8
0
 /// <summary>
 /// 螺杆阀的异步圆弧打胶
 /// </summary>
 /// <param name="svValveArcParam"></param>
 /// <returns></returns>
 public abstract Result FluidArc(SvValveFludLineParam svValveArcParam, PointD center, short clockwize, double acc);
Example #9
0
 /// <summary>
 /// 螺杆阀异步执行打胶
 /// </summary>
 /// <param name="primaryLineParam"></param>
 /// <param name="simulLineParam"></param>
 /// <returns></returns>
 public abstract Result FluidLine(SvValveFludLineParam primaryLineParam, SvValveFludLineParam simulLineParam, double acc);
Example #10
0
 /// <summary>
 /// 螺杆阀的直线运动
 /// </summary>
 /// <returns></returns>
 public abstract Result FluidLine(SvValveFludLineParam svValveLineParam, double acc);