Joint Following Error(Kinematic HAL Included)

More
31 May 2015 12:55 #59259 by furkanyilmaz11
Hi everybody,

I am trying to use linuxcnc for my delta robot. I am using parallel port with breakout board.

I installed my kinematics file written in c format. Its looking algorithm is working well and everything installed correctly. I can jogging my motors in joint jog mode. And motors working correctly. But when I try to use xyz coordinate mode there is an error about following.

Here is a complete error:
joint 0 following error.
joint 1 following error.
joint 2 following error.

But I am taking this error just when I try to use jog in xyz world coordinates($ button using to change) or try to move machine with mdi g-code. I changed to ferror and min ferror parameters from .ini file but it didnt work. So If I can joging well in joint mode and If I take this error in just xyz mode I think its not about ferror and min ferror parameters.

Note: Linuxcnc looking little bit more slower after I installed the kinematic algorithm.

But I have no idea about where is the problem. Is there an any way to disable ferror?


What should I do?Or what do you suggest? Waiting for replies...


I attached my config files...

Sorry about my bad english...
Thanks in advance.
Attachments:

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

More
01 Jun 2015 07:22 #59287 by andypugh

But I have no idea about where is the problem. Is there an any way to disable ferror?


Yes, and it might help to see what is going wrong.

If you connect the axis position command pin directly to the axis feedback pin in HAL then the normal f-error checking is bypassed.

However, the fact that you have set wide f-error limits and it didn't help probably means that the kinematics is returning nonsense values. Is there any chance that it is dividing by zero somewhere, for example?
The following user(s) said Thank You: furkanyilmaz11

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

More
01 Jun 2015 19:47 #59305 by furkanyilmaz11

But I have no idea about where is the problem. Is there an any way to disable ferror?

Yes, and it might help to see what is going wrong.

If you connect the axis position command pin directly to the axis feedback pin in HAL then the normal f-error checking is bypassed.


Ok but how can I connect the axis position command pin directly to the axis feedback pin in HAL?

But I have no idea about where is the problem. Is there an any way to disable ferror?

However, the fact that you have set wide f-error limits and it didn't help probably means that the kinematics is returning nonsense values. Is there any chance that it is dividing by zero somewhere, for example?


I think no. But I am not sure but I just take look the .c file. Looking fine. And this algorithm is already working one I think.
But maybe algorithm want to move joints too fast and joints isnt moving in this speeds. Thats what I thought. But I think we will learn after disable the ferror values and just watch whats goin on.

How to connect axis pos command pin to axis feedback pin in HAL?

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

More
01 Jun 2015 20:08 #59306 by andypugh

How to connect axis pos command pin to axis feedback pin in HAL?


net somesignalname axis.N.motor-pos-cmd axis.N.motor-pos-fb

basically

But exactly how that will look in your HAL config is something that only you can know. You probably just need to comment out one HAL line which connects the feedback to a signal and add a new line which connects the feedback to the same signal as the command.

So, if you had
net x-cmd axis.0.motor-pos-cmd => stepgen.0.position-cmd
...
net x-fb  axis.0.motor-pos-fb <= stepgen.0.position-fb
You could edit it to look like
net x-cmd axis.0.motor-pos-cmd => stepgen.0.position-cmd
...
#net x-fb  axis.0.motor-pos-fb <= stepgen.0.position-fb
net x-cmd axis.0.motor-pos-fb

And if you can't see _why_ that works you really need to read the HAL manuals before trying to configure a machine with wacky kinematics
The following user(s) said Thank You: furkanyilmaz11

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

More
01 Jun 2015 20:25 #59307 by andypugh

I think no. But I am not sure but I just take look the .c file. Looking fine.


Well, yes and no. If dnm or a are zero then the positions will become NaN and you will get an f-error.

There are clearly values for the intermedate values that can return zero for a and dnm.

I don't see any place in your HAL file where you set up the joint lengths so they will all have the default value if 1.0 (mm?)


