Spindle Feedback Signal Noise

More
03 Aug 2019 10:40 #141263 by stegrg
I created a GladeVCP panel next to Axis that I'm using to interface with my lathe. I'd like to see the actual spindle speed so I'm using the "spindle-vel-fb-rps" hal signal connected to a Gladevcp hal meter. I'm finding the feedback signal rather noisy. (It's especially bad at lower spindle speeds.) The needle on my meter jumps around quite a bit. I connected an oscilloscope to the 7i76 terminals and observed very clean input signals with no noise whatsoever. Can the "spindle-vel-fb-rps" signal be used in the way I'd like? Is external noise causing the noisy feedback signal? Is this feedback noise typical?

Any help would be much appreciated.

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

More
03 Aug 2019 14:31 - 03 Aug 2019 14:45 #141276 by PCW
Replied by PCW on topic Spindle Feedback Signal Noise
What kind of encoder do you have?
A common cause of velocity noise at low speeds
is errors in the quadrature signal.

Two errors are significant:

1. inconsistant pulse width
2. Quadrature error ( lack of 90 degree phase difference between A and B )

Velocity estimation is done with a Counts/Time_Between_Counts calculation.
At lower speeds, the "Counts" number will be 1 so the velocity estimation relies
entirely on the "Time_Between_Counts" number which is directly affected
by the encoder signal fidelity. At higher speeds the "Counts" number
(counts per servo thread invocation) will be higher and the error caused by
encoder signal errors is reduced in proportion to the number of counts per servo
period.

I should add that if you are using the velocity for display, its standard to insert a low pass
filter component in the velocity signal --> display path so its more stable
Last edit: 03 Aug 2019 14:45 by PCW.
The following user(s) said Thank You: stegrg

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

More
03 Aug 2019 23:08 #141307 by jmelson
Yes, you need a filter. Generally, the spindle encoder has coarse resolution, and then it is sampled regularly by the servo thread. So, assuming 1000 RPM and 250 counts/rev, that is 1000 * 250/60, or 4166 counts/second. If you servo thread is 1000/second, then you only have 4.167 counts per sample period, and of course the counts registered each time will be jumping around.

Here is my code to pick up the raw spindle count from hal pin
ppmc.0.encoder.04.delta (which is unscaled integer encoder counts), convert to float, filter with lowpassfilter, scale with mult2 by a factor whish is 60 * 1000/ my encoder quadrature count , and finally send it to be displayed by pyvcp. The 1000 is the servo thread rate. setp lowpass.1.gain 0.02 sets the amount of filtering.

# spindle speed display
addf lowpass.1 servo-thread
net spinraw ppmc.0.encoder.04.delta conv-s32-float.0.in
net spinfloat conv-s32-float.0.out mult2.0.in0
setp mult2.0.in1 185.185185 # (60/encoder count/rev)
net rawSpindleRPM mult2.0.out => lowpass.1.in
setp lowpass.1.gain 0.02
newsig SpindleRPM float
linkps lowpass.1.out => SpindleRPM
The following user(s) said Thank You: Clive S, stegrg

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

More
05 Aug 2019 10:15 #141410 by stegrg
I've played around with my controller and found that the excessive needle jumping for spindle speed is being caused by the DC power supply in close proximity to the 7i76 card. (I'm able to run the spindle without the power supply and still receive the encoder feedback signal) When I run the spindle with the power supply disconnected, the spindle speed signal is significantly improved. I think I'm going to separate the power supply components from the low voltage controller components and place them in separate enclosures to minimize noise.

I will also try adding a lowpass filter as you both have suggested to further refine the signal once I've separated the two components.

Thank you both for your support.

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

More
05 Aug 2019 13:44 - 05 Aug 2019 20:26 #141416 by PCW
Replied by PCW on topic Spindle Feedback Signal Noise
If this is caused by external impulse noise you can often eliminate it by
lowering the encoder input filter bandwidth with these settings:

1. Setting the encoder filter option to true
2. Lowering the encoder sampling rate

On normal non-multiplexed encoder counters, the default sample rate is about 8 MHz
with the digital filter enabled (15 counts) this results in a maximum quadrature count
rate of about 1 MHz. If your maximum count rate is lowers than this, you can increase
the filter time constant by lowering the sample rate.
Last edit: 05 Aug 2019 20:26 by PCW.

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

More
07 Aug 2019 15:34 #141615 by stegrg
PCW,

I searched your suggestion regarding lowering the encoder input filter bandwidth and stumbled across your post to a similar topic. Is this what you were referring to?

"Also since you have such a slow encoder signal you probably want to maximise the electrical noise filtering
by enabling the encoder filter and setting the sample rate lower:
setp hm2_5i25.0.encoder.00.filter true
setp hm2_5i25.0.encoder.sample-frequency 500000
This will set the encoder inputs digital filter time constant to 30 usec
(default time constant on a 5I25 with the filter off would be 100 ns = 300 times shorter)"

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

More
07 Aug 2019 16:38 #141622 by PCW
Replied by PCW on topic Spindle Feedback Signal Noise
yes

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

Time to create page: 0.224 seconds
Powered by Kunena Forum