Exemplo n.º 1
0
        private double TouchAndFindPressureSensor(double touchPointHeight, int timeoutSec = 120)
        {
            double needleHeight = 0;

            //Max down 0.5mm
            touchPointHeight -= 0.5;
            _mc.MoveToTarget(MotorZ, touchPointHeight);

            var stopwatch = new Stopwatch();

            stopwatch.Start();


            do
            {
                //if (_mc.IsMoving(MotorZ) == false)
                //{
                //    _mc.MoveToTargetRelative(MotorZ, -0.1);
                //    if (GetPosition(MotorZ)<=touchPointHeight)
                //    {
                //        throw new Exception("Find needle height timeout, maybe need to lower sensor: " + _coordinateId);
                //    }
                //}

                if (GetPressureValue() > NeedleTouchPressure)
                {
                    _mc.Stop(MotorZ);
                    Delay(800);
                    needleHeight = _mc.GetPosition(MotorZ) + NeedleOnZHeightCompensation;
                    SetSpeed(1);
                    _mc.MoveToTargetRelativeTillEnd(MotorZ, 2);
                    return(needleHeight);
                }

                if (stopwatch.ElapsedMilliseconds > timeoutSec * 1000)
                {
                    throw new Exception("Find needle height timeout, maybe need to lower sensor: " + _coordinateId);
                }
            } while (true);
        }
 public void DescendOneLayer()
 {
     _mc.MoveToTargetRelativeTillEnd(MotorTray, -TrayLayerHeight);
 }
Exemplo n.º 3
0
 /// <summary>
 /// Correct direction counter clockwise
 /// </summary>
 /// <param name="relativeAngle"></param>
 /// <param name="mode"></param>
 /// <param name="action"></param>
 public void CorrectAngle(double relativeAngle, MoveModeAMotor mode,
                          ActionType action = ActionType.Load)
 {
     _mc.MoveToTargetRelativeTillEnd(MotorA, relativeAngle);
 }
Exemplo n.º 4
0
 public void Turns()
 {
     _mc.MoveToTargetRelativeTillEnd(TableMotor, FixtureAngle);
     TurnsTableData();
 }
Exemplo n.º 5
0
 public void RiseZALittleAndDown()
 {
     _mc.MoveToTargetRelativeTillEnd(MotorZ, 3);
     _mc.MoveToTargetRelativeTillEnd(MotorZ, -3.3);
 }