4th axis tangent to path XY

More
15 years 1 month ago #13303 by ioiotutu
Hi,
I compiled the file following your instructions and the kinematics move A axis automatically!

The angle was in radiant so i changed angle calculation on the file (see the attached file).



Is it possible lock and unlock the A axis runtime?
I mean, start the program normally withouth A automatically moved and activate the angle automatic movement only in some parts of the program.


In the next few days i can test the kinematics on a real machine.

Thanks.

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

More
15 years 1 month ago #13304 by ioiotutu
Modified file.

Sorry.

Attachment tangentkins-dea718dae1772d296db46b96caa05dae.zip not found

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

More
15 years 1 month ago - 15 years 1 month ago #13311 by andypugh
ioiotutu wrote:

Is it possible lock and unlock the A axis runtime?
I mean, start the program normally withouth A automatically moved and activate the angle automatic movement only in some parts of the program.


Yes. You would need to create a HAL pin in the rtpi_app_main function, then link that pin to something in the HAL file (motion.spindle-on would work, but remember that you need to have S > 0 for M3 to change the value of that pin) then modify the kinematics code to act on the value of that pin.

Alternatively, instead of using a pin in HAL to change the mode, you could use a user-defined M-code and a shell script containing
Code:
setp tangentkins.auto 1

How much of this needs further explanation?

Attachment tangentkins_3.zip not found

Last edit: 15 years 1 month ago by andypugh.

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

More
15 years 1 month ago #13337 by ioiotutu
Thanks,

For me It's ok to use M-codes. I build:

M151
#!/bin/bash
halcmd setp tangentkins.auto true
exit 0

M152
#!/bin/bash
halcmd setp tangentkins.auto false
exit 0

Testing this m-codes with HAL METER seems to work fine, i see the status changed but the A axis always move following XY.

I have some warnings during comp command:

root@ubuntu:/home/michele/emc2/nc_files# comp --install tangentkins.c
make -C /usr/src/linux-headers-2.6.32-122-rtai SUBDIRS=`pwd` CC=gcc V=0 -o /Module.symvers modules
make[1]: ingresso nella directory «/usr/src/linux-headers-2.6.32-122-rtai»
CC [M] /tmp/tmp8A54AP/tangentkins.o
Building modules, stage 2.
MODPOST 1 modules
WARNING: "hal_init" [/tmp/tmp8A54AP/tangentkins.ko] undefined!
WARNING: "hal_exit" [/tmp/tmp8A54AP/tangentkins.ko] undefined!
WARNING: "hal_malloc" [/tmp/tmp8A54AP/tangentkins.ko] undefined!
WARNING: "hal_pin_bit_new" [/tmp/tmp8A54AP/tangentkins.ko] undefined!
WARNING: "hal_ready" [/tmp/tmp8A54AP/tangentkins.ko] undefined!
WARNING: "rtapi_print" [/tmp/tmp8A54AP/tangentkins.ko] undefined!
CC /tmp/tmp8A54AP/tangentkins.mod.o
LD [M] /tmp/tmp8A54AP/tangentkins.ko
make[1]: uscita dalla directory «/usr/src/linux-headers-2.6.32-122-rtai»
cp tangentkins.ko /usr/realtime-2.6.32-122-rtai/modules/emc2/
root@ubuntu:/home/michele/emc2/nc_files#

what do i wrong?

Sorry but i am a newbie!

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

More
15 years 1 month ago #13338 by andypugh
ioiotutu wrote:

what do i wrong?

Nothing, you can ignore those warnings.
It is more likely that I made a mistake in the tangentkins file. I will try to have a look at it tonight.

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

More
15 years 1 month ago #13346 by andypugh
Yes, I definitely made an error.
Annoyingly I had it working, but got in a tangle with save/compile/test and can't figure out which combination worked (the problem is a pointer indirection issue on the HAL pin variable)
I have run out of brainpower for tonight (01:42 here), I will look at it again tomorrow.

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

Time to create page: 0.127 seconds
Powered by Kunena Forum