Do I need to make a custom function?
- Sousanator
- Offline
- New Member
Less
More
- Posts: 9
- Thank you received: 0
25 Feb 2016 22:38 #70643
by Sousanator
Do I need to make a custom function? was created by Sousanator
Hello all, I have a question regarding setting the G54 offset of an axis to 0. So I just designed this handwheel and I included a button that was intended to set the G54 offset to zero based on the selected axis on the handwheel. I pinned it out so that there could be 3 separate inputs on my parallel port. One for each axis.
Basically I'm wondering if I can connect my parallel port pins to what I presume is purely and AxisUI function. Is this at all possible? Maybe a brutally simply way since I don't know any languages other than C?
(I'm very new to the community and linuxcnc in general)
Thanks,
Basically I'm wondering if I can connect my parallel port pins to what I presume is purely and AxisUI function. Is this at all possible? Maybe a brutally simply way since I don't know any languages other than C?
(I'm very new to the community and linuxcnc in general)
Thanks,
Please Log in or Create an account to join the conversation.
25 Feb 2016 23:02 #70646
by andypugh
Replied by andypugh on topic Do I need to make a custom function?
You can probably do this by linking the input to an MDI_COMMAND.
linuxcnc.org/docs/2.7/html/config/ini-co....html#_halui_section
linuxcnc.org/docs/2.7/html/config/ini-co....html#_halui_section
Please Log in or Create an account to join the conversation.
26 Feb 2016 06:44 #70658
by Rick G
Replied by Rick G on topic Do I need to make a custom function?
You might want to look here...
wiki.linuxcnc.org/cgi-bin/wiki.pl?Adding_Custom_MDI_Buttons
In that example a button is used to execute a MDI command. In your case try using the parallel port input pin instead of the pyPVC panel button for the input.
Your MDI command could use G10 L20
linuxcnc.org/docs/html/gcode/g-code.html#gcode:g10-l20
As shown in a more complex example using the simple remote pendant...
wiki.linuxcnc.org/cgi-bin/wiki.pl?Adding...imple_Remote_Pendant
Rick G
wiki.linuxcnc.org/cgi-bin/wiki.pl?Adding_Custom_MDI_Buttons
In that example a button is used to execute a MDI command. In your case try using the parallel port input pin instead of the pyPVC panel button for the input.
Your MDI command could use G10 L20
linuxcnc.org/docs/html/gcode/g-code.html#gcode:g10-l20
MDI_COMMAND = G10 L20 P1 X0.000
MDI_COMMAND = G10 L20 P1 Y0.000
MDI_COMMAND = G10 L20 P1 Z0.000
As shown in a more complex example using the simple remote pendant...
wiki.linuxcnc.org/cgi-bin/wiki.pl?Adding...imple_Remote_Pendant
Rick G
Please Log in or Create an account to join the conversation.
- Sousanator
- Offline
- New Member
Less
More
- Posts: 9
- Thank you received: 0
26 Feb 2016 07:01 #70659
by Sousanator
Replied by Sousanator on topic Do I need to make a custom function?
Yup thanks guys! I ended up using the [HALUI]MDI_COMMAND suggested above. used G92 X0, G92 Y0, G90 Z0 connected to 3 parport pins. Works like a charm.
Rick, What does the "P1" argument do in that gcode string? Is there any advantage of this over using G92?
Also that last link sheds some light on the complexity that can be achieved! I may have to cook up a new circuit! My current circuit is just a micro that handles the axis/speed, can send a homing signal (now at least) and has a quadrature encoder for the MPG inputs. Milled the pendant itself out of Renboard. Designed in Powershape
Rick, What does the "P1" argument do in that gcode string? Is there any advantage of this over using G92?
Also that last link sheds some light on the complexity that can be achieved! I may have to cook up a new circuit! My current circuit is just a micro that handles the axis/speed, can send a homing signal (now at least) and has a quadrature encoder for the MPG inputs. Milled the pendant itself out of Renboard. Designed in Powershape
Please Log in or Create an account to join the conversation.
26 Feb 2016 09:45 #70663
by andypugh
"P1" means G54 coordinate system. P2 is G55. And so on.
G10 L? P1 sets the G54 coordinate system. G92 sets the G92 offset. This is not really the same thing. Quite often a subroutine will use G92 to mill a library shape at the current location. (I use this for connector holes) If you already have a G92 in effect then the result will not be what you expect on return.
You asked to set G54, and so G10 is the code you should use.
Replied by andypugh on topic Do I need to make a custom function?
Rick, What does the "P1" argument do in that gcode string? Is there any advantage of this over using G92?
"P1" means G54 coordinate system. P2 is G55. And so on.
G10 L? P1 sets the G54 coordinate system. G92 sets the G92 offset. This is not really the same thing. Quite often a subroutine will use G92 to mill a library shape at the current location. (I use this for connector holes) If you already have a G92 in effect then the result will not be what you expect on return.
You asked to set G54, and so G10 is the code you should use.
Please Log in or Create an account to join the conversation.
Time to create page: 0.080 seconds