Tripod (inverted) setup

More
13 Aug 2010 13:04 #3730 by dab77
Hi everyone!
I've almost done my work on inverted bipod...
...now i have to go on adding a leg!

fortunately there's already a tripodkins.c file in the source, but i've a little problem.

i think one has to set bx, cx and cy manually in the c file, but i'm not so good with structs and pointers.

this is the initial part of interesting code:
...
#include "hal.h"
struct haldata {
    hal_float_t *bx, *cx, *cy;
} *haldata = 0;

#define Bx (*(haldata->bx))
#define Cx (*(haldata->cx))
#define Cy (*(haldata->cy))
...

and that's how i tryed to change:
...
#include "hal.h"
struct haldata {
    hal_float_t *bx, *cx, *cy;
} *haldata = {2000 , 2000 , -2800};

#define Bx (*(haldata->bx))
#define Cx (*(haldata->cx))
#define Cy (*(haldata->cy))
...
but i'm not sure it's well done, 'cause when compiling i've this:
dab-cnc@dab-cnc-desktop:~$ sudo comp --compile tripodkins.c[sudo] password for dab-cnc: 
make -C /usr/src/linux-headers-2.6.24-16-rtai SUBDIRS=`pwd` CC=gcc V=0 -o /Module.symvers modules
make[1]: ingresso nella directory «/usr/src/linux-headers-2.6.24-16-rtai»
  CC [M]  /tmp/tmpuPBqYC/tripodkins.o
/tmp/tmpuPBqYC/tripodkins.c:78: warning: initialization makes pointer from integer without a cast
/tmp/tmpuPBqYC/tripodkins.c:78: warning: excess elements in scalar initializer
/tmp/tmpuPBqYC/tripodkins.c:78: warning: (near initialization for ‘haldata’)
/tmp/tmpuPBqYC/tripodkins.c:78: warning: excess elements in scalar initializer
/tmp/tmpuPBqYC/tripodkins.c:78: warning: (near initialization for ‘haldata’)
  Building modules, stage 2.
  MODPOST 1 modules
WARNING: "hal_init" [/tmp/tmpuPBqYC/tripodkins.ko] undefined!
WARNING: "hal_exit" [/tmp/tmpuPBqYC/tripodkins.ko] undefined!
WARNING: "hal_malloc" [/tmp/tmpuPBqYC/tripodkins.ko] undefined!
WARNING: "hal_pin_float_new" [/tmp/tmpuPBqYC/tripodkins.ko] undefined!
WARNING: "hal_ready" [/tmp/tmpuPBqYC/tripodkins.ko] undefined!
  CC      /tmp/tmpuPBqYC/tripodkins.mod.o
  LD [M]  /tmp/tmpuPBqYC/tripodkins.ko
make[1]: uscita dalla directory «/usr/src/linux-headers-2.6.24-16-rtai»
dab-cnc@dab-cnc-desktop:~$

can you help me, please?

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

More
13 Aug 2010 17:29 #3731 by step4linux
hi
*haldata is pointer, not a structure
so *haldata = {2000 , 2000 , -2800}; is wrong.

typically you will assign memory by haldata = hal_malloc(sizeof(*haldata));

and then use haldata->bx = 2000

regards, Gerd

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

More
17 Aug 2010 08:15 #3783 by andypugh
Replied by andypugh on topic Re:Tripod (inverted) setup
dab77 wrote:

i think one has to set bx, cx and cy manually in the c file, but i'm not so good with structs and pointers.


That is incorrect, tripodkins creates three HAL pins for those dimensions. You would set them to the right values in HAL.
You need to add the following to your HAL file somewhere after the loadrt tripodkins line. (and leave the kinematics file as-is)

setp tripodkins.Bx 2000
setp tripodkins.Cx 2000
setp tripodkins.Cy -2800

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

More
22 Aug 2010 20:11 #3845 by dab77
Replied by dab77 on topic Re:Tripod (inverted) setup
Thanks for both needful answers!
didn't replay soon 'couse traveling.
tomorrow will try. thanks a lot!

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

More
23 Aug 2010 09:59 #3849 by dab77
Replied by dab77 on topic Re:Tripod (inverted) setup
YESSSSS!!!
the tripod kinematics work well too!!

i've a little issue i'm not sure how to solve, before going to set up my tetrapod kins..: either with tripod and bipod kins, as i turn into world mode, when i move toward -Z (that for me is toward the ground) the drawing is going down, but the real movement is going up, until it reaches the highest point and then goes down again, this time correctly. that behaving is ok, but i would like that as first it would go correctly in the right direction. in fact if going in the right direction, than change to joint mode and againg to world mode, the picture takes the wrong position (mirrored over the zero line..) and Z direction is back wrong.

don't know if i explained the problem, my english is not so good, but if you know the problem, can you help me?
thanks again!
Davide.

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

More
23 Aug 2010 13:19 #3853 by andypugh
Replied by andypugh on topic Re:Tripod (inverted) setup
dab77 wrote:

i've a little issue i'm not sure how to solve, before going to set up my tetrapod kins..: either with tripod and bipod kins, as i turn into world mode, when i move toward -Z (that for me is toward the ground) the drawing is going down, but the real movement is going up,.


You can invert the AXIS preview in the INI file:
GEOMETRY = XY-Z

See: linuxcnc.org/docs/2.3/html/config_ini_co...5BDISPLAY%5D-section

I suspect that this is an answer to a different question than the one you asked though....

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

More
23 Aug 2010 21:20 #3855 by dab77
Replied by dab77 on topic Re:Tripod (inverted) setup
going to try, but i don't think that's the problem..

by the way, i finally set up my INVERTED TETRAPOD, with a good result ! played manually, and played some g-code 3d splines perfectly, moving around 15-20k mm/min.
dimensions are now those of my working-room, so around 2 x 3 x 3 meters..

so thanks again, i'm going to study more of EMC2, and will be back here with more questions!!
next things will be virtual panel, and joystick!!:unsure:

hi!B)

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

More
26 Aug 2010 20:00 #3891 by dab77
Replied by dab77 on topic Re:Tripod (inverted) setup
hallo, i think the problem of the inverted Z, is that the vertex of the pyramid is above the XY plane.
i understood this is governed by the value of fflags, and in fact into tripodkins.c i've found this:
inverse = 0;			/* forwards, by default */
  flags = 0;			/* didn't provide flags */
  fflags = 0;			/* above xy plane, by default */

but if i change the value of fflags to 1, recompile and mv the .ko module, the result however is a pyramid with vertex above the plane.

how can i set that fflags?

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

More
17 Dec 2010 10:23 #6093 by dab77
Replied by dab77 on topic Re:Tripod (inverted) setup
i write here just for explaining the problem of the Z direction, which i've found finally what was the issue.
as soon as you turn into world mode the vertex for emc2 is above the plane, while for an inverted bipod/tripod/tetrapod of course you need that below, but if you change again to joint mode and then back to world mode, the vertex is magically below the plane!
that's because the declaration of the fflags sits into the forward kin section, so the first time you change to world mode is not yet read.
thanks again, ciao!

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

Time to create page: 0.160 seconds
Powered by Kunena Forum