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

More
10 May 2022 22:52 #242530 by andypugh
If you want the Kalman then it is a .comp file, so can be easily compiled and installed with halcompile.

sudo halcompile --install filter_kalman.comp

raw.githubusercontent.com/LinuxCNC/linux...s/filter_kalman.comp

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

More
12 May 2022 20:48 #242817 by re_relentlessly
Hello Andy,

I managed to compile the filter, after installing the linuxcnc-uspace-dev package.
I then tried to tune the filter based on the recommend setting in the man page.
I installed Octave on my windows system, dumped data from halscope, ran through the covariance generation, got some very large number as a result, tried it with no luck, tried increasingly small numbers, no change.
So clearly I dont understand how to tune the filter or it just doesnt work.
Any advice?
loadrt filter_kalman names=kalman.spindle
addf kalman.spindle servo-thread
net spindle-rpm-raw kalman.spindle.zk <= hm2_7i76e.0.7i76.0.0.analogin0
net spindle-rpm-filtered <= kalman.spindle.xk-out
setp kalman.spindle.Rk 36076301.81788512
setp kalman.spindle.Qk 36076301.81788512
 

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

More
13 May 2022 13:20 #242872 by andypugh
Those are big gains!

Did you try anything between 0 and 1? And did you try making R and Q different from each other?

Have you tried plotting input and output with Halscope to get a feel for what happens?

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

More
14 May 2022 01:34 #242934 by re_relentlessly
Thank Andy for the suggestions.
Plotting input and output in halscope at least allowed me to get the kalman filter to do something.
net spindle-rpm-raw kalman.spindle.zk <= hm2_7i76e.0.7i76.0.0.analogin0
net spindle-rpm-filtered <= kalman.spindle.xk-out
setp kalman.spindle.Rk 100
setp kalman.spindle.Qk 0.00001

It seems to work best when Rk and Qk are far apart, although I could not tell the difference when shifting them around (1 and 0.0000001 or 10 and 0.000001).
Also I am still running into the same issues with all the filtering methods: there is a offset from the desired/correct value (lower) and the more I filter (to get the output steady) the slower the response time becomes. 

It feels a little like at this point the whole rpm feedback from the VFD is just so noisy as to be mostly only a general idea. probably just going to have to live with the lowpass filter or kalman and the unsteady output.

Though If you have any other ideas or suggestions I am all ears.

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

Time to create page: 0.083 seconds
Powered by Kunena Forum