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

More
15 Mar 2022 23:46 #237412 by re_relentlessly
So I managed to get lincurve loaded and setup, and I am passing 5 points
#lincurve
loadrt lincurve personality=6
addf lincurve.0 servo-thread
setp lincurve.0.x-val-00 0
setp lincurve.0.y-val-00 0
setp lincurve.0.x-val-01 2391
setp lincurve.0.y-val-01 3000
setp lincurve.0.x-val-02 5124
setp lincurve.0.y-val-02 6000
setp lincurve.0.x-val-03 10932
setp lincurve.0.y-val-03 12000
setp lincurve.0.x-val-04 16399
setp lincurve.0.y-val-04 18000
setp lincurve.0.x-val-05 21523
setp lincurve.0.y-val-05 24000
I figured out the values above, but setting the spindle to various speeds and the seeing what linuxcnc reported the rpm as versus what i had commanded.

ie: M3 s6000, but the display say 2391

now this lincurve works for the each of the points i provided (3000,6000,12000,18000,24000), but as soon as I command an in between value, the display is incorrect again.
Maybe I don't understand how lincurve works?

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

More
18 Mar 2022 01:02 #237596 by andypugh
I think you possibly have it backwards.

X should be the required speed, Y should be the speed sent to to the drive to get that speed.

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

More
18 Mar 2022 22:55 #237691 by re_relentlessly
So I tried it reversed, and the result was worse.
setp lincurve.0.y-val-00 0
setp lincurve.0.x-val-00 0
setp lincurve.0.y-val-01 2391
setp lincurve.0.x-val-01 3000
setp lincurve.0.y-val-02 5124
setp lincurve.0.x-val-02 6000
setp lincurve.0.y-val-03 10932
setp lincurve.0.x-val-03 12000
setp lincurve.0.y-val-04 16399
setp lincurve.0.x-val-04 18000
setp lincurve.0.y-val-05 21523
setp lincurve.0.x-val-05 24000

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

More
22 Mar 2022 01:30 #237988 by andypugh
What commanded speed do you need to get a real 6000 rpm (for example)

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

More
22 Mar 2022 02:17 #237991 by re_relentlessly
@andypugh based on your most recent question i am going to try and clarify something.

I set the rpm/speed in linuxcnc via the normal m3/m4 s6000, which uses the 0-10v analogue spindle control on the Mesa 7i76e Board. That 0-10v signal feeds the vfd. This part works fine, as far as I can tell (don't currently have a way to measure the actual spindle rpm) with the vfd setting a speed matching the commanded speed. The part that I am having issues with is the 0-10v output from the vfd that provides spindle speed feedback. I am reading that via an analogue input on the mesa. Of note I have a RC (68uF, 1K ohm) filter on the vfd output to smooth the signal going to the mesa analogue input (this was necessary due to the huge about of flicker). I use the 0-10v spindle speed feedback (output from vfd) to display the spindle speed in linuxcnc (pyvcp panel). Due to the resistor in the RC filter (at least I think the resistor is the cuase) the voltage from the vfd does not match the actual vfd output, so I am trying to compensate for the resistor by adjusting.

Notes: its a 0-10v signal that represents 0-24,000rpm, it is very noisy, hence the RC filter (which I may have done wrong?)
#lincurve
loadrt lincurve personality=6
addf lincurve.0 servo-thread
setp lincurve.0.x-val-00 0
setp lincurve.0.y-val-00 0
setp lincurve.0.x-val-01 2391
setp lincurve.0.y-val-01 3000
setp lincurve.0.x-val-02 5124
setp lincurve.0.y-val-02 6000
setp lincurve.0.x-val-03 10932
setp lincurve.0.y-val-03 12000
setp lincurve.0.x-val-04 16399
setp lincurve.0.y-val-04 18000
setp lincurve.0.x-val-05 21523
setp lincurve.0.y-val-05 24000# rpm feedback
net spindle-rpm-raw lincurve.0.in <=  hm2_7i76e.0.7i76.0.0.analogin0
net spindle-rpm-filtered <=  lincurve.0.out
setp hm2_7i76e.0.7i76.0.0.analogin0-scalemax 87120

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

More
21 Apr 2022 00:46 #240772 by re_relentlessly
The comment appears to have been deleted but andypugh had suggested 

Too late now, but you could probably have filtered the analogue input voltage in software instead:

I have finally gotten around to trying that.
The software filter (lowpass.0) does work, but performs no better than the hardware RC filter. It has the same problem of not quite reaching the desired value and still had some flicker in it.

relevant snippet of hal
# rpm feedback
setp hm2_7i76e.0.7i76.0.0.analogin0-scalemax 90120

#net spindle-rpm-raw lincurve.0.in <=  hm2_7i76e.0.7i76.0.0.analogin0
#net spindle-rpm-filtered <=  lincurve.0.out

net spindle-rpm-raw lowpass.spindle.in <= hm2_7i76e.0.7i76.0.0.analogin0
net spindle-rpm-filtered <= lowpass.spindle.out
setp lowpass.spindle.gain 0.01

I think honestly to get it to work properly i am going to have to figure out an active rc filter, one that compensates for the voltage loss in the filter (if such thing even exists).

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

More
21 Apr 2022 12:13 #240794 by andypugh

I think honestly to get it to work properly i am going to have to figure out an active rc filter, one that compensates for the voltage loss in the filter (if such thing even exists).

This _has_ te be something that is easier in software, surely? 

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

More
21 Apr 2022 22:04 #240821 by re_relentlessly
I absolutely agree that it would be easier in software than hardware, but so far I have not been able to get a combination of 
lowpass.spindle.gain 
hm2_7i76e.0.7i76.0.0.analogin0-scalemax
that results in a reasonably responsive output (doesn't change way slower than the input)
that doesn't flicker all over the place (relatively stable)
and shows the correct value across the entire range (0-10v 0-24,000 rpm)

If you have suggestions for how to tune the values to get something adequate I am all ears, because so far I have been just guess and check on the values.

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

More
21 Apr 2022 22:11 #240825 by andypugh
Well, I was more meaning that creating some sort of digital filter would be easier and cheaper than building active hardware filters.

I wonder if this filter is worth trying? linuxcnc.org/docs/devel/html/man/man9/filter_kalman.9.html

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

More
10 May 2022 00:38 #242441 by re_relentlessly
So I have switched over to the digital lowpass filter since finding a place and pcb for the resistor and capacitor was less than ideal, and the performance was comparable. I also tried to implement the filter_kalman, only to discover that it does not ship with 2.8.1, apparently only available on the master branch.

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

Time to create page: 0.308 seconds
Powered by Kunena Forum