RobotStudio event

Real-time updating coordinates from the C# code to the robot

Hello!
        I'm a postgraduate major in robotic control. My subject is called “Dynamic visual servo control of robots" .It describes an integrated visual servoing system able to track and grasp industrial parts moving on a conveyer by controlling  a ABB robot arm .The robot arm is controlled by the PC-based vision and robot controllers,In my C# code,Image acquisition and object recognition cycle time is 50ms,that is to say,the coordinates of workpiece in robot base-frame update in every 50ms, later,i send this two coordinates X and Y to robot with the timer event which cycle time is 100msimage
//PID控制量
            double VarInXdir;
            double VarInYdir;
            VarInXdir = para_Kp * para_ErrorX + para_Kd *para_ErrorX;
            VarInYdir = para_Kp * para_ErrorY+ para_Kd *para_ErrorY;

            //读取当前RAPID程序中的目标点位置,并将控制量偏移修正到当前目标点中
            RapidData rd = ABBController.Rapid.GetRapidData("T_ROB1", "MainModule", "p10);
            RobTarget target = new RobTarget();
            if (rd.Value is RobTarget)
            {
                target = (RobTarget)rd.Value;
            }
            target.Trans.X += (float)VarInXdir;
            target.Trans.Y += (float)VarInYdir;

            using (Mastership m = Mastership.Request(ABBController.Rapid))
            {
                rd.Value = target;
            }
here is my rapid code:
PROC main()
rInitialize;

WHILE TRUE DO

MoveL P10 ,v30,z10,tGripper;

ENDWHILE

ENDPROC



the problem is :the robot velosity is not Smooth,always exists a standstill between two motion cycle,How could i solve this problem?
Thank you for your help!



Comments

  • There is a limitation as to how many (and complex) calculations the robot controller can
    calculate in between move instructions with corner zones. This is mainly a problem when
    calling procedures after a move instruction with a corner zone.

    I think if you change this line

    MoveL P10 ,v30,z10,tGripper;

    with

    MoveL P10 ,v30,fine,tGripper;

    your problem would be solved. I hope this helps.
  • One other thing to consider is your while loop cause heavy CPU usage which may cause unknown circumstances. To avoid this simply have an idle time in between two cycles by adding a sleep time. 

    ex (pseudo code): 

    while true
      do move 
      sleep for x time
    end while