So, as a first step, set our joint lengths and see if that helps. I think that a delta robot with all lengths = 1.0 might be unable to move, or might have a working volume less than 1 cubic mm.
The following user(s) said Thank You: furkanyilmaz11

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

More
01 Jun 2015 22:03 #59310 by furkanyilmaz11

I think no. But I am not sure but I just take look the .c file. Looking fine.


Well, yes and no. If dnm or a are zero then the positions will become NaN and you will get an f-error.

There are clearly values for the intermedate values that can return zero for a and dnm.

I don't see any place in your HAL file where you set up the joint lengths so they will all have the default value if 1.0 (mm?)


So, as a first step, set our joint lengths and see if that helps. I think that a delta robot with all lengths = 1.0 might be unable to move, or might have a working volume less than 1 cubic mm.


Andy thank you so much because of your helps.

Yes you are right, I must read the HAL manual but its really hard to understand for me. But I am solving the HAL files with little bits. So the HAL is very large thing and I need to make it smaller parts and maybe I can understand it completely.
So right now I am working for understand HAL. But I need more time and help to completely understand HAL...

In my C file I am defining the joints lengths so re, rf if you mean this. But If you mean max degree of joints there are no joints in hal. There are just XYZ axises right?

I think I know very important thing to understand my problem. Linuxcnc working unstable! So after I install my kinematic file its working different. For example when I enter a g00x120, its firstly going to somewhere between 0-120 and waiting few second and going 120. I think this problem trying to tell us something. And another thing is sometime joint follow error is coming but sometimes for same movement there are no joint follow error. My motors currently working in joint jog mode but it is not moving in world coordinate jog mode. In XYZ coordinate world mode sometmes I can jogging and there are no errors but after jogging is finished axis dro getting 0! So in graphical machine preview machine is looking in x120 for example but dro is getting zero after jogging or g-code movement completed!

I dont know anythink about whats wrong in this kinematic file or Idk is there an any wrong thing but as I read I just need to setup the arms lengths in c file. After it will work nicely. And there are no complete manual for delta robot with linuxcnc. But so much people did it and I know one the best way to control delta robot is linuxcnc.

So I shared all files of my linuxcnc could you check them? I really spent so much for this project and I really need to solve my problem about controlling software.
My brain is gonna be overheated soon. Because there are so much nonsense things about linuxcnc. Waiting for your suggests.


And about configuring the hal file. I think that was bad idea because it wont solve my problem or help to solve my problem. Because its looking so much differnt problem, so problem is not about ferror values. But I am trying to understand hal and I want to know really how to connect axis pos command to axis fb pin to understand some more thing about HAL. So here is my hal codes about feedback. And its not same as your example could you fix this to help me to learn hal.
net xpos-cmd axis.0.motor-pos-cmd => stepgen.0.position-cmd
net xpos-fb stepgen.0.position-fb => axis.0.motor-pos-fb
net xstep <= stepgen.0.step
net xdir <= stepgen.0.dir
net xenable axis.0.amp-enable-out => stepgen.0.enable


So andy I am gonna learn at the final but I need helpful people like you. Thank you very very much and I am looking for your reply...

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

More
01 Jun 2015 22:20 #59311 by andypugh

Yes you are right, I must read the HAL manual but its really hard to understand for me. But I am solving the HAL files with little bits. So the HAL is very large thing and I need to make it smaller parts and maybe I can understand it completely.


All you need at the moment is to know how "net" works.

It is " net signal pin pin pin pin" All the pins connected to signal will have the same numerical value. You can have one or more pins in any net statement, and you can use the same signal name in as many net statements (and in as many files) as you like. Only one pin in the net can be a pin that supplies a value (a HAL "output" pin). Be aware that parallel port input pins are HAL output pins, because they supply a value.

In my C file I am defining the joints lengths so re, rf if you mean this.


I do mean that, and I don't think you are doing that. I have looked at the deltakins.c file in the config you supplied, and I don't see the values being set.

