Reset machine coordinates on special machine.

More
4 years 4 months ago - 4 years 4 months ago #246315 by BigGray
Tommy, I tried your suggestion and it did not work.

Perhaps I did not really understand what you meant.
If I trip the home switch of x while running a gcode file, that does not reset the machine coordinates(G53).

I'm using trivkins with 2 gantrys so both=true , and yes I did check the home-switch is working properly using hal config viewer.
Last edit: 4 years 4 months ago by BigGray.

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

More
4 years 4 months ago #246318 by tommylight
Is it going to be cutting a series of the same size stuff?
Using a gcode loop should make it possible to 0 the axis when it finishes then start over.

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

More
4 years 4 months ago #246323 by andypugh
After some experimenting, this works....

1) Set the axis to immediate homing (HOME_SEARCH_VELOCITY = HOME_LATCH_VELOCITY = 0 )
2) Toggle halui.mode.joint
3) Toggle halui.joint.0.unhome
4) Toggle halui.joint.0.home

(At this point the machine will automatically switch out of joint mode)

One way to do this is with a custom M-code. Save the following as a file called M100 in your nc_files directory and make it executable (either from the file manager properties or chmod +x M100.
Code:
#! /bin/bash mode=$(halcmd getp halui.mode.is-manual) echo $mode halcmd setp halui.mode.manual 1 while [ $mode == 'FALSE' ];do sleep 0.1 mode=$(halcmd getp halui.mode.is-manual) echo mode is manual $mode done halcmd setp halui.mode.manual 0 mode=$(halcmd getp halui.mode.is-joint) echo $mode halcmd setp halui.mode.joint 1 while [ $mode == 'FALSE' ];do sleep 0.1 mode=$(halcmd getp halui.mode.is-joint) echo mode is joint $mode done halcmd setp halui.mode.joint 0 mode=$(halcmd getp halui.joint.0.is-homed) echo $mode halcmd setp halui.joint.0.unhome 1 while [ $mode == 'TRUE' ];do sleep 0.1 mode=$(halcmd getp halui.joint.0.is-homed) echo joint is homed $mode done halcmd setp halui.joint.0.unhome 0 mode=$(halcmd getp halui.joint.0.is-homed) echo $mode halcmd setp halui.joint.0.home 1 while [ $mode == 'FALSE' ];do sleep 0.1 mode=$(halcmd getp halui.joint.0.is-homed) echo joint is homed $mode done halcmd setp halui.joint.0.home 0 exit 0

It isn't as complicated as it might look, it just sets a pin and waits for the result for four different HAL pins in sequence.

Note that this will _not_ work inside a G-code programme because it requires a mode change to manual (out of auto)

I think that you might have to use G10 inside the G-code and M100 on spool change or similar.

The code does not have to be run from MDI M100, it could be linked to a physical button as a HALCMD (see the INI docs)

Or, it could be coded in Python, in which case it could watch a HAL pin and do the reset then.

It might not make sense for this to be an axis at all....
The following user(s) said Thank You: BigGray

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

More
4 years 3 months ago #246525 by BigGray
No, every piece is different.

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

More
4 years 3 months ago #246526 by BigGray
Thanks a lot Andy for the effort to test this.

The bash file would make for another home button, only for x and a right?
Not really what I'm looking for, it's too cumbersome to use at the speed the machine cuts.
imagine re-homing 60 times an hour. 480 times a day.

Since A will make even more turns then X as it slices the same piece several times, the length would add up even faster.

I think it must be an axis because it needs trajectory planning between x y z and a.
This thing is a lot more complicated then the drawing. in total 6 servo's.

All machine controllers cutting from spool have this reset feature.

When I have time I'll have a look at the source code.
If I find the variable that stores machine coordinates, I guess it's trivial to write some code to reset it from G code.

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

More
4 years 3 months ago #246538 by andypugh
OK, the next suggestion would be to invent a new G-code that resets the chosen axis.

I think this might be possible via remaping, in Python, calling "canonical commands"

github.com/LinuxCNC/linuxcnc/blob/master...mc/nml_intf/canon.hh

Contains all the commands that the G-code is converted to.

But, is it really a problem if machine (rather than relative) position can't display in the DRO?

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

Time to create page: 0.172 seconds
Powered by Kunena Forum