VFD Vo 0-10V rpm feedback - Analogue pin flicker
- re_relentlessly
- Offline
- Senior Member
Less
More
- Posts: 49
- Thank you received: 4
15 Mar 2022 23:46 #237412
by re_relentlessly
Replied by re_relentlessly on topic VFD Vo 0-10V rpm feedback - Analogue pin flicker
So I managed to get lincurve loaded and setup, and I am passing 5 points
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?
#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
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.
- andypugh
- Offline
- Moderator
Less
More
- Posts: 23170
- Thank you received: 4860
18 Mar 2022 01:02 #237596
by andypugh
Replied by andypugh on topic VFD Vo 0-10V rpm feedback - Analogue pin flicker
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.
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.
- re_relentlessly
- Offline
- Senior Member
Less
More
- Posts: 49
- Thank you received: 4
18 Mar 2022 22:55 #237691
by re_relentlessly
Replied by re_relentlessly on topic VFD Vo 0-10V rpm feedback - Analogue pin flicker
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.
- andypugh
- Offline
- Moderator
Less
More
- Posts: 23170
- Thank you received: 4860
22 Mar 2022 01:30 #237988
by andypugh
Replied by andypugh on topic VFD Vo 0-10V rpm feedback - Analogue pin flicker
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.
- re_relentlessly
- Offline
- Senior Member
Less
More
- Posts: 49
- Thank you received: 4
22 Mar 2022 02:17 #237991
by re_relentlessly
Replied by re_relentlessly on topic VFD Vo 0-10V rpm feedback - Analogue pin flicker
@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?)
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.
- re_relentlessly
- Offline
- Senior Member
Less
More
- Posts: 49
- Thank you received: 4
21 Apr 2022 00:46 #240772
by re_relentlessly
Replied by re_relentlessly on topic VFD Vo 0-10V rpm feedback - Analogue pin flicker
The comment appears to have been deleted but andypugh had suggested
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
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).
I have finally gotten around to trying that.Too late now, but you could probably have filtered the analogue input voltage in software instead:
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.
- andypugh
- Offline
- Moderator
Less
More
- Posts: 23170
- Thank you received: 4860
21 Apr 2022 12:13 #240794
by andypugh
Replied by andypugh on topic VFD Vo 0-10V rpm feedback - Analogue pin flicker
This _has_ te be something that is easier in software, surely?
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.
- re_relentlessly
- Offline
- Senior Member
Less
More
- Posts: 49
- Thank you received: 4
21 Apr 2022 22:04 #240821
by re_relentlessly
Replied by re_relentlessly on topic VFD Vo 0-10V rpm feedback - Analogue pin flicker
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 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.
lowpass.spindle.gain
hm2_7i76e.0.7i76.0.0.analogin0-scalemax
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.
- andypugh
- Offline
- Moderator
Less
More
- Posts: 23170
- Thank you received: 4860
21 Apr 2022 22:11 #240825
by andypugh
Replied by andypugh on topic VFD Vo 0-10V rpm feedback - Analogue pin flicker
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
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.
- re_relentlessly
- Offline
- Senior Member
Less
More
- Posts: 49
- Thank you received: 4
10 May 2022 00:38 #242441
by re_relentlessly
Replied by re_relentlessly on topic VFD Vo 0-10V rpm feedback - Analogue pin flicker
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.124 seconds