Industrial robot simulation construction (taking ABB as an example)

Note: This content is based on the previous two articles "C#-based Robot Simulation Platform and Robot Kinematics Algorithm Implementation" and "Six-axis Robot Trajectory Planning (Linear Trajectory Planning, Arc Trajectory Planning) - C# Implementation + ABB as an example ( Planning to directly issue offline program motion)" to optimize the model and related algorithms and structural codes, and integrate them.

1. Model optimization

1. In view of the problem that the model in the previous article is not good enough and the details of the model are not in place, corresponding changes have been made in this revision

Old rules, first picture:

 Program Interface:

 

 Robot Model1 - IRB2600

Robot Model2 - IRB6700 

 PS: In the model optimization, each link mechanism of the new model is reconstructed to different degrees, and finally the spliced ​​robot is displayed on the interface, and the model can be achieved without conflict between the links of the model, and it can be coherent and continuous as required. Actions.

Animated GIF:

It can be seen that there is no dislocation of each connecting rod or model error during the movement of the model.

Reference Code(Not all of it but core code)

#if IRB6700        
        private const string MODEL_PATH1 = "IRB6700-MH3_245-300_IRC5_rev01_BASE_CAD.stl";
        private const string MODEL_PATH2 = "IRB6700-MH3_245-300_IRC5_rev02_LINK01_CAD.stl";
        private const string MODEL_PATH3 = "IRB6700-MH3_245-300_IRC5_rev00_LINK02_CAD.stl";
        private const string MODEL_PATH4 = "IRB6700-MH3_245-300_IRC5_rev02_LINK03_CAD.stl";
        private const string MODEL_PATH5 = "IRB6700-MH3_245-300_IRC5_rev01_LINK04_CAD.stl";
        private const string MODEL_PATH6 = "IRB6700-MH3_245-300_IRC5_rev01_LINK05_CAD.stl";
        private const string MODEL_PATH7 = "IRB6700-MH3_245-300_IRC5_rev01_LINK06_CAD.stl";
        private const string MODEL_PATH8 = "IRB6700-MH3_245-300_IRC5_rev00_LOGO1_CAD.stl";
        private const string MODEL_PATH9 = "IRB6700-MH3_245-300_IRC5_rev00_LOGO2_CAD.stl";
        private const string MODEL_PATH10 = "IRB6700-MH3_245-300_IRC5_rev00_LOGO3_CAD.stl";
        private const string MODEL_PATH11 = "IRB6700-MH3_245-300_IRC5_rev00_CYLINDER_CAD.stl";
        private const string MODEL_PATH12 = "IRB6700-MH3_245-300_IRC5_rev02_LINK01_CABLE.stl";
        private const string MODEL_PATH13 = "IRB6700-MH3_245-300_IRC5_rev02_LINK01m_CABLE.stl";
        private const string MODEL_PATH14 = "IRB6700-MH3_245-300_IRC5_rev00_LINK02_CABLE.stl";
        private const string MODEL_PATH15 = "IRB6700-MH3_245-300_IRC5_rev00_LINK02m_CABLE.stl";
        private const string MODEL_PATH16 = "IRB6700-MH3_245-300_IRC5_rev00_LINK03a_CABLE.stl";
        private const string MODEL_PATH17 = "IRB6700-MH3_245-300_IRC5_rev00_LINK03b_CABLE.stl";
        private const string MODEL_PATH18 = "IRB6700-MH3_245-300_IRC5_rev02_LINK03m_CABLE.stl";
        private const string MODEL_PATH19 = "IRB6700-MH3_245-300_IRC5_rev01_LINK04_CABLE.stl";
        private const string MODEL_PATH20 = "hanqiang.stl";
        private const string GUAN_DAO = "guandao1.stl";
