how does re-homing in g-code work?
- helig
- Offline
- New Member
- Posts: 8
- Thank you received: 0
How can I trigger a re-homing in g-code?
When I used mach3 it worked with G28.1, but it seems to be different in linuxcnc
It sounds trivial, but I did not find in in user guide and searching forum or google didn't help either.
Please Log in or Create an account to join the conversation.
- cncbasher
- Offline
- Moderator
- Posts: 1776
- Thank you received: 292
Please Log in or Create an account to join the conversation.
- helig
- Offline
- New Member
- Posts: 8
- Thank you received: 0
the latter - ie touching the home swittches and resetting position. Like I can do it manually on the axis gui with the "Home All" button (confirming I want to rehome)are you looking to just return to machine home position or wishing to rehome and reset the home positions
Please Log in or Create an account to join the conversation.
- ArcEye
- Offline
- Junior Member
- Posts: 25
- Thank you received: 761
See also www.linuxcnc.org/index.php/english/forum...ies-par-lutilisateur, albeit it is mostly in French
AFAIK you cannot re-home from G Code.
The reason is that linuxcnc will reject the command if it is not in Manual mode, the same way as it will not jog unless in Manual mode.
You can prove this to yourself easily. Open Linuxcnc in one of the sims, axis_mm or just axis.
Take it out of estop and switch the machine on ( F1 F2)
Then open the Hal Configuration dialog and enter setp halui.joint.0.home 1 in the 'Test Hal Command' line edit box and press execute
The X axis will home
Then press F5 to bring the MDI tab to the front and try executing setp halui.joint.1.home 1 to home Y
You will get an error ' cant do that (EMC_AXIS_HOME) in MDI mode'
I expect it could be got around in the same way that jogging during toolchanges has been, by changing mode and then switching back, but the bottom line is that you should never need to do it during a program.
If you are homing to physical switches, then you have a problem with losing position that needs sorting out.
If you do not have home switches and home relative to the workpiece, then you need to use the offset systems instead.
regards
Please Log in or Create an account to join the conversation.
- cncbasher
- Offline
- Moderator
- Posts: 1776
- Thank you received: 292
the latter - ie touching the home swittches and resetting position. Like I can do it manually on the axis gui with the "Home All" button (confirming I want to rehome)are you looking to just return to machine home position or wishing to rehome and reset the home positions
is their a specific problem you are having , you should not need to re-home and reset to zero once the machine is homed , it could be your not switching between machine coordinates
and work coordinates , which is causing you to have to reset . once the machine is homed you can return to this position by issuing a G28
can you explain your problem
Please Log in or Create an account to join the conversation.
- helig
- Offline
- New Member
- Posts: 8
- Thank you received: 0
can you explain your problem
No actual problem.
It's just that for whatever reason my machine might lose a step now and then which does not matter for my requirements. Yes, I know this is due to mechanical limitations and no software issue. Anyhow during longer g-code programs an occasional re-home would prevent positioning errors from accumulating.
But I understand from ArcEye's post it's not possible.
Thanks
Please Log in or Create an account to join the conversation.
- ArcEye
- Offline
- Junior Member
- Posts: 25
- Thank you received: 761
You can work around it 2 ways....an occasional re-home would prevent positioning errors from accumulating.
Either split your code into modules, allowing you to re-home between them, or just halt at a convenient point (not inside a sub!) and then re-home and 'run from line'.
The former is more manageable and reliable, because unlike other controllers, Linuxcnc does not re-start the spindle automatically etc. on a run from .. command and the next command needs to be a linear one.
As this probably meaning a retraction from the workpiece before halting, you might as well just code G28 M2, finish that module and start another after re-homing.
Obviously it is preferable to sort out why you lose steps, cuts too deep and stalling, velocity to fast or whatever.
regards
Please Log in or Create an account to join the conversation.
- andypugh
- Away
- Moderator
- Posts: 23560
- Thank you received: 4858
Obviously it is preferable to sort out why you lose steps, cuts too deep and stalling, velocity to fast or whatever.
Purely as an intellectual excercise, as I don't think this is a good idea, but I wonder if you could use the non-home end limit switches as probe inputs and periodically run a probing routine?
It is fairly unusual to just miss a couple of steps (My lathe does it when pushing too big a drill with the toolpost). If it happens during a fast rather than very slow move then the motor stalls and there is no recovery possible.
Please Log in or Create an account to join the conversation.
- susam
- Offline
- New Member
- Posts: 19
- Thank you received: 0
I understand it cannot be done through a G-code command....however, when we load an ngc file or power on the machine....is it possible for the axes to ho me by itself detecting the position using proximity sensors (like moving in negative X till the proximity sensors detects)?
Thanks
Regards
Susam
Please Log in or Create an account to join the conversation.
- ArcEye
- Offline
- Junior Member
- Posts: 25
- Thank you received: 761
Is it possible to achieve automatic homing when machine is powered on?
Yes it is possible, but it is not desirable or safe.
You should not have un-commanded movement when power is applied, that is just dangerous.
It takes no time at all to type Ctrl Home or click on the Home button, I don't see the problem.
The other issue is how do you differentiate between a start-up and the F2 button having been pressed to power down the system whilst at lunch say and then pressing F2 again to resume the work.
You would not want to re-home in the latter case.
regards
Please Log in or Create an account to join the conversation.