Spindle Encoder Issues

More
04 Nov 2021 21:02 - 04 Nov 2021 21:02 #225267 by olzy
Spindle Encoder Issues was created by olzy
Hello, I am trying to configure my 3 axis mill to use a spindle encoder so I can try rigid tapping. 
I am using this encoder, www.amazon.co.uk/gp/product/B07T2S9HHS/r...00_s00?ie=UTF8&psc=1 
Its a line driver styled encoder, phases A and B seem to work well, Z phase isn't readable on my oscilloscope but "seems" to be functioning okay on the mill, as I am able to read a position and velocity from the encoder in the halui. 
I have set the encoder up using PNCCONF wizard, as a 1024 pulse encoder, I haven't included any PID values at this point.
Is there any documentation / tutorials on installing a spindle encoder? I have attempted to wathch talla83's video about the subject but left more confused. 

I have attached my hal and ini files from my test PNNCONF setup. I was planning on getting the encoder setup to work then transferring the parts into my main hal and ini files for the machine. I was hoping someone could point me in the right direction for this. I am unable to do G33.1 commands (motor not in correct mode) and M19 R 0 commands do nothing. 

Any help would be greatly appreciated as I have become mightily lost. 
Cheers! 
 
Last edit: 04 Nov 2021 21:02 by olzy.

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

More
04 Nov 2021 21:24 #225269 by PCW
Replied by PCW on topic Spindle Encoder Issues
1. Does the encoder count up when the spindle is turning in the forwards direction?
2. Have you verified index operation?

To verify index operation, start LinuxCNC with the spindle drive
disabled (motor / VFD unplugged) then from a terminal window, type:

halmeter signal spindle-index-enable

halcmd -kf

Then at the halcmd prompt, set the index enable signal true:

halcmd: sets spindle-index-enable true

Then, while watching the state of spindle-index-enable in halmeter,
slowly rotate the spindle. spindle-index-enable should go false when
the index is detected. This should always happen at the same angular
position (hint: in halcmd, you can repeat the "sets" command by
typing an up-arrow and a return)

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

More
04 Nov 2021 21:34 #225272 by olzy
Replied by olzy on topic Spindle Encoder Issues
I tried verifying the index, when I run the halmeter signal spindle-index-enable command in a terminal with the vfd off, I get an error saying gtk_is_widget failed

I can run the command when the GUI is on and the power on button is pressed in the GUI, it then opens the halmeter and just says false.
I was unable to run halcmd -kf at any point.
Would photos help?
Thanks!

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

More
04 Nov 2021 21:39 #225274 by olzy
Replied by olzy on topic Spindle Encoder Issues
Okay sorry I just realised I needed a separate terminal to run the sets spindle-index-enable true command. The spindle does indeed go to false at the same point in the rotation, implying indexing is working?

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

More
04 Nov 2021 21:42 #225276 by PCW
Replied by PCW on topic Spindle Encoder Issues
Yes, that's the correct index enable behavior which means index is working
is the encoder counting it the correct direction?

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

More
04 Nov 2021 21:46 #225277 by olzy
Replied by olzy on topic Spindle Encoder Issues
When I set it up in the pnnconf it seemed to be, is there another command I can run to check?

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

More
04 Nov 2021 21:48 #225278 by olzy
Replied by olzy on topic Spindle Encoder Issues
When I view spindle-revs the number gets lower the more I turn the spindle in the cutting direction, I'm presuming this means it's reversed?

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

More
04 Nov 2021 21:50 #225279 by PCW
Replied by PCW on topic Spindle Encoder Issues
Yes, you need to change the sign of the encoder scale in the ini file

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

More
04 Nov 2021 21:58 #225281 by olzy
Replied by olzy on topic Spindle Encoder Issues
Brilliant, it's now going the correct way, what's the next step? Encoder seems to be working correctly! (Thank you greatly for the help)

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

More
04 Nov 2021 22:50 #225290 by PCW
Replied by PCW on topic Spindle Encoder Issues
That should be enough

Rigid tapping requires:

1. Spindle encoder working and in the correct direction
2. Spindle index working properly
3. Spindle forward and reverse controls working
4. Spindle-at-speed true at beginning of cycle
(I think spindle-at-speed was set true in your hal file)
The following user(s) said Thank You: olzy

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

Time to create page: 0.078 seconds
Powered by Kunena Forum