#else
        private const string MODEL_PATH1 = "IRB2600_12_165_base_CAD_01.step.STL";
        private const string MODEL_PATH2 = "IRB2600_12_165_link1_CAD_01.STL";
        private const string MODEL_PATH3 = "IRB2600_12_165_link2_CAD_01.STL";
        private const string MODEL_PATH4 = "IRB2600_12_165_link3_CAD_01.STL";
        private const string MODEL_PATH5 = "IRB2600_12_165_link4_CAD_02.STL";
        private const string MODEL_PATH6 = "IRB2600_12_165_link5_CAD_02.STL";
        private const string MODEL_PATH7 = "IRB2600_12_165_link6_CAD_01.STL";
        private const string MODEL_PATH8 = "IRB6700-MH3_245-300_IRC5_rev00_LOGO1_CAD.stl";
        private const string MODEL_PATH9 = "IRB6700-MH3_245-300_IRC5_rev00_LOGO2_CAD.stl";
        private const string MODEL_PATH10 = "IRB6700-MH3_245-300_IRC5_rev00_LOGO3_CAD.stl";
        private const string MODEL_PATH11 = "IRB2600_12_165_cables_link1a_CAD_00.STL";
        private const string MODEL_PATH12 = "IRB2600_12_165_cables_link1b_CAD_00.STL";
        private const string MODEL_PATH13 = "IRB2600_12_165_cables_link2_CAD_00.STL";
        private const string MODEL_PATH14 = "IRB2600_12_165_cables_link3_CAD_00.STL";
        private const string MODEL_PATH20 = "hanqiang2.stl";
        private const string GUAN_DAO = "guandao2.stl";
        private const string ZHENGTI = "zhengti.stl";