It does no harm to add the lines to the HAL file to define the lengths, why not try it?

setp deltakins.e 100
setp deltakins.f 120
setp deltakins.re 50
setp deltakins.rf 175

(or whatever)

Linuxcnc working unstable! So after I install my kinematic file its working different. For example when I enter a g00x120, its firstly going to somewhere between 0-120 and waiting few second and going 120

Do you know for sure that the deltakins.c file works properly? Be aware that it isn't part of LinuxCNC so does not get any testing like the rest of LinuxCNC does.

I dont know anythink about whats wrong in this kinematic file or Idk is there an any wrong thing but as I read I just need to setup the arms lengths in c file.


In which C file do you think you have done this? The ZIP file you posted contains 3 separate instances od deltakins.c, but they all appear to be reading the part lengths from the HAL pins.
The following user(s) said Thank You: furkanyilmaz11

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

More
01 Jun 2015 23:11 #59313 by furkanyilmaz11

In my C file I am defining the joints lengths so re, rf if you mean this.


I do mean that, and I don't think you are doing that. I have looked at the deltakins.c file in the config you supplied, and I don't see the values being set.

It does no harm to add the lines to the HAL file to define the lengths, why not try it?

setp deltakins.e 100
setp deltakins.f 120
setp deltakins.re 50
setp deltakins.rf 175

(or whatever)

Linuxcnc working unstable! So after I install my kinematic file its working different. For example when I enter a g00x120, its firstly going to somewhere between 0-120 and waiting few second and going 120

Do you know for sure that the deltakins.c file works properly? Be aware that it isn't part of LinuxCNC so does not get any testing like the rest of LinuxCNC does.

I dont know anythink about whats wrong in this kinematic file or Idk is there an any wrong thing but as I read I just need to setup the arms lengths in c file.


In which C file do you think you have done this? The ZIP file you posted contains 3 separate instances od deltakins.c, but they all appear to be reading the part lengths from the HAL pins.


Haha :lol:

That isnt defined, its comment line! :) In my C code for mcu, lengths was defined. And I see there are f, rf, etc. has a value and skip there :). But I am seeing that was a comment line. I am so sorry because of it.

So I tried to add lines to define e, f, re, rf. In few different ways. But with all lines I added gave me an error when I starting linuxcnc.

I tried that lines. And it didnt work. How should I add this variables?
setp deltakins.e 100
setp deltakins.f 120
setp deltakins.re 50
setp deltakins.rf 175
setp delta_e 100
setp delta_f
.......
e = 100;
...
setp e 115
setp f 450


So how should I add the variable's value in the hal file?

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

More
01 Jun 2015 23:15 #59314 by andypugh
You can't set the values until after the "loadrt deltakins" line.
But at that point it should be "setp deltakins.e 100" as I said.

You can check this by removing the new lines, starting linuxCNC, then opening the "show hal configuration" window to see what the deltakins pins are called.
The following user(s) said Thank You: furkanyilmaz11

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

More
01 Jun 2015 23:42 #59316 by furkanyilmaz11

You can't set the values until after the "loadrt deltakins" line.
But at that point it should be "setp deltakins.e 100" as I said.

You can check this by removing the new lines, starting linuxCNC, then opening the "show hal configuration" window to see what the deltakins pins are called.


Andy finally its working!!! :laugh:

Your codes was right. I add them after loadrt deltakins line and it worked!I can moving axes in xyz jog mode. And when I am moving z all leds of motor pulse/dir looking sending a signal. So its looking perfect. But after around 27 mms joint following error. But I think its about the area of delta robot. So its looking fine. I am gonna connect other 2 servos and try everything about the software. I will write the results again after all tests done.

If everything is ok in this type of configuration, next target is configuration with encoder feedbacks to linuxcnc...

Andy Thank you so much again!! And one more time thank youu :)

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

Time to create page: 0.111 seconds
Powered by Kunena Forum