Display Encoder position with button to zero.

More
29 Jun 2017 12:22 #95167 by Beezerlm
I am sprucing up an old Heald ID grinder project I did a while back and I have added some number displays in Axis via pyVCP. I am currently displaying commanded position of Z and X (lathe setup). I noticed the commanded position does not change when using the touch-off feature. Is this based off machine position? It seems to be Zero'd wherever the axis is at the point of startup.



Z axis - I would like to display the encoder position and commanded position for Z with a button that would zero off of the current encoder position.

X axis - The X axis is manual ( I wanted to put a motor on it but our grinder hand didn't like that idea ). Currently, when I use the touch off feature the axis is Zero'd off of the commanded position. I would like to display the encoder position and have a button to Zero the axis based on the current encoder position.

Is this do-able with pyVCP? Can someone point me in the right direction?
Attachments:

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

More
29 Jun 2017 23:16 #95197 by BigJohnT
The following user(s) said Thank You: Beezerlm

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

More
30 Jun 2017 00:23 #95198 by Beezerlm
Thanks BigJohnT! I just needed a little nudge in the right direction. I will try to implement this tomorrow.

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

More
30 Jun 2017 12:45 #95209 by Beezerlm
Ok I have the buttons set up and working, The only catch is that I want them to zero off the current encoder position rather than the current commanded position. Any ideas on how to accomplish this?

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

More
03 Jul 2017 22:41 #95334 by BigJohnT
I don't know why anyone would want to zero the encoder position, G10L20 some axis 0 zeros the machine offset not the commanded position.

JT

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

More
05 Jul 2017 17:56 #95402 by andypugh

I noticed the commanded position does not change when using the touch-off feature.


It should!

Is the GUI displaying Machine Coordinates or Relative Coordinates?

Maybe you need to net to the halui.axis.N.pos-relative pin?

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

More
05 Jul 2017 17:57 #95403 by andypugh
Incidentally, GladeVCP has an already-built DRO widget that can display the positions in either coordinate system and can switch units.

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

More
06 Jul 2017 14:29 #95432 by Beezerlm

I don't know why anyone would want to zero the encoder position, G10L20 some axis 0 zeros the machine offset not the commanded position.


Well the X axis is a manual axis. If I use the touch off feature or G10L20 Nothing will change on the readout because the "commanded" position is X0.000 even though the axis is sitting at an actual (encoder) position of X0.010. It appears as though the encoder position is ignored and the ideal (or what I call commanded) position is used to establish the offset.

Another example, If I start the machine and everything is at zero, then run and mdi of "G90 G1. F5.0 X.010" my readout will still say zero because the encoder has not moved. But if I use touch-off or G10L20, it will read X-0.010 because the actual position is .010" below the commanded position. Sorry if this is not clear but this is the best I can explain it.

Essentially I just want the X axis to work as a digital readout that I can zero with the click of a button.

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

More
06 Jul 2017 14:43 #95433 by Beezerlm

I noticed the commanded position does not change when using the touch-off feature.


It should!

Is the GUI displaying Machine Coordinates or Relative Coordinates?

Maybe you need to net to the halui.axis.N.pos-relative pin?


I currently have the zpos-cmd pin displayed in addition to the standard relative coordinates. I would like to see both commanded position and actual relative position. This works fine other than the zpos-cmd never changes when I touch off or home the axis. It is at zero when I start LinuxCNC and I can't find a way to reset it other than to restart LinuxCNC

Attachments:

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

More
06 Jul 2017 14:55 #95434 by andypugh
The encoder counters all have a reset pin. Link the GUI button to that? (you probably need to make the following error numbers enormous)

linuxcnc.org/docs/2.7/html/man/man9/encoder.9.html

encoder.N.reset

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

Time to create page: 0.131 seconds
Powered by Kunena Forum