Setting correct spindle speed with encoder in hal
24 Mar 2015 05:43 #57132
by Clive S
Setting correct spindle speed with encoder in hal was created by Clive S
I am slowly getting there with my encoder setup but I need to know the correct way to calibrate the spindle on the lathe.
The spindle appears to be running a bit fast on the display (axis).
I am using a 64 slot disc with index + A and B.
Attached is my hal file I am not sure what to change in it to get the speed displaying correct.
Thanks Clive
The spindle appears to be running a bit fast on the display (axis).
I am using a 64 slot disc with index + A and B.
Attached is my hal file I am not sure what to change in it to get the speed displaying correct.
Thanks Clive
Please Log in or Create an account to join the conversation.
24 Mar 2015 07:36 #57135
by andypugh
This- setp encoder.0.position-scale 256.000000
But for 64 slots that sounds right. What makes you think it is wrong?
I guess that the lowpass and abs are hooked up in the Postgui HAL for for a PyVCP panel?
Replied by andypugh on topic Setting correct spindle speed with encoder in hal
I am not sure what to change in it to get the speed displaying correct.
This- setp encoder.0.position-scale 256.000000
But for 64 slots that sounds right. What makes you think it is wrong?
I guess that the lowpass and abs are hooked up in the Postgui HAL for for a PyVCP panel?
Please Log in or Create an account to join the conversation.
24 Mar 2015 16:14 #57140
by Clive S
Replied by Clive S on topic Setting correct spindle speed with encoder in hal
Andy thank for the reply.
I don't understand where the scale of 256 comes from. From what I have read and looked at in other hal files the scale seems to be set at the number of stots ie in my case 64
Would you mind expanding on how this number is attained?
Yes there is stuff in the Postgui HAL I think lowpass is 0.001
Clive
I don't understand where the scale of 256 comes from. From what I have read and looked at in other hal files the scale seems to be set at the number of stots ie in my case 64
Would you mind expanding on how this number is attained?
Yes there is stuff in the Postgui HAL I think lowpass is 0.001
Clive
Please Log in or Create an account to join the conversation.
24 Mar 2015 17:07 #57141
by andypugh
A quadrature encoder sees 4 events per slot (two edges and two detectors) so typically the encoder "counts" are 4x the number of physical slots.
It is possible to turn this behaviour off by setting the encoder module to "counter mode" but if you are using AB quadrature then the scale will be 4 x the slots.
Replied by andypugh on topic Setting correct spindle speed with encoder in hal
I don't understand where the scale of 256 comes from. From what I have read and looked at in other hal files the scale seems to be set at the number of stots ie in my case 64
A quadrature encoder sees 4 events per slot (two edges and two detectors) so typically the encoder "counts" are 4x the number of physical slots.
It is possible to turn this behaviour off by setting the encoder module to "counter mode" but if you are using AB quadrature then the scale will be 4 x the slots.
The following user(s) said Thank You: Clive S
Please Log in or Create an account to join the conversation.
24 Mar 2015 18:28 - 24 Mar 2015 18:29 #57142
by Clive S
Replied by Clive S on topic Setting correct spindle speed with encoder in hal
Andy
That explains a lot to me it's obvious when you know how Thanks
I have tested the chuck speed with an old mechanical counter and it read about 245 rpm but the display (axis) reads about 255-260 (it seems to hunt a bit)
I will check it again with a digital tach and see if the reading is the same as the mechanical one.
My disk is being driven with a toothed belt with 1:1 pulley from the spindle shaft.
Clive
That explains a lot to me it's obvious when you know how Thanks
I have tested the chuck speed with an old mechanical counter and it read about 245 rpm but the display (axis) reads about 255-260 (it seems to hunt a bit)
I will check it again with a digital tach and see if the reading is the same as the mechanical one.
My disk is being driven with a toothed belt with 1:1 pulley from the spindle shaft.
Clive
Last edit: 24 Mar 2015 18:29 by Clive S.
Please Log in or Create an account to join the conversation.
24 Mar 2015 19:29 #57144
by andypugh
I would actually trust LinuxCNC more than the mechanical Tacho if they are that close to agreement.
LinuxCNC is only likely to be wrong by factors of 2, 10 or 60. The mechanical tacho can easily be out by a few %
Replied by andypugh on topic Setting correct spindle speed with encoder in hal
I have tested the chuck speed with an old mechanical counter and it read about 245 rpm but the display (axis) reads about 255-260
I would actually trust LinuxCNC more than the mechanical Tacho if they are that close to agreement.
LinuxCNC is only likely to be wrong by factors of 2, 10 or 60. The mechanical tacho can easily be out by a few %
Please Log in or Create an account to join the conversation.
24 Mar 2015 19:47 #57145
by Clive S
That's a relief thanks. How would I get a steady reading in the display?
Clive
Replied by Clive S on topic Setting correct spindle speed with encoder in hal
I have tested the chuck speed with an old mechanical counter and it read about 245 rpm but the display (axis) reads about 255-260
I would actually trust LinuxCNC more than the mechanical Tacho if they are that close to agreement.
LinuxCNC is only likely to be wrong by factors of 2, 10 or 60. The mechanical tacho can easily be out by a few %
That's a relief thanks. How would I get a steady reading in the display?
Clive
Please Log in or Create an account to join the conversation.
24 Mar 2015 20:58 #57147
by andypugh
You could try making the filter constant even longer, though your lowpass is already running a 1 second time constant so I would expect it to be fairly steady.
250 rpm is 4 revs per second, so I would rather expect any phase-error in the sensor disc to be lost in the 4 x averaging. I do sometimes wonder if the encoder velocity calcs are 100% correct in their use of timestamped edges.
Replied by andypugh on topic Setting correct spindle speed with encoder in hal
How would I get a steady reading in the display?
You could try making the filter constant even longer, though your lowpass is already running a 1 second time constant so I would expect it to be fairly steady.
250 rpm is 4 revs per second, so I would rather expect any phase-error in the sensor disc to be lost in the 4 x averaging. I do sometimes wonder if the encoder velocity calcs are 100% correct in their use of timestamped edges.
Please Log in or Create an account to join the conversation.
Time to create page: 0.068 seconds