hal-core

More
24 Oct 2021 08:46 #224073 by Grotius
Replied by Grotius on topic hal-core
Hi Dave,

Thanks for the feedback.

not sure if this is something that needs to be changed on the github code or it was just me?

I just tested hal-core on a clean install. It looks to me it was just you. But i added a "prepare" file to the source that will
install the dependencies for you. It turn's out we only need 4 primairy dependencies. That's quite clean isn't it?

github.com/grotius-cnc/hal-core/blob/main/Readme.md

Please Log in or Create an account to join the conversation.

More
24 Oct 2021 09:27 - 24 Oct 2021 09:32 #224076 by Grotius
Replied by Grotius on topic hal-core
Hi Rod,

Thanks for your comment.

I have to be more specefik.
 

In the lcnc code there is a G64P0.01 to stay on path.
This will eliminate the cnc motion overshoot's in blue. I think the off path dist called "Ferror" in the ini files.

The motionplanner i have written calculates a path from a gcode. For example line 1,2 + arc 3 + line 4 + 5 will
be a motion where the s-curve does it's thing from start to end.

This video shows how the motion is done : user-images.githubusercontent.com/448801...7ee-0a229e1caa60.mp4

The stepgen component will try to stay at tcp speed, but
will overshoot at some corners if the machine speed is too high. There are plenty senario's where the machine has to slow down, but there are also plenty senario's where the machine may stay at full speed.

Therefore i have the idea to make a look ahead function that samples the Velocity end, Velocity start to get optimal results.
Green is a programmed value like Velocity : 10.
After the algo is done, it turn's out the machine will not overshoot if the Velocity-end of 1 = 8. 
And so on.

So every gcode line has to be sampled and will get a different optimal value for Velocity start and Velocity end.
The s-curve max velocity will be used always. So when the machine can do it, it will go full trottle.
But with complex gcode it will sample until it will find the best g-force results, according to the acc and dcc values.

The picture is made with : sudo apt-get install gnome-paint









 
Attachments:
Last edit: 24 Oct 2021 09:32 by Grotius.

Please Log in or Create an account to join the conversation.

More
25 Oct 2021 16:34 #224280 by Dave3891
Replied by Dave3891 on topic hal-core
Hi Grotius,

The project I am working on is a 6 axis robotic arm, it is setup for TIG welding circular tube welds. I have a basic prototype working with normal LinuxCNC but looking at the work you have done with robotic modules for HAL has made me want to change my setup. I do not have a need for gcode and some of the features I have in my prototype are not ideal and use MDI and jog commands in a way I am not happy with.

The basic requirements for the robot are 6 axis kinematics to position in a XYZ coordinate area. The TIG welding head has a touch probe on it to find the center of the tube, once the welding starts it monitors the arc voltage to maintain the proper distance to the weld while rotating the 6th axis 360 degrees to preform the weld. Once the weld is complete, the operator moves to the next tube and restarts the cycle.

So I was just looking for some ideas if your modules would work well for this application? I see you have the kinematics with the KDL library already, do you have anything for probing? Any advice on how you would setup a system like this?


Thanks
Dave

Please Log in or Create an account to join the conversation.

More
25 Oct 2021 20:52 - 25 Oct 2021 21:21 #224296 by Grotius
Replied by Grotius on topic hal-core
Hi Dave,

In the past i have done projects like that.
Professional inox heat exchangers where most of time welded with a polysoude welding machine.

I have welded a inox tube heat exchanger with sheetcam and mach3 in the past on a standard cnc, the result was ok.
For Valk Welding we used also a wire feeder on the robotic tig torch, but if the pipes are a little longer, you can do it without that option.

Hal-core is just the interface to the kernel (hal) modules. Hal-core is universal. It's like the big hardware & software connector between your robot motors,encoders and your c++ programs. Hal-core is realtime and fast because it operates from within the kernel. (golden keyring).

If you have installed hal-core you are able to connect your robot motors, encoders to hal. I use the ethercat bus for this. But you could also use other things like mesa, parport, rpi4 ethercat, etc as long as the driver is compiled and is placed in the hal-core/rtlib/

To send motion command's to your robot you need the kdl kinematic library. Wich contains your robot setup values.
Hal_kinematics is quite nice. You can insert your robot model parameters with hal commands. Examples are provided as runtests.
It's just like loading a bash script.

github.com/grotius-cnc/hal-kinematics

After that you are able to send motion commands like :
$ halcmd
$ setp kinematic.cart-x 500

But what you could test is :
1. github.com/grotius-cnc/hal_trajectory
- this is a hal component that does a traject (s-curve motion) for you. It is good enough to weld (multipele) circles.
- github.com/grotius-cnc/simple_cam -> this can load a dxf and make a gcode for you.
- create a gcode with simple_cam to weld a circle, check if it contains the m3 and m5.
- the dxf coordinates has to be at your robot tcp coordinates. Usually the robot tcp is something like x0 y500 z800.
- load the gcode file into hal_trajectory. You can do this entirely by hal-commands or use the c++ interface gui.
2. github.com/grotius-cnc/hal-kinematics
- connect inputs to hal_trajectory, connect hal outputs to your robot. Hal kinematics only does the converse from joints to cartestian.
you will see a inverse kinematics and forward kinematics. If your piece to weld is in a quite save position, the kinematics will do a good job.
If your workpiece is in a difficult position, the kinematics can fail. Currently there is no solver script when kinematics fail.

