Read Spindle Load with Lowpass is too slow
- Ritterchen
- Offline
- Junior Member
Less
More
- Posts: 26
- Thank you received: 10
23 Nov 2022 15:03 #257478
by Ritterchen
Read Spindle Load with Lowpass is too slow was created 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
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.
23 Nov 2022 15:20 #257479
by PCW
Replied by PCW on topic Read Spindle Load with Lowpass is too slow
Is the VFD analog output common connected to field power ground?
Please Log in or Create an account to join the conversation.
- Ritterchen
- Offline
- Junior Member
Less
More
- Posts: 26
- Thank you received: 10
23 Nov 2022 15:50 #257483
by Ritterchen
Replied by Ritterchen on topic Read Spindle Load with Lowpass is too slow
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.
The GND of the VFD is shared for the Input and Output.
Please Log in or Create an account to join the conversation.
23 Nov 2022 15:58 #257484
by PCW
Replied by PCW on topic Read Spindle Load with Lowpass is too slow
Spindle- is not connected to field GND
Please Log in or Create an account to join the conversation.
- Ritterchen
- Offline
- Junior Member
Less
More
- Posts: 26
- Thank you received: 10
23 Nov 2022 16:13 #257487
by Ritterchen
Replied by Ritterchen on topic Read Spindle Load with Lowpass is too slow
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)
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
Please Log in or Create an account to join the conversation.
23 Nov 2022 16:22 #257488
by PCW
Replied by PCW on topic Read Spindle Load with Lowpass is too slow
What is the time per division on the plot?
Please Log in or Create an account to join the conversation.
- Ritterchen
- Offline
- Junior Member
Less
More
- Posts: 26
- Thank you received: 10
23 Nov 2022 16:32 #257490
by Ritterchen
Replied by Ritterchen on topic Read Spindle Load with Lowpass is too slow
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?
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 or Create an account to join the conversation.
23 Nov 2022 16:39 - 23 Nov 2022 16:44 #257491
by PCW
Replied by PCW on topic Read Spindle Load with Lowpass is too slow
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
and the 1 KHz sample rate. I would try using analog RC pre-filter
Last edit: 23 Nov 2022 16:44 by PCW.
The following user(s) said Thank You: Ritterchen
Please Log in or Create an account to join the conversation.
- Ritterchen
- Offline
- Junior Member
Less
More
- Posts: 26
- Thank you received: 10
09 Jul 2023 12:00 #275072
by Ritterchen
Replied by Ritterchen on topic Read Spindle Load with Lowpass is too slow
A little while later... ;D
Worked like a charm - using a 1k Ohm resistor with a 10uF capacitor following this tutorial:
Worked like a charm - using a 1k Ohm resistor with a 10uF capacitor following this tutorial:
Please Log in or Create an account to join the conversation.
Time to create page: 0.091 seconds