Limit an Axis or part of Machine travel to specific tasks possible?

More
18 Oct 2018 17:57 #119007 by 3D-Master
Hello,

first of all, sorry if my english is not great, also it is very late now and i am tired. Also i havent found similar posts.

i may want to build a cnc machine with an atc at a specific place (on the far left side in X) but i want to limit a part of the x travel so i cannot accidently jog the machine to that position or if i run a program it will stop on the edge to that part of the travel because there may be a door in the way :) it should work like the toolchanger of a Hermle c600, but just on the left side (just need to limit one axis). Watch the example here:


for short: must not manually jog to that part of X travel, nor run gcode to that part. Only if a toolchange is commanded

thanks for any help

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

More
18 Oct 2018 20:13 #119018 by dm17ry
probably there's a better way, but i did that by modifying the soft-limit in tool change routine:

net enable-toolchange-area <= motion.digital-out-10

loadrt mux2 names=ymax-mux
addf ymax-mux servo-thread

setp ymax-mux.in0 [AXIS_1]MAX_LIMIT
setp ymax-mux.in1 [AXIS_1]MAX_LIMIT_TOOLCHANGE ; extended area
net enable-toolchange-area => ymax-mux.sel
net y-limit-max ymax-mux.out => ini.1.max_limit

and from the change.ngc

M64 P10 ; enable off-limits movement
; move the spindle to the tool change area
; ...
; move out
M65 P10 ; restore the original soft limit

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

More
19 Oct 2018 12:46 #119074 by 3D-Master

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

More
21 Oct 2018 23:34 #119181 by andypugh
Another way to do this is with a dummy axis. Use the U axis (for example) and add the U and X together before sending to the stepgen or PID. Then A G53 X0 followed by a G54 U0 will move into the forbidden zone.

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

More
17 Nov 2018 17:01 #120905 by 3D-Master

probably there's a better way, but i did that by modifying the soft-limit in tool change routine:

net enable-toolchange-area <= motion.digital-out-10

loadrt mux2 names=ymax-mux
addf ymax-mux servo-thread

setp ymax-mux.in0 [AXIS_1]MAX_LIMIT
setp ymax-mux.in1 [AXIS_1]MAX_LIMIT_TOOLCHANGE ; extended area
net enable-toolchange-area => ymax-mux.sel
net y-limit-max ymax-mux.out => ini.1.max_limit

and from the change.ngc

M64 P10 ; enable off-limits movement
; move the spindle to the tool change area
; ...
; move out
M65 P10 ; restore the original soft limit


i tried it now, added the extended area to the ini and changed everything to "x min" but linuxcnc says Pin 'ini.1.min_limit' does not exist. i also changed ini.1.min_limit to ini.0.min_limit in case thats the axis but its the same

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

More
17 Nov 2018 17:12 #120907 by dm17ry
hm. in 2.7.11 it's there:

$ halcmd show pin ini.0 | grep limit
16 float IN 370.1 ini.0.max_limit
16 float IN -0.1 ini.0.min_limit

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

More
17 Nov 2018 17:18 #120909 by 3D-Master
when i start linuxcnc without the extended limit and use halcmd i also see those pins. is there something i have to add like FEATURES = 30 if i want to read the ini pins?

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

More
17 Nov 2018 17:24 - 17 Nov 2018 17:28 #120910 by dgarrett

says Pin 'ini.1.min_limit' does not exist

$ man milltask
...
The inihal pins cannot be linked or set in a
halfile that is specified by an inifile [HAL]HALFILE
item because they are not created until milltask is
started.  The inihal pin  values  can be  altered by
independent halcmd programs specified by
[APPLICATION]APP items or by GUIs that support a
[HAL]POSTGUI_HALFILE.

Ref (master branch):
linuxcnc.org/docs/master/html/man/man1/milltask.1.html


Note also:
The inihal pins are sampled in every task cycle,
however, commands affected by their values typically
use the value present at the time when the command is
processed. Such commands include all codes handled by
the interpreter (Gcode programs and MDI commands) and
NML jogging commands issued by a GUI (including
halui).
Last edit: 17 Nov 2018 17:28 by dgarrett.
The following user(s) said Thank You: dm17ry

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

More
17 Nov 2018 17:33 #120912 by 3D-Master
ah okay that was my error, added it in my postgui.hal file and now it works.

Thank you!

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

More
20 Nov 2018 13:19 #121046 by andypugh
Rather than having a mux2 in HAL and driving it from G-code it might be simpler to use a custom M-code to set the INI limits.

linuxcnc.org/docs/2.7/html/gcode/m-code.html#mcode:m100-m199

(I am not sure how to read INI values in bash, so you could either hard-code in the scripts or pass parameters from G-code.
Lots of possible ways are shown here: stackoverflow.com/questions/6318809/how-...ithin-a-shell-script )

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

Time to create page: 0.085 seconds
Powered by Kunena Forum