scripting in linuxcnc (for e.g. homing script)

More
03 May 2016 16:50 #74186 by arhi
looking at forum.linuxcnc.org/forum/38-general-linu...ng-homing-for-a-mill but it's not what I'm trying to figure out so making a separate thread not to pollute the other one... some background, I'm fairly new with milling but I'm with 3d printing and reprap since the beginning .. I used emc back in the day to try to run printers and some routers with it but gave up on it and moved to custom built electronics (some 8bit mcu's first, then 32bit ones) ... now I need to run my own milling (again to improve on 3d printers that are my main interest) but this time I want to run my mill with linuxcnc... small mill (10x10x10cm alu frame, small motor.. nothing serious) but more then enough to get parts I need made out of alu and more then enough to get some experience with linuxcnc (and maybe copy some of that to 3d printing :D ) ...

so, on my printers I write script, directly in the source of the firmware (in this case it would be linuxcnc), that homes the printer... it follows same procedure for 3 axes - go slowly till button is pressed, retract even slower until button is depressed - mark this as home for axis. now I have M code to home single axes or whole printer, now on my mill, I would like to home each axis using similar technique but I can't for the life of me find out how :( .. attm I'm doing homing manually (I attach dmm set on buzzer to toolhead and workpiece and manually move head till i get then lose sound from the beeper) but I'd like to make it more automated.. so any hints how, any pointers to wiki? I'm pretty sure this is a very common issue everyone had to solve so it's probably solved properly and documented somewhere it's just that I'm not searching the forum/wiki properly and not finding the doc I need :D

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

More
03 May 2016 18:51 #74190 by Rick G
The following user(s) said Thank You: arhi

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

More
03 May 2016 19:20 #74191 by arhi
Thanks Rick, yes, I found that page (literary 10sec after I posted the question :D ). It does solve the homing (I see the homing is done pretty much the same I do it on 3d printer).

Now I'm still interested in "general case script". I went trough M code guide and I see I can easily write a script in any lang I want and call from M command, it even know to pause on start, continue on retval 0 and fail on reval that's not 0 but I don't see how to "move till something happens" from a script :( .. halcmd is cool for turning something on/off but I would not use it for stepping ... I just found linuxcnc.org/docs/html/hal/comp.html so I guess that's what I was looking for :D

Thanks!

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

More
03 May 2016 19:46 #74194 by Todd Zuercher
If you want to move till something happens, maybe you want a probing routine?
linuxcnc.org/docs/2.6/html/gcode/gcode.html#sec:G38-probe
The following user(s) said Thank You: arhi

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

More
03 May 2016 20:18 #74195 by arhi
wow that's exactly what I need!!!!!!

much obliged :D

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

Time to create page: 0.142 seconds
Powered by Kunena Forum