Another plasma component...
Thanks John.
It looks like plasma is more complex than I thought, the more I learn the less I know...
x 2 Absolutely. I feel your pain. Its not really a good candidate for a beginner as his first CNC build. But what you are building will really kick ass when done!
If I knew what I know now when I started, I would have done another machine!
Please Log in or Create an account to join the conversation.
Thanks John.
Do you toggle the torch on and off or is it a momentary button so the torch is only on while the button is held.
Cheers, Phill.
I think I would toggle it. Press once for on and press again for off. The reason I say this is my Everlast plasma has a button on it that enabled this functionality.
Please Log in or Create an account to join the conversation.
- islander261
- Offline
- Platinum Member
- Posts: 757
- Thank you received: 216
John
Please Log in or Create an account to join the conversation.
I have reverted to using the current master branch which has some trajectory planner fixes but this has necessitated the disabling of reverse run until the reverse-run branch has been merged.
If you look at the axis_tweaks file it shows how to set the default axis font.Tom wrote:
Now the only thing i need is to have the text bigger, every text in the Axis GUI !
I have set it to 13 in the ini file which is about the largest the GladeVCP panel can handle without changing the widget sizes.
Cheers, Phill.
Please Log in or Create an account to join the conversation.
rodw wrote:
I mentioned I was working on a python SQL database. Maybe it could be incorporated into Phil's config.
This python script initialises a database with around 9 tables in it and loads a metric cut chart for mild steel and the Hypertherm 45xp.
Rod, have you done any more with your database?
I wouldn't mind trying to incorporate it in this config but I am not very database literate...
Does the structure need to be complete before attempting to use it or can it be changed at any time without causing problems with a previous version?
Were you looking at having a separate GUI to enter the data?
Please Log in or Create an account to join the conversation.
Rod, have you done any more with your database?
I wouldn't mind trying to incorporate it in this config but I am not very database literate...
Phil, Its been busy so I've not done any more. I will try and get some more done on this by the weekend. What Plasma cutter do you have? Do you have cut charts for it? If so, send them to me or post here.
I was hoping to get a couple of different machines entered.
Whilst I'm very database literate and understand SQL well (I used to anyway), I've always had high level development environments to create the user interfaces. Its probably not that hard in Python but I'm relatively new to it. You need to think in terms of browsing a table (with up, down, add, edit, delete buttons) and a form to add and edit the item under the currently selected row.
Anyway, the good news is that I managed to get a 3 phase power point beside my plasma table this week but I just bought a lathe and need to catch my breath before buying a new plasma cutter!
Also, I had a good look at your code. We will need to do some work on the kerf crossing part. Rather than just looking at a change in volts, we need to look at a change in volts over time (dv/dt). From tests I did, it looked like a threshold of around +500 volts/second might work for void sensing. Once the void is crossed, dv/dt becomes negative (falling) so I think perhaps, the THC is enabled following a delay after the first positive dv/dt reading. But you have to have a working machine before you can tackle this.
This chart shows dv/dt at a kerf cross at 200 ms per reading. Horizontal scale is reading number (per 200 mHz)
I'm not sure that there will always be such a pronounced negative reading
. I've also written some non looping moving average code using c pointers. For use in kerf rrossing and torch sampling
Please Log in or Create an account to join the conversation.
From the halcompile docs:
Functions which use floating-point can also refer to fperiod which is the floating-point time in seconds, or (period*1e-9). This can be useful in components that need the timing information.
Please Log in or Create an account to join the conversation.
#include <rtapi_math.h>
#define BUFSIZE 100 // number of readings to average torch volts
//float avgarcvolts(double tvolts, int iscutting);
float avgarcvolts(double tvolts, int iscutting)
{
// Calculates the moving average of BUFSIZE readings
static double buf[BUFSIZE];
static double *b, *p = &buf[0]; // pointers for beginning of buffer and current position
static double *e = &buf[BUFSIZE]; // pointer for end of buffer
static int wascutting = 0; // cutting state last time
static double sumvolts = 0.0; // Sum of readings in buffer
static int numreadings = 0; // number of readings in buffer
if(!iscutting && wascutting){
// Torch just turned off, so reset the variables
p = b;
sumvolts = 0.0;
numreadings = 0;
wascutting = iscutting; //and save the state
return(0.0);
}
if(iscutting){ // Arc_OK is on so lets start gathering data to average
*p++ = tvolts; // Save volts to the buffer and increment pointer
if(numreadings < BUFSIZE)
numreadings++;
if(p > e) // if we've gone past the end of the buffer, wrap to the beginning
p = b;
sumvolts += tvolts; // add the new reading
if(numreadings >= BUFSIZE)
sumvolts -= *p; // subtract the oldest reading (which is the one we are pointing at now)
}
wascutting = iscutting; //and save the state
if(numreadings)
return(sumvolts/(double)numreadings); // return Average volts
else
return (0.0); // catch divide by zero errors
}
So in theory, this is what happens:
Once it sees an arcOK, it starts saving readings into a circular buffer using a pointer *p
Once the buffer is full, the pointer wraps to the beginning again. Effectively, this means that buf[BUFSIZE+1] = buf[0]
So in theory, the buffer should be full with an average calculated before the THC timeout enables THC operation.
Once the buffer is full, the oldest reading will be value in front of the current buffer position (eg. at *p+1).
So we calculate the sum of the readings by adding the latest reading and subtracting the oldest reading
We maintain a count of the number of readings so if the buffer is only partially full, it will still return a valid average
Please Log in or Create an account to join the conversation.
return(sumvolts/((double)numreadings + (double) 1.0)); // return Average volts
I have no idea about how big the sample should be and 100 is just an arbitrary number I chose. It might be 10 or it might be 1000, I don't know!
I was not keen on dynamically allocating memory with malloc() but I think you could do this in the EXTRA_SETUP() and deallocate in EXTRA_CLEANUP() functions. I did think of adding a pin to define the number of readings to read into a fixed sized buffer (of maybe 1000 maximum). I think that might be a good approach.
Anyway, I did think this was a pretty cool algorithm and code for an interrupt service routine.
Please Log in or Create an account to join the conversation.
My cutter is a Powermax30XP which is a hand torch machine only. I will need to do a few mods on it if I ever get my table finished, although I have got a bit more done on it over the last few days.
Please Log in or Create an account to join the conversation.