Read Spindle Load with Lowpass is too slow

More
23 Nov 2022 15:03 #257478 by Ritterchen
Hi together,
I try since a while to read the current of my spindle in LinuxCNC to have a load display.
As input I have a 0-10V from my VFD, which I can read perfectly stable with a multimeter.
I added a 100nF capacitor between the Analog Out and GND on the VFD side to smooth it a bit.
The period on the HITACHI SJ100 VFD PWM is 4ms.

However if I try to read this in LinuxCNC via a Mesa 7i67e it looks like a very slow PWM signal.
I tried to smooth it with a Lowpass Filter but I need to go as low as 0.00001 in gain to have a stable value. 
This becomes very slow in reaction then and it also seems to drift over time. Slow= takes >20s after the spindle stopped to reach 0.
Something like 0,5s would be acceptable

Is there a bit faster and more stable way to filter the Analog Input?

Thank you for your responses :)
Fritz

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

More
23 Nov 2022 15:20 #257479 by PCW
Is the VFD analog output common connected to field power ground?

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

More
23 Nov 2022 15:50 #257483 by Ritterchen
That is connected to the Spindle -, I assume that is shared with the Field GND?

The GND of the VFD is shared for the Input and Output.

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

More
23 Nov 2022 15:58 #257484 by PCW
Spindle- is not connected to field GND

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

More
23 Nov 2022 16:13 #257487 by Ritterchen
Connected the Spindle- to Fieldbus GND, but it seems to have the same behaviour as previously.
The input seems to be very inconsistent (Analog Input and Filtered Input)
setp lowpassFilterSpindleLoad.gain  0.00001
setp scaleSpindleLoad.gain            2
setp scaleSpindleLoad.offset        0

net spindleLoad lowpassFilterSpindleLoad.in <= hm2_7i76e.0.7i76.0.0.analogin0
net spindleLoadFiltered scaleSpindleLoad.in <= lowpassFilterSpindleLoad.out
net spindleLoadFilteredAndScaled <= scaleSpindleLoad.out
Attachments:

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

More
23 Nov 2022 16:22 #257488 by PCW
What is the time per division on the plot?

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

More
23 Nov 2022 16:32 #257490 by Ritterchen
That was a 500ms division.
Even stranger on a closeup of 5ms you can see perfectly fine the 2ms intervalls of the PWM and a little bit of noise (what would be easy to filter).

A little bit lost here - because then basically I should be even able to read some fluctuation with the multimeter?
Attachments:

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

More
23 Nov 2022 16:39 - 23 Nov 2022 16:44 #257491 by PCW
My guess is that you are seeing a beat between the PWM rate
and the 1 KHz sample rate. I would try using analog RC pre-filter
Last edit: 23 Nov 2022 16:44 by PCW.

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

Time to create page: 0.080 seconds
Powered by Kunena Forum