Compiling probekins and using probe2stl

More
16 Feb 2013 01:00 #30130 by alan_3301
Hi, I have searched but haven't been able to help myself, so I hope someone can help me out.

First I am trying to get probekins module ready for use so I can test it out.
I have downloaded from Here the following files:
probe2stl.py
probekins.c
probekins.h
stlcorr.py
stltool.py
stlvis.py
I also downloaded voronoi.py not sure where from though.
all the .py files were made to be executable.

Im not sure how to compile probekins. I copied probekins.h to /usr/include/linuxcnc
and tried to compile like so
alan@alan-cnc:~/Desktop/probekins$ gcc -I/usr/include/linuxcnc probekins.c
/usr/lib/gcc/i486-linux-gnu/4.4.3/../../../../lib/crt1.o: In function `_start':
(.text+0x18): undefined reference to `main'
collect2: ld returned 1 exit status
So I am stuck here.

As far as probe2stl I am getting the error:
alan@alan-cnc:~/Desktop/probekins$ ./probe2stl.py <probe-results.ngc >probe.stl
Traceback (most recent call last):
  File "./probe2stl.py", line 88, in <module>
    main()
  File "./probe2stl.py", line 61, in main
    points = readpoints()
  File "./probe2stl.py", line 45, in readpoints
    p = map(float,l.split()[0:3])
ValueError: invalid literal for float(): X0.000000

I removed all the G1 commands from the probe file, before I did that I was getting "ValueError: invalid literal for float(): G1"

Am I missing something simple?
Thanks.

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

More
16 Feb 2013 04:44 - 16 Feb 2013 04:45 #30154 by alan_3301
Ok the problem with probe2stl I was having was caused by the axis letters in the file. I removed them all and it works without error.
I also had to install python-matplotlib. (first error I was getting for stlvis.py)

Now I am trying to get stlvis.py working
Here is where I am
alan@alan-cnc:~/Desktop/probekins$ ./probe2stl.py <probe.txt | ./stlvis.py -b 0,0,254,254
Traceback (most recent call last):
  File "./stlvis.py", line 47, in <module>
    main()
  File "./stlvis.py", line 40, in main
    pp.tricontourf(x,y, z,256)
AttributeError: 'module' object has no attribute 'tricontourf'

I am probably just missing a whole bunch of dependencies/librarys but I didn't see any prerequisites on the probekins page.
Last edit: 16 Feb 2013 04:45 by alan_3301.

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

More
16 Feb 2013 05:15 #30155 by alan_3301
Ok, making some progress here.
I don't know how I missed the dependencies section of the probekins page, but I think I can figure it out from here.

Just had to talk it through.

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

More
21 Feb 2013 02:28 #30377 by alan_3301
Ok i found I have to use comp to compile probekins.
sudo comp --install probekins.c
that will compile and copy probekins module to correct place.

Now I am trying to figure out my next round of errors.
with linuxcnc running I get the error
alan@alan-cnc:~/Desktop/probekins$ ./stlcorr.py --load probe.stl
Traceback (most recent call last):
  File "./stlcorr.py", line 171, in <module>
    main()
  File "./stlcorr.py", line 129, in main
    b = get_buffer()
  File "./stlcorr.py", line 81, in get_buffer
    sm = hal.shm(c,key)
TypeError: function takes exactly 3 arguments (2 given)

a search of hal.shm show it takes 3 arguments. component, key, size.
if stlcorr.py the first 2 args are there. Im guessing the size=2048 is supposed to go to that third agument somehow.

I changed to file like so:
def get_buffer():
    c = hal.component("notused")
    sm = hal.shm(c,key,size)
    return sm.getbuffer()
and at the top of the file after the imports, I added
size = 2048

Now I have the error (luckily!)
raise Exception, "Buffer too small, have %d need %d" % (len(b),req)
Exception: Buffer too small, have 2048 need 6104

changed size in the HAL and the .py file to 14400
not sure how large of a stl that will handle, but I can change later if need be.
It works now!

Hope this helps somebody!

stlvis is now working with:
alan@alan-cnc:~/Desktop/probekins$ ./stlvis.py -b 0,0,9.5,3 probe.stl


On this page, wiki.linuxcnc.org/cgi-bin/wiki.pl?LockedMemory It tells to ad "* - memlock 20480" to /etc/security/limits.conf
It was already there though. It also says to add a line to /etc/pam.d/common-session if you have lucid 10.10, I have 10.04.
I added the line with no change, then returned it back to how it was.



