Python code to get Joint info
27 Feb 2021 17:38 #200315
by turbostew
Python code to get Joint info was created by turbostew
Hello All,
Maybe a dumb question and maybe this topic belongs somewhere else, burned a couple hours searching for a clue but I am having trouble connecting the dots on how to get access to this info in python, (QTDragon_handler.py).....
linuxcnc.org/docs/2.8/html/man/man9/motion.9.html
particularly the joint pins, I believe this is probably going to be "duh" moment once I get a clue.... A code snippet example would be great!
Thanks,
Kent
Maybe a dumb question and maybe this topic belongs somewhere else, burned a couple hours searching for a clue but I am having trouble connecting the dots on how to get access to this info in python, (QTDragon_handler.py).....
linuxcnc.org/docs/2.8/html/man/man9/motion.9.html
particularly the joint pins, I believe this is probably going to be "duh" moment once I get a clue.... A code snippet example would be great!
Thanks,
Kent
Please Log in or Create an account to join the conversation.
27 Feb 2021 18:04 #200318
by cmorley
Replied by cmorley on topic Python code to get Joint info
That's not much to go on actually
if you want to read HAL pins you can use the HAL python module
specifically:
value = hal.get_value("motion.motion-type")
If you want information about the running machine's configuration (from the INI)
INFO is for that.
If you want linuxcnc status reports STATUS is that.
Hope that helps - I can answer more specific questions.
if you want to read HAL pins you can use the HAL python module
specifically:
value = hal.get_value("motion.motion-type")
If you want information about the running machine's configuration (from the INI)
INFO is for that.
If you want linuxcnc status reports STATUS is that.
Hope that helps - I can answer more specific questions.
Please Log in or Create an account to join the conversation.
27 Feb 2021 18:49 #200329
by turbostew
Replied by turbostew on topic Python code to get Joint info
Chris, as usual, your help is awesome.
So I posted the bigger pic over here:
forum.linuxcnc.org/38-general-linuxcnc-q...nd-new-home-position
So I really want a "verify position" function. I am trying to figure out a way to see if I missed any steps after an hour of hard work on the router. This would be a great diagnostic tool to help me track down my pesky Y axis issue. My machine was a badass when new in 1995 but is showing its age....
Specifically trying to read joint.N.pos−cmd. Not sure if this is going to work or not. if you have a better idea, please share.
Kent
So I posted the bigger pic over here:
forum.linuxcnc.org/38-general-linuxcnc-q...nd-new-home-position
So I really want a "verify position" function. I am trying to figure out a way to see if I missed any steps after an hour of hard work on the router. This would be a great diagnostic tool to help me track down my pesky Y axis issue. My machine was a badass when new in 1995 but is showing its age....
Specifically trying to read joint.N.pos−cmd. Not sure if this is going to work or not. if you have a better idea, please share.
Kent
Please Log in or Create an account to join the conversation.
27 Feb 2021 19:11 #200330
by cmorley
Replied by cmorley on topic Python code to get Joint info
If you override the limits and slowly jogged to the home switch at the same speed as home latch - it might give you an idea by looking at the readout.
How accurate would depend on the switch repeatability and how you set up homing (forward or backward latching)
Or add a temparay separate switch for the same thing.
The separate switch could be connected to motion.feed-inhibit to stop consistently.
compare before running program an after..
I would probably just use a magnetic backed dial placed somewhere convenient and touch off at zero on it (before and after) and compare the DRO..
Chris
How accurate would depend on the switch repeatability and how you set up homing (forward or backward latching)
Or add a temparay separate switch for the same thing.
The separate switch could be connected to motion.feed-inhibit to stop consistently.
compare before running program an after..
I would probably just use a magnetic backed dial placed somewhere convenient and touch off at zero on it (before and after) and compare the DRO..
Chris
Please Log in or Create an account to join the conversation.
27 Feb 2021 19:33 #200333
by turbostew
Replied by turbostew on topic Python code to get Joint info
So reading joint.N.pos−cmd before and after homing will not tell me anything?
Would I read it like this:
value = hal.get_value("joint.0.pos−cmd")
Would I read it like this:
value = hal.get_value("joint.0.pos−cmd")
Please Log in or Create an account to join the conversation.
27 Feb 2021 19:41 - 27 Feb 2021 19:46 #200334
by turbostew
Replied by turbostew on topic Python code to get Joint info
Specifically....
import hal
value = hal.get_value("joint.0.pos−cmd")
import hal
value = hal.get_value("joint.0.pos−cmd")
Last edit: 27 Feb 2021 19:46 by turbostew.
Please Log in or Create an account to join the conversation.
27 Feb 2021 19:49 #200335
by cmorley
Replied by cmorley on topic Python code to get Joint info
Checking before homing is not relevant IMHO, if it was consistent you wouldn't need to home at all.
To do a comparison you need a way to move the mill to a know position -without rehoming, because rehoming would reset the reference.
Yes that is the right code.
To do a comparison you need a way to move the mill to a know position -without rehoming, because rehoming would reset the reference.
Yes that is the right code.
Please Log in or Create an account to join the conversation.
27 Feb 2021 19:49 #200336
by cmorley
Replied by cmorley on topic Python code to get Joint info
In qtdragon I believe the handler already imports HAL
The following user(s) said Thank You: turbostew
Please Log in or Create an account to join the conversation.
Moderators: cmorley
Time to create page: 0.078 seconds