- Posts: 12160
- Thank you received: 0
Another plasma component...
I spent a bit of time today working on the component I use for scaling the voltage from the THCAD. It already has a lowpass filter built into it and now I'm working on a moving average of the arc volts from 3-1000 consecutive readings. Comparing the dv/dt between the current period and the moving average should allow us to sense if the torch crosses into a void.
For Phil's benefit, this is the moving average code which receives torch volts, arcOK and buffer size as parameters. I've had this working but have changed it so we can define the number of readings to average which are read into a fixed buffer so it might need a bit of cleaning up yet. I did not want to use any dynamically allocated memory which is how I'd normally write something like this.
We do some fancy pointer footwork to calculate the total and average without resorting to any for loops
Please Log in to join the conversation.
(for a notional 10 point average)
new = 0.9 * old + 0.1 * latest
Or, for variable gain:
new = (1 - G) * old + (G) * latest
Please Log in to join the conversation.
Andy, thanks for shooting down my cool non-looping algorithm down in flames with a single line of codeandypugh wrote: Whilst your method will return a true moving-average it is often sufficient just to use
(for a notional 10 point average)
new = 0.9 * old + 0.1 * latest
Or, for variable gain:
new = (1 - G) * old + (G) * latest
I'm not really sure if plasma is an application I'd like to use approximations. There are a number of places I would like to use this. It would be fine for sampling the voltage to establish the command signal for PID control (Currently I only take a single point reading).
But now I have the technique, there are other signal processing techniques mentioned in the literature that I may extend the algorithm to include. But one step at a time.
Please Log in to join the conversation.
In the meantime I have been playing around with QtVCP which has recently been pushed to master branch and it looks really promising for the construction of custom GUI's.
I have now included a sample QtVCP GUI (which is still very much a work in progress and incomplete) in the repo. It can be found in sim/qtvcp_screens/plasmac.
Cheers, Phill
Please Log in to join the conversation.
Please Log in to join the conversation.
- tommylight
-
- Offline
- Administrator
-
- Posts: 22010
- Thank you received: 3
Managed to get the toma_thc config to work with Mesa boards, uploaded it to the original post at
forum.linuxcnc.org/plasma-laser/34978-th...-with-how-to?start=0
Hopefully will have some more time to give your config a good run over and test it on some actual hardware.
Regards
Tom
Please Log in to join the conversation.
Please Log in to join the conversation.
tommylight wrote:
Why change the thread name ?
rodw wrote:
Tommy, I think a user changed the thread name. Lets see if this post changes it back! And yes, I found it really annoying too
Thanks guys, I didn't notice that, nor did I know it could be done...
Cheers, Phill.
Please Log in to join the conversation.
phillc54 wrote: [
Thanks guys, I didn't notice that, nor did I know it could be done...
Cheers, Phill.
And you changed it again!
EDIT. When I posted, it went back to "hights problem" so I edited the title in this post.
Please Log in to join the conversation.
- tommylight
-
- Offline
- Administrator
-
- Posts: 22010
- Thank you received: 3
I was just a bit worried that my sanity went out of the window after several hours in front of 4 monitors !
Please Log in to join the conversation.