A side note, with probekins module loaded, axis shows joint 0, 1 2 instead of X Y Z, I'm guessing I have to dig study probekins.c and trivkins.c to figure out how to get it to display as it was? Or has anyone figured this out yet.
Attachments:

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

More
21 Feb 2013 02:35 - 21 Feb 2013 02:39 #30381 by alan_3301
And I see now that axis defaults to joint mode with probekins. You have to home all axes then hit $ to switch to world mode.
Then the axes will display.

Edit:

When in world mode, I get following errors when jogging any axis.
I will have to keep using trivkins, unless someone can help me with this.
Not sure where to start trying to figure this one out.
Last edit: 21 Feb 2013 02:39 by alan_3301.

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

More
21 Feb 2013 02:55 #30386 by alan_3301
Sorry for the many postings.

I have upped FERROR and MIN_FERROR to 0.2 and 0.05 respectively
Still getting following errors.
I will attach the ini and hal files
I never got a following error with trivkins.

Any ideas?
Thanks!
Attachments:

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

More
21 Feb 2013 03:20 #30388 by alan_3301
Ok, some more info.
I changed FERROR to 1 and MIN_FERROR to 0.5

Following errors are gone, however accelleration seems way to high.
On jogging at high speeds, the machine can be seen to overshoot, and then go back a little.

Is the accelleration defined in the INI treated differently when using probekins?
Im trying to wrap my head around the source code to see if I can figure out anything.

I guess I will try next to put the FERROR and MIN_FERROR back where it was, then reduce acceleration in the INI to approximate how it was with trivkins?

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

More
21 Feb 2013 04:19 #30390 by cncbasher
i'll admit to guessing ... that as it's not using g1 moves etc , then it's based on the max acceleration settings in the INI

i'm interested in how you get on , i'll try it here shortly

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

More
21 Feb 2013 05:41 - 25 Jul 2014 02:29 #30391 by alan_3301
Ok I don't know if the increased ferror was allowing acceleration to go beyond what I specified, but starting from the beginning.
With a known working setup, If i change trivkins for probekins.

acceleration now seems correct.
Homing, MDI and gcode works as it should with no following errors.
jogging at any speed in joint mode works as it should with no following errors.
jogging at any speed in world mode above 77 ipm will cause a following error. sometimes a little more or less speed.
After a ferror has occured, a jog at any speed will continue to cause ferrors.
After that:
with a 10ipm jog speed, any axis jogged will cause the original axis that had an ferror to move slightly (at the original, too fast jog speed), but then stop with a following error almost instantly. The velocity shown in axis at this point is the jog speed of the move that caused the following error.
If hit f2, and continue jog,error,jog,error until the original jog is completed (the one that was too fast and caused a F error), then it will stop giving following errors and allow me to jog any axis at the previously selected lower jog speed.

I guess this is all normal (except the first following error) as it is trying to get where it was told to go, at too high a velocity, and continues giving following errors, until it gets to the end of the failed jog.

I noticed that movement will no longer stop when a probe is tripped during a jog - In world mode. No warning message also.
probe tripped during jog in joint mode works as it should and stops motion.
probe tripped during MDI moves will stop motion and bring up message.

Hope that was understandable, and I know it is not the best way of troubleshooting to be overzealous changing settings.
I will continue tinkering and hopefully come to a solution eventually.

cncbasher, I thought that max_acceleration was the only setting for each axis acceleration.
Do you mean that there is another value somewhere that governs acceleration for all axes?

Aside from the visual difference of showing joint0,1,2 instead of axis x,y,z. Is there any reason I need to be using world mode?
I guess I can use the machine as I was with joint mode. It would be nice to figure it all out though.

Thanks for the help.
Last edit: 25 Jul 2014 02:29 by alan_3301.

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

More
21 Feb 2013 08:36 #30393 by alan_3301
osdir.com/ml/emc-users-enhanced-machine-...012-08/msg00462.html
came across the thread on the user list. Same symptoms I am having from someone with gantrykins.
I will follow the advice in this thread and see what happens tomorrow.

Also I need to remember to switch to world mode immediately after homing. No jogging in joint mode.
I read that is proper procedure, and I'm not sure if I have been jogging or not before switching to world mode.

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

Time to create page: 0.099 seconds
Powered by Kunena Forum