#endif


 public UserControl1()
        {
            InitializeComponent();
#if IRB6700
            RoboticArm.Content = Initialize_Environment(MODEL_PATH1, MODEL_PATH2, MODEL_PATH3, MODEL_PATH4, MODEL_PATH5, MODEL_PATH6, MODEL_PATH7, MODEL_PATH8, MODEL_PATH9, MODEL_PATH10, MODEL_PATH11,
                MODEL_PATH12, MODEL_PATH13, MODEL_PATH14, MODEL_PATH15, MODEL_PATH16, MODEL_PATH17, MODEL_PATH18, MODEL_PATH19, MODEL_PATH20);
#else
            RoboticArm.Content = Initialize_Environment(MODEL_PATH1, MODEL_PATH2, MODEL_PATH3, MODEL_PATH4, MODEL_PATH5, MODEL_PATH6, MODEL_PATH7, MODEL_PATH8, MODEL_PATH9, MODEL_PATH10, MODEL_PATH11,
                MODEL_PATH12, MODEL_PATH13, MODEL_PATH14);
#endif
            //function to display the model\
            //Zhengti.Content = ZhengTi();
            hanqiang11.Content = Hanqiang();
            sanjiaoxing.Content = GUandao();
            viewPort3d.Children.Add(RoboticArm);//helixviewPort3d's name:viewPort3d; this code means to display the robotic arm on helexviewport3d   
            viewPort3d.Children.Add(sanjiaoxing);
            viewPort3d.Children.Add(hanqiang11);
            //viewPort3d.Children.Add(Zhengti);
            viewPort3d.Camera.LookDirection = new Vector3D(500, -1000, -500);//initial perspective
           
        }


 public void Refresh3D()
        {
            try
            {

                T = new TranslateTransform3D(0, 0, 0);
                F1.Children.Add(T);

                T= new TranslateTransform3D;

                R = new RotateTransform3D(new AxisAngleRotation3D(new Vector3D(0, 0, 1), g1), new Point3D());
                F2.Children.Add(T);
                F2.Children.Add(R);
                F2.Children.Add(F1);            
                //T = new TranslateTransform3D(0, 0, 0);
               
                T = new TranslateTransform3D;
                R = new RotateTransform3D(new AxisAngleRotation3D(new Vector3D(0, 1, 0), g2), new Point3D());
                F3.Children.Add(T);
                F3.Children.Add(R);
                F3.Children.Add(F2);

                T = new TranslateTransform3D;
                R = new RotateTransform3D(new AxisAngleRotation3D(new Vector3D(0, 1, 0), g3), new Point3D());
                F4.Children.Add(T);
                F4.Children.Add(R);
                F4.Children.Add(F3);

                T = new TranslateTransform3D;
                R = new RotateTransform3D(new AxisAngleRotation3D(new Vector3D(1, 0, 0), g4), new Point3D());
                F5.Children.Add(T);
                F5.Children.Add(R);
                F5.Children.Add(F4);

                T = new TranslateTransform3D;
                R = new RotateTransform3D(new AxisAngleRotation3D(new Vector3D(0, 1, 0), g5), new Point3D());
                F6.Children.Add(T);
                F6.Children.Add(R);
                F6.Children.Add(F5);

                T = new TranslateTransform3D;
                R = new RotateTransform3D(new AxisAngleRotation3D(new Vector3D(1, 0, 0), g6), new Point3D());
                F7.Children.Add(T);
                F7.Children.Add(R);
                F7.Children.Add(F6);
                //T = new TranslateTransform3D;
                //R = new RotateTransform3D(new AxisAngleRotation3D(new Vector3D(1, 0, 0), g6), new Point3D());
                //F11.Children.Add(T);
                //F11.Children.Add(R);
                //F11.Children.Add(F7);
                //R = new RotateTransform3D(new AxisAngleRotation3D(new Vector3D(1, 0, 0), 0), new Point3D());
                //F11.Children.Add(T);
                //F11.Children.Add(R);
                //F11.Children.Add(F7);

                T = new TranslateTransform3D;
                R = new RotateTransform3D(new AxisAngleRotation3D(new Vector3D(0, 1, 0), -90), new Point3D());
                F8.Children.Add(T);
                F8.Children.Add(R);
                F8.Children.Add(F2);

                T = new TranslateTransform3D;
                R = new RotateTransform3D(new AxisAngleRotation3D(new Vector3D(0, 1, 0), 0), new Point3D());
                RotateTransform3D R1 = new RotateTransform3D(new AxisAngleRotation3D(new Vector3D(0, 0, 1), -90));
                F9.Children.Add(T);
                F9.Children.Add(R);
                F9.Children.Add(R1);
                F9.Children.Add(F5);

                //T = new TranslateTransform3D;
                R = new RotateTransform3D(new AxisAngleRotation3D(new Vector3D(0, 1, 0), 0), new Point3D());
                F10.Children.Add(T);
                F10.Children.Add(R);
                F10.Children.Add(F9);
            }
            catch (Exception e)
            {
                //MessageBox.Show("refresh Exception Error:" + e.StackTrace);
            }
        }

Second, code structure processing and real robot linkage function

1. In this creation, the real simulation module is added for the first time. Different from the algorithm module simulation, the simulation module is simulated based on the actions of the real robot, which gets rid of the simulation platform provided by the robot manufacturer and can expand various types of robots.

The picture above and the picture below show obtaining the position and attitude information of the real robot and making corresponding actions.

The 2600 poses in Robotstudio are shown in the figure:

The 2600 poses in the simulation program are shown in the figure:

ps: The welding torches are different, so the visual position seems to be wrong. In fact, the pose is exactly the same as that of the robot in Robotstudio.

GIF image (control the robot in the simulation program through the teach pendant)

The relevant code is similar in the previous article, so I won't repeat it here!

Third, offline programs can also be planned according to points, with stronger visualization

As shown in the figure:

 

Fi: For the algorithm simulation module, you can read the relevant content in the previous article "C#-based Robot Simulation Platform and Robot Kinematics Algorithm Implementation". This article will no longer elaborate. Thank you, we will continue to introduce more interesting robot content in the future! ! !

Tags: Algorithm C# Visual Studio Robot

Posted by l008com on Thu, 13 Oct 2022 16:12:16 +1030