Incremental Adjustment of Work Coordinates
- Todd Zuercher
- Topic Author
- Offline
- Platinum Member
- Posts: 5034
- Thank you received: 1430
Please Log in or Create an account to join the conversation.
Those things are easily achievable when in manual or MDI mode, the pyvcp buttons can just link to a halui MDI line in the .ini file
linuxcnc.org/docs/2.5/html/gui/halui.html
When in Auto mode is when it gets more complicated
See this recent thread www.linuxcnc.org/index.php/english/forum...ut-to-set-a-variable
I haven't had time to fully test the component I wrote, to evaluate the consequences of different MDI commands.
Some commands did not bring about the anticipated results in an Axis sim, and I was unclear as to why.
I will post it if I get it working to my satisfaction, albeit it takes a MDI line in a dialog, rather than a button press, so as to be completely generic.
Another way around it is to put M0 commands where you need to adjust, stop linuxcnc, do the adjustment, then start the spindle manually and do a Run From Line (using the M0 line number) which then just requires a click on the Pause button to resume.
regards
Please Log in or Create an account to join the conversation.
- Todd Zuercher
- Topic Author
- Offline
- Platinum Member
- Posts: 5034
- Thank you received: 1430
This doesn’t need to happen during an auto mode operation, just between part runs.
I thought that I could set up a pyvcp panel that would have a jog increment box (similar to the one in Axis) and series of positive and negative buttons for each axis (XYZW on this machine) that would call a halui Gcode command that would be something like(for a Z axis adjustment G10 L2 P0 Z(current offset + chosen increment). What I don't understand how to do is make the variables that look up the current offsets, add the increment, and put it into the Gcode.
On a less important note is there any real difference between doing something like this in the tool offset panel vs machine coordinates?
Please Log in or Create an account to join the conversation.
What I don't understand how to do is make the variables that look up the current offsets, add the increment, and put it into the Gcode.
I think the easiest way to do it is to work in Machine co-ordinates from Work co-ordinates zero say, and then zero your Work co-ordinates once in the correct place.
For instance G53 G0 X[#5221 + 1] Y[#5222 +1] will move by the current offset of G54 plus 1 unit, ie move +1 unit in G54 for X and Y - so there is your jog +
Then using G10 L20 P1 X0 Y0 will touch off X and Y to zero at the new location and #5221 and #5222 will be increased by 1 each - there is your reset co-ordinates button
All the buttons can be linked to a halui.mdi-command.NN
(you will probably need to reload the file, to get gremlin to update the plot)
Alternately if doing it from Machine Zero, you could use G10 L2 P1 X[#5221 +/- 1] to jog the offset and G54 G0 X0 to go to the new offset
(obviously because you are directly changing the offset you do not need to touch off, just go there)
The relevant parameter numbers are
5161-5169 “G28” Home
5181-5189 “G30” Home
5211-5219 “G92” offset
5220 Coordinate System NumberG54 G0 X0
5221-5229 Coordinate System 1
5241-5249 Coordinate System 2
5261-5269 Coordinate System 3
5281-5289 Coordinate System 4
5301-5309 Coordinate System 5
5321-5329 Coordinate System 6
5341-5349 Coordinate System 7
5361-5369 Coordinate System 8
5381-5389 Coordinate System 9
On a less important note is there any real difference between doing something like this in the tool offset panel vs machine coordinates?
I take it you mean having spoof tool settings that are increments offset from tool 1.
In practice no difference, except that the above is far more flexible and doesn't require a crystal ball to know in advance what movements you might want, you just jog until there and then re-set
regards
Please Log in or Create an account to join the conversation.
You would have to adapt it to your actual requirements
and the .ini .hal and .xml code
regards
PS I see you have asked the same question on the users list, so between this and the answers on there you should have plenty of strategies for doing what you want
Please Log in or Create an account to join the conversation.
- Todd Zuercher
- Topic Author
- Offline
- Platinum Member
- Posts: 5034
- Thank you received: 1430
Please Log in or Create an account to join the conversation.
That has taken my simple panel to the next level and then some.
Glad you were able to make use of the concept
regards
Please Log in or Create an account to join the conversation.
That is an excellent screen... I forgot we even had tabs.
John
Please Log in or Create an account to join the conversation.