G76, Troubleshooting needed!
30 Oct 2018 20:53 #119665
by Victor
Replied by Victor on topic G76, Troubleshooting needed!
Hi Andy!
That worked!
had to change what i think was a Typo in the custom.hal
net spindle-revs-filt lopass.0.out => motion.spindle-revs
i changed it to
net spindle-revs-filt lowpass.0.out => motion.spindle-revs
I did a run of my G33 test program that stuttered really bad before and the stuttering sound was almost gone. if i lay my hand on the turret when running i can still feel some stuttering but it's much better.
Should the setp lowpass.0.gain 0.05 be adjusted?
I'll attach some files from halscope on my encoder signal.
In the "HAL-Scope-7" image isn't it pretty weird that the index signal is so sporadic?
Big thanks for helping me out!
Br Victor
That worked!
had to change what i think was a Typo in the custom.hal
net spindle-revs-filt lopass.0.out => motion.spindle-revs
i changed it to
net spindle-revs-filt lowpass.0.out => motion.spindle-revs
I did a run of my G33 test program that stuttered really bad before and the stuttering sound was almost gone. if i lay my hand on the turret when running i can still feel some stuttering but it's much better.
Should the setp lowpass.0.gain 0.05 be adjusted?
I'll attach some files from halscope on my encoder signal.
In the "HAL-Scope-7" image isn't it pretty weird that the index signal is so sporadic?
Big thanks for helping me out!
Br Victor
Please Log in or Create an account to join the conversation.
30 Oct 2018 20:59 #119666
by andypugh
Replied by andypugh on topic G76, Troubleshooting needed!
You can try making the gain number bigger or smaller. 0.05 is (about) a 20uS time-constant.
The index probably isn't really sporadic, it is more likely that it is a short pulse and Halscope often misses it.
The index probably isn't really sporadic, it is more likely that it is a short pulse and Halscope often misses it.
Please Log in or Create an account to join the conversation.
30 Oct 2018 21:02 #119667
by Victor
Replied by Victor on topic G76, Troubleshooting needed!
Ok, so 0.025 to 0.075 would be ok values to try?
Br Victor
Br Victor
Please Log in or Create an account to join the conversation.
30 Oct 2018 21:08 #119668
by andypugh
Replied by andypugh on topic G76, Troubleshooting needed!
The trade-off is lag (any filter adds a delay) and loss of responsiveness to real changes in spindle speed.
In practice the lag really might not matter.
Though I was wrong about the units of the filter, the lowpass runs every 1mS do 0.05 is 20mS.
In practice the lag really might not matter.
Though I was wrong about the units of the filter, the lowpass runs every 1mS do 0.05 is 20mS.
Please Log in or Create an account to join the conversation.
30 Oct 2018 21:31 #119670
by Victor
Replied by Victor on topic G76, Troubleshooting needed!
Ok makes sense.
Is it common you have to filter the encoder?
could it be solved with another encoder or shielded wires from the encoder?
I changed the gain to 0.025 and at 1200rpm and 1 rev/turn it sounded really good and i could barley feel anything.
but i played around with different rpm's and feeds and i got the bad stutter back.
I changed the gain to 0.01 and now it runs really smooth no matter what rpm/feed i choose. but what would 0.01 translate into in mS?
is 0.01 filtering to hard? is it an issue when threading? could it be an issue with ridged tapping?
Br Victor
Is it common you have to filter the encoder?
could it be solved with another encoder or shielded wires from the encoder?
I changed the gain to 0.025 and at 1200rpm and 1 rev/turn it sounded really good and i could barley feel anything.
but i played around with different rpm's and feeds and i got the bad stutter back.
I changed the gain to 0.01 and now it runs really smooth no matter what rpm/feed i choose. but what would 0.01 translate into in mS?
is 0.01 filtering to hard? is it an issue when threading? could it be an issue with ridged tapping?
Br Victor
Please Log in or Create an account to join the conversation.
30 Oct 2018 22:01 #119672
by andypugh
Replied by andypugh on topic G76, Troubleshooting needed!
It should be a constant lag, so shouldn't matter.
Try it, and see?
A different encoder might help. This isn't anything to do with noise.
Try it, and see?
A different encoder might help. This isn't anything to do with noise.
The following user(s) said Thank You: Victor
Please Log in or Create an account to join the conversation.
31 Oct 2018 17:48 #119719
by dgarrett
Replied by dgarrett on topic G76, Troubleshooting needed!
The relation between the lowpass filter 'gain' and its
bandwidth is shown on the man page:Ref: linuxcnc.org/docs/2.7/html/man/man9/lowpass.9.html
Note:
1) a is the filter cutoff frequency (-3dB) in radians/sec
a=2*pi*frequency_in_Hz.
2) T is the sample interval in seconds
Using the computed gain=0.0609 and an input amplitude of 1,
the filter output for a 10Hz input should be attenuated
by 3dB or equal to 0.707:
Other notes:
a) If you know the gain, the filter 3dB cutoff frequency (radians/sec) is:
b) for a single pole lowpass filter, the risetime (10 to 90%) is related
to the bandwidth (in Hz) as:Ref: en.wikipedia.org/wiki/Rise_time
bandwidth is shown on the man page:
$ man lowpass
...
gain = 1 - e^(-a * T)
Note:
1) a is the filter cutoff frequency (-3dB) in radians/sec
a=2*pi*frequency_in_Hz.
2) T is the sample interval in seconds
Using the man page example for a 10Hz filter:
a=2*pi*10 # lowpass filter with 10Hz cutoff (-3dB) frequency
T=0.001 # typical 1mS servo period
g=0.00609 # computed 'gain'
Test using halrun with a 10Hz sine wave and 1mS (=1000000nS) period:
$ halrun
loadrt siggen names=sig
loadrt lowpass names=fil
loadrt threads name1=thd period1=1000000
setp sig.frequency 10
setp sig.amplitude 1
setp fil.gain 0.0609
net input <= sig.sine => fil.in
net output <= fil.out
addf sig.update thd
addf fil thd
start
Using the computed gain=0.0609 and an input amplitude of 1,
the filter output for a 10Hz input should be attenuated
by 3dB or equal to 0.707:
Other notes:
a) If you know the gain, the filter 3dB cutoff frequency (radians/sec) is:
a = - (1/T) * ln(1-gain)
b) for a single pole lowpass filter, the risetime (10 to 90%) is related
to the bandwidth (in Hz) as:
risetime = 0.35/BW
The following user(s) said Thank You: Victor
Please Log in or Create an account to join the conversation.
01 Nov 2018 12:13 #119756
by Victor
Replied by Victor on topic G76, Troubleshooting needed!
BIG Thanks for all your help!
I did a test run yesterday.
Started with gain to 0.01 and it was really bad, the move was smooth during G33, but with G76 it started fine, then stopped for a couple revolutions about 3mm into the part, then started again and in the following passes it didn't track so good.
Changed the gain to 0.05 better but still no good. tried 0.075 and the M12x1.75 thread was descent. not as good as the ones i made without the filter but they would be ok.
I tried a thread with a pitch of 7mm and i could see different lines from different passes. Changed the gain to 0.075, got a little better, tried a run with 7mm pitch without filter and that one was perfect.
Any ideas? or is the next step a higher resolution encoder? or will i have the same stuttering problem then?
Br Victor
I did a test run yesterday.
Started with gain to 0.01 and it was really bad, the move was smooth during G33, but with G76 it started fine, then stopped for a couple revolutions about 3mm into the part, then started again and in the following passes it didn't track so good.
Changed the gain to 0.05 better but still no good. tried 0.075 and the M12x1.75 thread was descent. not as good as the ones i made without the filter but they would be ok.
I tried a thread with a pitch of 7mm and i could see different lines from different passes. Changed the gain to 0.075, got a little better, tried a run with 7mm pitch without filter and that one was perfect.
Any ideas? or is the next step a higher resolution encoder? or will i have the same stuttering problem then?
Br Victor
Please Log in or Create an account to join the conversation.
01 Nov 2018 15:13 - 01 Nov 2018 15:21 #119763
by PCW
Replied by PCW on topic G76, Troubleshooting needed!
The index signal is sporadic because its too short to be captured at the 1 ms servo thread rate. This is a general issue with any kind of sampled system like halscope. Because halscope is only sampling the index signal every 1 ms, pulses shorter than 1 ms will not always be detected.
I would expect a higher resolution encoder to be much better, but 150 should be ok if a bit rough
I'm not sure how adding the filter can make motion pause (slow to follow, yes but not pause)
Are you sure your encoder is counting correctly?
I would expect a higher resolution encoder to be much better, but 150 should be ok if a bit rough
I'm not sure how adding the filter can make motion pause (slow to follow, yes but not pause)
Are you sure your encoder is counting correctly?
Last edit: 01 Nov 2018 15:21 by PCW.
The following user(s) said Thank You: Victor
Please Log in or Create an account to join the conversation.
07 Nov 2018 08:47 - 07 Nov 2018 10:23 #120156
by Victor
Replied by Victor on topic G76, Troubleshooting needed!
Ok, Thanks for explaining PCW!
A complete stop might have been a little exaggerated, it looked like it but at 1200rpm a couple revs is achieved pretty fast
when the gain factor was increased to 0.075 the slow down disappeared but the stuttering at certain rev's was back.
Edit: if the encoder is counting correctly is hard to check i guess, i have rotated the spindle 360ยบ by hand and got about 150 counts (+/-5 but that is probably due to human error when trying to get to exact 1 full turn.)
Maybe it's time to replace the encoder, i can find a quadrature useful anyway for rigid tapping.
Any recommendations for brand/model of encoder?
I've looked at the CUI Inc AMT102-V but after some reading people are complaining on the accuracy
www.digikey.com/product-detail/en/cui-in...V/102-1307-ND/827015
Also found this Broadcom / Avago HEDS-5540#A13 but haven't heard so much about them.
www.mouser.se/ProductDetail/Broadcom-Ava...rdeZYmv5qed0RtL2E%3d
Br Victor
A complete stop might have been a little exaggerated, it looked like it but at 1200rpm a couple revs is achieved pretty fast
when the gain factor was increased to 0.075 the slow down disappeared but the stuttering at certain rev's was back.
Edit: if the encoder is counting correctly is hard to check i guess, i have rotated the spindle 360ยบ by hand and got about 150 counts (+/-5 but that is probably due to human error when trying to get to exact 1 full turn.)
Maybe it's time to replace the encoder, i can find a quadrature useful anyway for rigid tapping.
Any recommendations for brand/model of encoder?
I've looked at the CUI Inc AMT102-V but after some reading people are complaining on the accuracy
www.digikey.com/product-detail/en/cui-in...V/102-1307-ND/827015
Also found this Broadcom / Avago HEDS-5540#A13 but haven't heard so much about them.
www.mouser.se/ProductDetail/Broadcom-Ava...rdeZYmv5qed0RtL2E%3d
Br Victor
Last edit: 07 Nov 2018 10:23 by Victor.
Please Log in or Create an account to join the conversation.
Time to create page: 0.098 seconds