Spindle speed feedback
15 Nov 2018 11:55 #120747
by biqut2
Replied by biqut2 on topic Spindle speed feedback
You may be right, I don't have time to look at it before work this morning but I can post the relevant hal lines so you can see what I have.
setp hm2_5i25.0.encoder.05.scale 1.0
setp hm2_5i25.0.encoder.05.counter-mode true
net spindle-position hm2_5i25.0.encoder.05.position => motion.spindle-revs
net spindle-velocity hm2_5i25.0.encoder.05.velocity => motion.spindle-speed-in
net spindle-velocity gmoccapy.spindle_feedback_bar
setp hm2_5i25.0.encoder.05.scale 1.0
setp hm2_5i25.0.encoder.05.counter-mode true
net spindle-position hm2_5i25.0.encoder.05.position => motion.spindle-revs
net spindle-velocity hm2_5i25.0.encoder.05.velocity => motion.spindle-speed-in
net spindle-velocity gmoccapy.spindle_feedback_bar
Please Log in or Create an account to join the conversation.
15 Nov 2018 12:22 #120748
by andypugh
Replied by andypugh on topic Spindle speed feedback
Yes, you are displaying revs-per-second and then cheating the encoder scale to get something a bit closer to revs-per-minute.
If you _only_ want speed feedback then you can remove the position and velocity links to motion, and then set the encoder scale to 1/60 to get RPM straight out of the encoder module.
If you want to use feed-per rev and/or spindle-synched motion (which requires an index channel) then you will need a "scale" function to multiply the RPS by 60 to give RPM before displaying.
If you _only_ want speed feedback then you can remove the position and velocity links to motion, and then set the encoder scale to 1/60 to get RPM straight out of the encoder module.
If you want to use feed-per rev and/or spindle-synched motion (which requires an index channel) then you will need a "scale" function to multiply the RPS by 60 to give RPM before displaying.
The following user(s) said Thank You: biqut2
Please Log in or Create an account to join the conversation.
15 Nov 2018 17:04 #120765
by biqut2
Replied by biqut2 on topic Spindle speed feedback
So I effectively need to implement what I see on this page: wiki.linuxcnc.org/cgi-bin/wiki.pl?Closed...pindle_Speed_Control
I DO want to tap with this machine so that's the route I want to go. As far as an index pulse I'm not sure the best way to acquire that. The machine only has the one sensor and it's reading the teeth on the spindle cartridge ( not really a cartridge ) The machine was equiped for rigid tapping pre-retrofit but did not have a tool changer, the tool changer was optional when these were new. So presumably there's some way to index the thing, just not sure how at the moment.
I DO want to tap with this machine so that's the route I want to go. As far as an index pulse I'm not sure the best way to acquire that. The machine only has the one sensor and it's reading the teeth on the spindle cartridge ( not really a cartridge ) The machine was equiped for rigid tapping pre-retrofit but did not have a tool changer, the tool changer was optional when these were new. So presumably there's some way to index the thing, just not sure how at the moment.
Please Log in or Create an account to join the conversation.
16 Nov 2018 00:41 #120797
by biqut2
Replied by biqut2 on topic Spindle speed feedback
The following lines seem to do the trick and produced reasonable values, however, it seems a bit erratic and will spike or dip randomly. I'm guessing I didn't notice this before and do now because of the gain of 60. I tried using encoder.N.position−interpolated float out to no avail to smooth things out. It kicks an error and gmoccapy won't start. It stated "Do not use for position control." so I don't think I should be using it anyway. The connection to the 7i77 is made through a shielded cable and the signal looks clean on both ends: sensor and 7i77. Just taking a shot in the dark I ordered a new sensor and will tr that when it gets here. Any other ideas?
loadrt scale count=1
addf scale.0 servo-thread
setp scale.gain 60
setp hm2_5i25.0.encoder.05.scale 36.0
setp hm2_5i25.0.encoder.05.counter-mode true
setp hm2_5i25.0.encoder.05.min-speed-estimate 50
net spindle-rev-count hm2_5i25.0.encoder.05.position => motion.spindle-revs
net spindle-raw-velocity hm2_5i25.0.encoder.05.velocity => scale.0.in
net spindle-velocity motion.spindle-speed-in <= scale.0.out
loadrt scale count=1
addf scale.0 servo-thread
setp scale.gain 60
setp hm2_5i25.0.encoder.05.scale 36.0
setp hm2_5i25.0.encoder.05.counter-mode true
setp hm2_5i25.0.encoder.05.min-speed-estimate 50
net spindle-rev-count hm2_5i25.0.encoder.05.position => motion.spindle-revs
net spindle-raw-velocity hm2_5i25.0.encoder.05.velocity => scale.0.in
net spindle-velocity motion.spindle-speed-in <= scale.0.out
Please Log in or Create an account to join the conversation.
16 Nov 2018 00:55 #120799
by PCW
Replied by PCW on topic Spindle speed feedback
Do you have the encoder filter enabled on the 7I77s encoder used with the sensor?
The sensor may have slow enough edges that you get double counts
if enabling the filter does not help (or its already enabled) you can increase the filtering by lowering the encoder sample frequency. This is a global setting so will affect all encoder channels.
A good way to get more filtering on specific channels is to disable the filter on "fast" channels and enable it on slow channels and then lower the sample frequency as low as it can go without impacting the fast channels
The sensor may have slow enough edges that you get double counts
if enabling the filter does not help (or its already enabled) you can increase the filtering by lowering the encoder sample frequency. This is a global setting so will affect all encoder channels.
A good way to get more filtering on specific channels is to disable the filter on "fast" channels and enable it on slow channels and then lower the sample frequency as low as it can go without impacting the fast channels
The following user(s) said Thank You: biqut2
Please Log in or Create an account to join the conversation.
16 Nov 2018 01:16 #120803
by biqut2
Replied by biqut2 on topic Spindle speed feedback
Ah didn't know it has a filter that I could turn on and off, I'll have to read up on that. Thanks for the tip. I assume that in the 7i77 manual, I'll start going through it again.
Please Log in or Create an account to join the conversation.
16 Nov 2018 01:51 #120807
by alan_3301
Replied by alan_3301 on topic Spindle speed feedback
The info you need is in the encoder section here: linuxcnc.org/docs/html/man/man9/hostmot2.9.html
basically just change the 1 to a 0 in the following line for the correct encoder:
setp hm2_5i25.0.encoder.00.filter 1
basically just change the 1 to a 0 in the following line for the correct encoder:
setp hm2_5i25.0.encoder.00.filter 1
Please Log in or Create an account to join the conversation.
16 Nov 2018 11:34 #120828
by alan_3301
If you want to rigid tap you will need a real encoder with A/B/Z. If not, you may be able to add another sensor to the gear teeth that reads half a tooth offset from the one already there. You would still need to figure out an index signal also.
If it is not too difficult to put an encoder on the machine, they are extremely cheap for a suitable one.. here is one example
www.ebay.com/itm/OMRON-E6B2-CWZ6C-Rotary...P-R-New/262932007185
Replied by alan_3301 on topic Spindle speed feedback
So I effectively need to implement what I see on this page: wiki.linuxcnc.org/cgi-bin/wiki.pl?Closed...pindle_Speed_Control
I DO want to tap with this machine so that's the route I want to go. As far as an index pulse I'm not sure the best way to acquire that. The machine only has the one sensor and it's reading the teeth on the spindle cartridge ( not really a cartridge ) The machine was equiped for rigid tapping pre-retrofit but did not have a tool changer, the tool changer was optional when these were new. So presumably there's some way to index the thing, just not sure how at the moment.
If you want to rigid tap you will need a real encoder with A/B/Z. If not, you may be able to add another sensor to the gear teeth that reads half a tooth offset from the one already there. You would still need to figure out an index signal also.
If it is not too difficult to put an encoder on the machine, they are extremely cheap for a suitable one.. here is one example
www.ebay.com/itm/OMRON-E6B2-CWZ6C-Rotary...P-R-New/262932007185
Please Log in or Create an account to join the conversation.
16 Nov 2018 23:34 #120877
by biqut2
Replied by biqut2 on topic Spindle speed feedback
Tried enabling the filter, didn't really help. Really don't want to take the head apart just to see how I might install an encoder in there, not right now anyway. I'll just continue running the machine with open loop spindle control until the new sensor gets here, maybe its part of the problem.
Please Log in or Create an account to join the conversation.
17 Nov 2018 13:06 #120895
by alan_3301
Replied by alan_3301 on topic Spindle speed feedback
I think I was telling it to you backwards. 0 is for filter off, 1 is filter on.
What PCW was saying is to try turning the filter off on fast channels, and turn it on for your prox sensor. Then lower the sampling frequency in the value hm2_5i25.0.encoder.muxed-sample-frequency
I'm not sure how much to lower it? you could try 1/2 and increase if necessary. I think the default is 0x007F2815 so maybe try 0x003F940A
What PCW was saying is to try turning the filter off on fast channels, and turn it on for your prox sensor. Then lower the sampling frequency in the value hm2_5i25.0.encoder.muxed-sample-frequency
I'm not sure how much to lower it? you could try 1/2 and increase if necessary. I think the default is 0x007F2815 so maybe try 0x003F940A
Please Log in or Create an account to join the conversation.
Time to create page: 0.117 seconds