Read Spindle Load with Lowpass is too slow

More
3 years 11 months ago #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 to join the conversation.

More
3 years 11 months ago #257479 by PCW
Is the VFD analog output common connected to field power ground?

Please Log in to join the conversation.

More
3 years 11 months ago #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 to join the conversation.

More
3 years 11 months ago #257484 by PCW
Spindle- is not connected to field GND

Please Log in to join the conversation.

More
3 years 11 months ago #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)
Code:
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

Please Log in to join the conversation.

More
3 years 11 months ago #257488 by PCW
What is the time per division on the plot?

Please Log in to join the conversation.

More
3 years 11 months ago #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?

Please Log in to join the conversation.

More
3 years 11 months ago #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

Please Log in to join the conversation.

More
3 years 3 months ago #275072 by Ritterchen
A little while later... ;D
Worked like a charm - using a 1k Ohm resistor with a 10uF capacitor following this tutorial:

Please Log in to join the conversation.

Time to create page: 0.097 seconds
Powered by Kunena Forum