If you want to rotate your workpiece 3d in the future trough the software, i use a 3d rotation matrix. But for now i would try it without.

If you think you are lost in my ansfer, don't hesitate to ask for help.

Another solution is to use Lcnc, load a gcode and only use the hal_kinematic library with lcnc. You can place the hal_kinematic.so in the lcnc/rtlib. Also the next.so has to be copied over there. Next.so is a c++ helper library wich contains the kdl source.

do you have anything for probing?
No. But we have a component template to write this probe function.

github.com/grotius-cnc/hal-core/blob/mai...mponents/test/test.c
Line 82:
static void the_function(){
     if(pin_search==1){
         move_x_plus=1;
     }
     if(myprobe==1){
         // We get a signal
         save_x_pos=currentpos-tooldiameter
     }
} etc, etc.

A totally different option is to use github.com/grotius-cnc/skynet_robot_cont.../releases/tag/1.0.24
This is a teach in program for robots and can teach-in and follow arc's etc in 3d. It outputs textfiles that are streamed to hal.
Also this program makes jogging easy. It's liked multiple times by other githubbers.
But again at that time i didn't managed to get a robot move realtime. That is now solved so streaming can be replaced by realtime
hal components that work with c++ helper libs.

xxxhttps://user-images.githubusercontent.com/44880102/122229068-6e83c100-ce86-11eb-9814-1199550dd265.mp4


















 
Last edit: 25 Oct 2021 21:21 by Grotius.

Please Log in or Create an account to join the conversation.

More
25 Oct 2021 21:11 #224298 by Grotius
Replied by Grotius on topic hal-core
For the hal-core motion planner i have made a little programming strategy.
For the ones who are interested.
Warning: Spoiler!

 

Please Log in or Create an account to join the conversation.

More
25 Oct 2021 21:35 #224301 by Dave3891
Replied by Dave3891 on topic hal-core
Hi Grotius,

This machine will be used for heat exchanger tube end welds, I have seen the polysoude machines before and used a similar setup. Pretty interesting that you have done something similar before, I will defiantly be picking you brain for information :)

My current robot setup is a Fanuc arcmate that I changed the motors to regular servos and connected it to a MESA ethernet interface card. We made the welding head from scratch and are currently working on a new revision.

One quick question, I was going through your post on compiling HAL components with QT, you have a include and lib directory in your hal-core directory in the pictures, but I don't seem to have one with the hal-core from github. Do I need to do a full compile of linuxcnc to get these include/lib directories?

Here is a picture of the robot (pretty dirty as the project has been on hold a little while haha) and one of the test welds the robot did before.

 
 
 
Attachments:

Please Log in or Create an account to join the conversation.

More
25 Oct 2021 21:56 - 25 Oct 2021 21:59 #224302 by Grotius
Replied by Grotius on topic hal-core
Hi,

The directory structure of hal-core is slighty different then lcnc.
Lcnc has /include dirs. Hal-core uses the /src dir if it nees more info.

Do I need to do a full compile of linuxcnc to get these include/lib directories?
No, you don't need it. You only need lcnc if you want to simulate the robot with lcnc. hal_trajectory can be compiled with lcnc halcompile.
But later on halcompile is not used anymore. Now we use gcc (compiler) directly without a python script between it. That also makes it
more ultimate. We have seen that with compiling rpi4 ethercat hal drivers with gcc.

If you want to compile mesa source files. These are currently not present in hal-core.
But they have to be copied into the /hal-core/rtlib. Wich mesa drivers do you need to load?

If you can provide a 3d stepfile of the robot with your current tool eventually in welding position.
I can make a simulation for you.

You can make a qt c++ gui for parametric heat exchanger input. That i can use to send data to the robot.
But it may be also a dxf drawing of the welding paths.





 
Last edit: 25 Oct 2021 21:59 by Grotius.

Please Log in or Create an account to join the conversation.

More
25 Oct 2021 22:06 - 25 Oct 2021 22:08 #224303 by Grotius
Replied by Grotius on topic hal-core
Edit,

The qt halcompile example on this forum is suitable when using it in combination with lcnc.
For hal-core just use the compile script from the github source.
For example, compile the test.c file to test.so with : github.com/grotius-cnc/hal-core/blob/mai...components/test/make
Last edit: 25 Oct 2021 22:08 by Grotius.

Please Log in or Create an account to join the conversation.

More
25 Oct 2021 22:09 #224304 by Dave3891
Replied by Dave3891 on topic hal-core
Hi,
I just got the test hal component to compile and run with the runtest script in QT, so far so good.

The makefile that was included has COMP set to halcompile, it there a newer makefile that uses gcc?

I will take a look at your 3d stepfile and see if I can put something together in blender for my robot.

I think I only need the hostmot2 and hm2_eth drivers for the mesa interface

Please Log in or Create an account to join the conversation.

More
25 Oct 2021 22:23 #224307 by Dave3891
Replied by Dave3891 on topic hal-core
Hi,
I used that new makefile and everything is looking good, thanks!

Please Log in or Create an account to join the conversation.

Time to create page: 0.307 seconds
Powered by Kunena Forum