VFD Vo 0-10V rpm feedback - Analogue pin flicker

More
28 Feb 2022 00:02 #235965 by re_relentlessly
Hello,

I have a huanyang VFD, linuxcnc 2.8, and Mesa 7i76e, raspberry pi4. I have hooked it up using the Anchluss mesa instructions plus  DIY CNC Design - Build a better CNC router
And i am now trying to get the Vo analogue output of the vfd ( which reports 0-10 corresponding to spindle rpm) connected to linuxcnc.
I have the Vo output connected to analogue pin 0 of the mesa board (TB6 pin 1), and i have the vfd ACM connected to ground of the power supply (same psu that powers the mesa). A multimeter connected between Field power ground and TB6 pin 1 shows the correct analogue voltage that matches the VFD output on Vo. But (after enabling reading of analogue pins via changing serial 0xxxx to 01xxxx) the Analogue input reported by linuxcnc in both halshow and the halscope (see attached screenshot) just jumps around between 0 volts and ~9.8 volts with voltages in between as well. Clearly i have something wired incorrectly, but for the life of me I cannot figure it out. I tried  verifying the analogue inputs by connecting field power +24v to tb6 pin 2 ( analogue 01) and it reports 24.0 correctly.
Attachments:

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

More
28 Feb 2022 00:09 #235967 by PCW
Possibly the signal is very noisy (not unexpected from a VFD)
so a RC filter might be in order

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

More
28 Feb 2022 00:17 #235968 by re_relentlessly
so i checked with the multimeter Hz setting and it reports 1.3Khz between Vo and ACM. So i am thinking you are correct (noisy)

so something like
```
# spindle speed display
addf lowpass.1 servo-thread
net rawSpindleRPM hm2_7i76e.0.7i76.0.0.analogin0 => lowpass.1.in
setp lowpass.1.gain 0.02
net spindle-revs <= lowpass.1.out
```
it would also seem that the above is missing the basic math to convert the 0-10v signal to rpms

```
( hm2_7i76e.0.7i76.0.0.analogin0 / maxVoltage) * MaxRPM = ActualRPM
```
if there any way to perform such math?

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

More
28 Feb 2022 03:01 #235975 by PCW
I would use a RC filter at the 7I76E input

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

More
28 Feb 2022 03:04 #235977 by re_relentlessly
I am sorry for all the questions, but I am new to most of this. Could you please clarify what you mean by "RC filter at the input".
A hardware low pass filter?
or just a different configuration of the software filter example i posted?

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

More
28 Feb 2022 03:15 #235980 by PCW
Yes, ahardware filter, since there is so much noise
and maybe even negative peaks which would not register
and cause errors if filtered in LinuxCNC

A say 1 K resistor and a 10 uf cap would be a good start

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

More
01 Mar 2022 00:10 #236073 by re_relentlessly
So that appears to have worked. I will have to order a 10uF cap since the only thing i had on hand was 100uF (which is what i tested with). The value reported in linuxcnc still flickers a little bit every once in a while (2-5second interval) and the value is a little 0.2 volts lower than what is being output from Vo (measured via dmm). probably have to just compensate by offsetting the value, or attempt to tweak something in the VFD.
I still have 1 question. How do i feed the analogue voltage to linuxcnc to actually use it a the rpm display?

pyvcp_options.hal
```
net spindle-vel-cmd-rpm-abs => pyvcp.spindle-speed
```
so i guess i just need to connect it to the pin, as in
```
net spindle-vel-cmd-rpm-abs <= hm2_7i76e.0.7i76.0.0.analogin0
```
but that won't do the basic math to translate the 0-10v signal into 0-24000 rpm

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

More
01 Mar 2022 01:08 #236077 by PCW
If this is for display you would not connect it to spindle-vel-cmd-rpm-abs
as that is the commanded speed from LinuxCNC

You should be able to scale the analog value using the
hm2_7i76e.0.7i76.0.0.analogin0-scalemax parameter

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

More
13 Mar 2022 23:32 #237164 by re_relentlessly
Thanks again for all your help. I have now settled on 68uF capacitor (no flicker, but as low a value as possible to keep the responsiveness high (how fast it responds to the VFD pin changing voltage))

I used scalemax to get the scale mostly correct, but due to the RC filter the voltage output of the filter is lower than the voltage on the vfd's pin. I attempted to further correct this by scalemax, but it doesn't work. Since the difference between the rc filters output voltage and the vfd's pin voltage is not constant across the 0-10v range. I guess I need some complex curve based offset?
Is there any way to correct this non linear offset?

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

More
13 Mar 2022 23:54 #237169 by tommylight

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

Time to create page: 0.096 seconds
Powered by Kunena Forum