Compiling probekins and using probe2stl

More
22 Feb 2013 19:39 #30445 by alan_3301
I took the advise of the link i posted and added to the ini.
[TRAJ]
DEFAULT_ACCELERATION = 50

I haven't had time to power up the steppers and test, but no following errors in axis anymore. Tested up to 1000ipm.
I do wish I could have seperate accelerations for each axis, as my X and Z are capable of much more than my Y.
I'll take the tradeoff of being able to compensate for uneven z depth now though. It is nice.

Now I need to figure out how to get motion to stop when a probe is tripped in world mode while jogging.
I dont have the linuxcnc-dev installed on my laptop, where my simulation is, because it wants to uninstall sim to install dev packages.
So i am reading through the source online.

What I have been reading is line 367-440 of the following link.
www.gitorious.org/emc-rt-preempt/emc-rt-...emc/motion/control.c

I'm not totally sure if that is even the right file to be looking it, I see that page is for a emc-rt-preempt project, but thats all I could find at first.
Now I am seeing that that part is mostly the same as motctl.c that I am seeing while searching.
Should I just file a bug report?

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

More
25 Feb 2013 04:48 #30541 by andypugh

Is the accelleration defined in the INI treated differently when using probekins?

Yes, and this is the same with any non-trivial kinematics (though I _thought_ that probekins was trivial)
In World mode the acceleration and velocity limits are not set by the AXIS limits, but the TRAJ limits.
www.linuxcnc.org/docs/html/config/ini_co...d_sub_traj_section_a

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

More
05 Mar 2013 00:23 #30856 by alan_3301
Back on this now. I have everything set up and working, except then my z correction is going the wrong way.
I use a gcode to probe a surface, storing the coordinates in probe.txt
probe2stl then converts to a stl, and then loads into memory.
there is a pin delta-z that corrects the Z based on the stl in memory.
I have setup a tilted piece of aluminum as my surface, highest on the left, and low on the right.
I touch off on the left side @ Z0. delta-z agrees with this as it is 0 at my starting point.
when I jog over to the right side, delta-z reads as it should with the value decreasing, however the Z axis will move up instead of down??

I have edited probekins.c to try and reverse the direction like so:
In function static inline double z_correct(double x, double y)
changed:
*(haldata->delta_z) = t;
return t;

to:
negt = 0-t;
*(haldata->delta_z) = negt;
return negt;

(have also tried)
negt = 0-t;
*(haldata->delta_z) = t;
return negt;

(also tried)
negt = 0-t;
*(haldata->delta_z) = negt;
return t;

I've also tried swapping the + and - in inverse and forward kinematics in the following 2 lines.
pos->tran.z = joints[2] + (*(haldata->enable) ? z_correct(joints[0], joints[1]) : 0.0);
joints[2] = pos->tran.z - (*(haldata->enable) ? z_correct(pos->tran.x, pos->tran.y) : 0.0);

I've also tried making both of those changes together, all with the same result!
with a negative delta-z the axis moves in a positive direction.

I know this is all probably hard to follow without being familiar with probekins, but wondering if anyone has any ideas?
I will be posting up all my configs to make it easier for anyone who wants to use this,
as it will be really helpful for carving warped wood, or engraving pcb's perfectly flat.

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

More
05 Mar 2013 00:30 #30857 by cncbasher
just a thought , until I can try all this out , but ...

did you have to reverse your z axis in you hal file ? , if yes then it may be worth swapping it back , and changing the motor connections to then have the motor running correctly .
i'm thinking that probekins works at a lower level , and is conflicting the z axis move .

if not then disregard this rambling .. for now

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

More
05 Mar 2013 00:43 #30859 by andypugh

negt = 0-t;
*(haldata->delta_z) = negt;
return negt;


There is no need for the extra variable (and there will be trouble if you fail to declare it).
C supports the "unary minus" operator (As does LinuxCNC G-code, but not typical G-code)

*(haldata->delta_z) = -t;

Ought to work.
Are you sure that your changes are compiling and working correctly? It can be surprisingly hard to tell.

Is your Z axis set up with higher numbers at the top and lower numbers at the bottom? That is the convention, and may be assumed by probekins.

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

More
05 Mar 2013 05:49 #30882 by alan_3301
Thank you both! Andy you had it right.
I was changing what was in /usr/realtime-2.6.32-122-rtai/modules/linuxcnc/ but it was looking at the copy in ~/linuxcnc-dev/rtlib/
To get delta-z to read right, and the machine to move right the lines for me ended up as:
*(haldata->delta_z) = t;
return -t;


Ill follow up later.

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

More
07 Mar 2013 04:36 #30990 by alan_3301
Here are my files if anyone wants to try.
README is in this zip.
let me know if you have problems or questions.
Attachments:

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

More
31 Mar 2013 20:22 #32124 by slacker247
Hi,

I've been following this post and trying to setup the probekins module with no luck. The problem I'm facing is with compiling probekins.

I keep getting this error:
make KBUILD_EXTRA_SYMBOLS=/usr/realtime-2.6.32-122-rtai/modules/linuxcnc/Module.symvers -C /usr/src/linux-headers-2.6.32-122-rtai SUBDIRS=`pwd` CC=gcc V=0 modules
make[1]: Entering directory `/usr/src/linux-headers-2.6.32-122-rtai'
  CC [M]  /tmp/tmpwZSU3j/probekins.o
/tmp/tmpwZSU3j/probekins.c: In function ‘z_correct’:
/tmp/tmpwZSU3j/probekins.c:107: warning: ISO C90 forbids mixed declarations and code
  Building modules, stage 2.
  MODPOST 1 modules
WARNING: "__divdi3" [/tmp/tmpwZSU3j/probekins.ko] undefined!
  CC      /tmp/tmpwZSU3j/probekins.mod.o
  LD [M]  /tmp/tmpwZSU3j/probekins.ko
make[1]: Leaving directory `/usr/src/linux-headers-2.6.32-122-rtai'
cp probekins.ko /usr/realtime-2.6.32-122-rtai/modules/linuxcnc/

Also, I downloaded the files you posted and I get this error when launching LinuxCNC:
insmod: error inserting'/user/realtime-2.6.32-122-rtai/modules/linuxcnc/probekins.ko': -1 Unknown symbol in module.

btw, Thanks for creating this thread.

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

More
31 Mar 2013 23:23 #32126 by andypugh

Hi,

I've been following this post and trying to setup the probekins module with no luck. The problem I'm facing is with compiling probekins.

I keep getting this error:
cp probekins.ko /usr/realtime-2.6.32-122-rtai/modules/linuxcnc/


This part means that it has worked, the other output is warnings, not errors as such.

I am not sure it will work, though. There is something funny going on, as line 107 isn't a declaration, and __divdi3 doesn't (directly) feature in the code.

The module compiles without errors for me, so I am not sure what is wrong in your case. It might be best to make sure you run comp from the same directory as the .c and .h files are found in.

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

More
01 Apr 2013 05:01 #32136 by alan_3301
How were you compiling it?
I had no luck with gcc or make.
in the directory with probekins.c and probekins.h, Do:
sudo comp --install probekins.c
anyways, at the end of your log it copied the module to the correct place. So it should be ok to go.

I don't know if it's common to distribute compiled modules, so I don't know if we should expect my compiled copy to work on your computer.
I didnt think about that before.

With your compiled copy, does it give the same "unknown symbol" error?

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

Time to create page: 0.101 seconds
Powered by Kunena Forum