Fantastic! I'm afraid there's not much written yet. In fact, the wiki page about customizing post processors is a bit thin. Actually, it's embarrassingly thin.
I'm far from the strongest programmer around here but I'll do my best. Others may laugh at my futile attempts and show us both how to do it right
A 2D CAM workbench doesn't interested me. The discussion comes up from time to time and if someone builds one, I'll happily look. The community will decide whether or not it should be included. Experimenting with different approaches is always encouraged and good ideas win out. Bad ideas die out. As it should be.
My 1st approach (but not-ideal) would be with post processor.
A big parenthesis here is that after some thinking I would like be able to add in the regular PATH workbench:
Something that converts the whole Workbench to 2D. Either for laser or plasma. The code is already there, actually is simpler imho!
With 2D somewhere we could add some constants like
a)Initial Height Probing Commands
b) Safe height
c) Plasma cut height
So before it even reach the post processor the PATH will generate useful code. It can use the b) to move in the starting point, run the a) function in the g-code, move into c) height, and run the regular command (like the Face Profile) only that now it adds the M3/M5 at any raise/depression of the tool.
Maybe later a parameter can be added of how often or what is the minimum distance the torch has to travel before it re-zeroes the Z, trying to avoid too many zeroings. Anyway thats just my super simplified thought, i guess there are a lot more to be considered.
The www.sheetcam.com is a good program that someone can use a reference. I also checked the https://github.com/OpenBuilds/cam . I can't make it work, but you can see what i mean. Its https://cam.openbuilds.com/
Closing the parenthesis, and continuing to the quick n dirty post processor
Posts are meant to be hacked and customized. You can make a new copy of the post and put it in your macro directory. Just give it a unique name that ends in '_post.py'. What you've outlined is pretty easy to do and as an experiment, certainly worth it. I wouldn't even worry about the argument unless you want to use the same postprocessor yourself without the thc function.Without understanding yet all these steps inside the post proc. I would add a new argument that just asks if it is for a plasma machine with TorchHeightControl. (its convenient just for me! hahaha). My thought is that with plasma and THC we need only 2D.
So when a user adds the --plasma-thc these happen:
Stores every Z detected value to a variable "Z_check"
Check every new Z and compares it with Z_check.
When its of smaller value and its of a G1,
It adds the zeroing() function to the post g-code
Raise the Z to 1.5mm
Starts the torch (M3).
Continue its normal flow
Else If its equal
Continue its normal flow
Else if it is bigger then
stop the torch (M5)
Raise to a safe height
Store the Z value to the Z-check.
What do you think about this simple way? Of course I must not create multi level passes etc. Would that work just for now?
The various Z values through the regular code are not important with the THC if the torch is on since it just ignores them (the THC has the final word on the Z)
Code: Select all
# Now add the remaining parameters in order for param in params: if param in c.Parameters: if param == 'F': if command not in RAPID_MOVES: outstring.append(param + format(c.Parameters['F'] * 60, '.2f')) elif param == 'T': outstring.append(param + str(c.Parameters['T'])) else: outstring.append(param + format(c.Parameters[param], precision_string)) if param == 'Z' and command in ['G1', 'G01']: if c.Parameters[param] < z_check: outstring.append('GCODE THAT DOES PROBING') outstring.append('GCODE THAT RAISES Z to 1.5mm') outstring.append('M3') elif c.Parameters[param] > z_check: outstring.append('M5') outstring.append('GCODE THAT RAISES Z SAFEHEIGHT') z_check = c.Parameters[param] # store the latest command lastcommand = command
I assume the material is constant thickness.sliptonic wrote: ↑Tue May 15, 2018 4:52 amBefore we talk about coding the argument or merging the fix into master, I'd want to understand more about what's going on: Are you probing so often because the material thickness may not be constant or because the path you're processing has variable z depth? In other words, why not probe once at the beginning and assume the same depth for all operations that follow?
This is interesting but there are two different things going on. Both of them have a similar solution (in this case) but a better solution might consider them independently.polemidis wrote: ↑Tue May 15, 2018 10:38 amThe reason is that plasma cutting generates tremendous amount of heat that wrap the metal. And because the plasma flame cuts nicely only at a very specific height in tenths of a mm. Too close and the top is narrow, too far the top is wider. Imagine the profile of a flame.
The other reason is that with homemade plasma cutters -which are not overbuild- most likely there is going to be at least 1mm height difference on various spots on the table. I believe in mineI have even a quarter inch. The need is only on every new torch start, just setting the initial height (usually in 1.5mm but it depends the plasma) as during the cut the THC measures the voltage of the arc at 10Khz(!!!) and controls the Z
Not really. The thc needs to adjust the z depth of cut but not fully control it. It's tweaking the depth but not establishing safe height or clearance.About your arguments on 2D you are right, I get your perspective. But the need for 2D comes to play because of the specific need of the plasma, that the THC takes full control of the 3rd dimension. Plus the height probe zeroes the Z,
So even its a 3D object, the Z dimension control goes not to the user, but to these automations
I am new to plasma, and to CNC in general, but I have the impression that in plasma cutting the stock material is almost always a flat sheet of metal. Maybe I am wrong I do not know this field well. Maybe because plasma is not as clear cut as other methods, it can leave some dross than need grinding.sliptonic wrote: ↑Tue May 15, 2018 2:22 pmNot really. The thc needs to adjust the z depth of cut but not fully control it. It's tweaking the depth but not establishing safe height or clearance.
Imagine that you're re-working a part like below to cut the slots but avoid crashing into the bosses. The THC is going to compensate the cut for each slot but it's all on the user to set up the safe height and clearance height. With a 3D model, this is trivial. With a 2D model it might be impossible (imagine 500 slots instead of 2 and bosses all over the place).
Plasma cutting, like any any other kind of CNC work, is going to have some special considerations and require proper setup. In that regard, it's no different than the others.
Not for plasma, but for a flame torch (acetylene), plasma cannot preheat it just cuts right away.polemidis wrote: ↑Tue May 15, 2018 4:09 pmI've heard rumors that some plasma software will move to a penetration point, then circle for a period to pre-heat the material before descending and beginning the penetration cut. This would be a perfect place for a dressup. Your probing routine might be another one.