PDA

View Full Version : Plasma floating head...



Davek0974
31-01-2014, 09:26 PM
Looking at adding a floating head to my new build, I've found some code that goes in sheetcam to be run before a cut, this lifts the head, drops it and zeros the DRO etc, what I can't find is where the signal from the floating head micro switch is fed into the mach3 system??

Is it just another limit switch? Or does it need a seperate input signal?

cant find any information on this bit.

i guess a limit will do it as it will only close when the torch has hit metal, but wouldn't that trigger an e-stop??

JAZZCNC
01-02-2014, 01:19 AM
Post the code because chances are it uses G31 and the Probe input.? It could also need a Macro.?

Edit: To be honest this could easily be done just by modifieing the M3 (Spindle on) macro to use G31 command and the probe input. It would then set all the Dro's etc and pierce height etc from within the Macro. All you would do is insert M3/M5 in the G-code which you may be doing anyway for torch on/off.?

Davek0974
01-02-2014, 11:25 AM
I have found a couple of versions, one uses g28.1 the other uses g31. The g31 version seems besta st it uses the switch connected to the mach probe input and apparently it can still allow "home all" to use the upper limit switch on the Z axis, this is exactly what I want.

I will start on building a floating head as it seems pretty essential and makes a lot of sense to me.

I also need to find out about editing the sheetcam post file to insert the new code.

am I right in believing I need to use a THC post in sheetcam now instead of the basic mach3 post?

JAZZCNC
01-02-2014, 12:01 PM
To be honest I don't know enough about THC or Plasma related stuff really to confidently advise.

If all your wanting to achive is to probe the surface then retract to a set height along with zeroing DRO's etc then that's easy enough done but you'll need to either alter an existing Macro like M3 or create your own. This macro reference you then have SheetCam insert into the code it produces at the points it's needed.

If your wanting proper THC in that it follows a set distance from the surface then that will probably be differant matter.?

Davek0974
01-02-2014, 02:00 PM
I have had a look inside the post code for the mach plasma with THC option in sheetcam and it has the code for G31 seeking so it just needs some options altering and the floating head switch wired to the probe input I think.

basically all I want is to have the torch seek the metal at the start of each cut then raise to pierce height and start.

i also want to retain the top limit switch for the "home all" feature in mach.

JAZZCNC
01-02-2014, 05:25 PM
I have had a look inside the post code for the mach plasma with THC option in sheetcam and it has the code for G31 seeking so it just needs some options altering and the floating head switch wired to the probe input I think.

basically all I want is to have the torch seek the metal at the start of each cut then raise to pierce height and start.

i also want to retain the top limit switch for the "home all" feature in mach.

Ok that's easy enough but if you want DRO's Zeroing etc then it will need to go into a Macro file because you'll need some VB code to do it and Mach doesn't support VB directly in the G-code file.

Regards "home all" then Mach treats homing separate and just watches the assigned pin, by that I mean it will not watch limits etc unless specificly told to do so. It will also ignore the Probe input while homing but that shouldn't be a problem.
Also by default Mach homes each Axis individual one at a time when you press "Ref All Home" they won't all go at same time. If you want it to do this you have to alter the Homing script.

Davek0974
01-02-2014, 05:36 PM
The post processor I have been looking at uses g31 z -100 to drop the torch until the probe switch changes state, g92 z0.0 to zero, then g00 z25.00 to raise it by the preset distance, g92 z0.0 to zero the z axis and g00 z1.00 to preset the pierce height.

this is from sheetcam, will that not work in mach3??

i need to ref home one axis at a time as all my limits switches share one input pin, that's fine and works well.

JAZZCNC
01-02-2014, 06:58 PM
The post processor I have been looking at uses g31 z -100 to drop the torch until the probe switch changes state, g92 z0.0 to zero, then g00 z25.00 to raise it by the preset distance, g92 z0.0 to zero the z axis and g00 z1.00 to preset the pierce height.

this is from sheetcam, will that not work in mach3??

Ok well G92 is an Offset Coordinate from the exisiting coordinate point. What it's doing is using the probe to find the material surface and where ever that coordinate falls in the current WORK Coordinate system (G54) then it sets an offset coordinate value. (g92 z0) then Moves 25 away(g0 z25) resets the offset coordinate to Zero at this point (g92 z0) then moves to 1mm above this (g0 z1).

It doesn't actually Zero the DRO or should say Set the Zero WORK coordinate. It just applies an offset Coordinate from this WORK coordinate. If you cancel the Offset by using G92.1 you'll see the True WORK coordinate.

Try it in MDI in simulation mode. First make sure any Offsets are cancelled by typing G92.1
Next Zero the Work coordinates by zeroing the DRO's then jog a set distance away say 10mm positive.
Now type G92 z0 and you'll see the Z dro change to 0 now type G0 z5 which will simulate movement 5mm positive.
Now Cancel the Offset with G92.1.? . . . . Now you'll endup with 15mm positive in the Dro which is the true WORK coordinate. 10mm we started with plus 5mm the offset moved away from it's zero Offset coordinate.

To be honest using coordinate offsets is not the best way to do it and can easily get you in trouble with other g-code files because they stay in affect if not cancelled. This can lead to unexpected movements and crashes.!!

Davek0974
01-02-2014, 07:30 PM
So it will work, but not a good method.

is there a way to have g92.1 run at then of every cycle?

maybe not important as every job will use the probe/offset method surely it will get set/reset many times during a job and a retained offset would only matter if I were then to run a manual part after an auto probed run??

i gather doing a home-all would clear any offsets or not?

JAZZCNC
01-02-2014, 08:21 PM
So it will work, but not a good method.

is there a way to have g92.1 run at then of every cycle?

maybe not important as every job will use the probe/offset method surely it will get set/reset many times during a job and a retained offset would only matter if I were then to run a manual part after an auto probed run??

i gather doing a home-all would clear any offsets or not?

Yes will work and yes there are better ways.

No offsets are not cancelled with Ref all home this is one of the dangers with them.
What you need to understand is there are 2 coordinate systems, WORK and MACHINE. When you Ref home you are defining the MACHINE Zero coordinate position which is fixed and never changes unless you move the Switches.
Work coordinate Zero can be anywhere on the Machine. G92 Coordinate Offsets are offsets from currant WORK coordinate point and stay in affect until cancelled. So even if you load another G-code file the previous offsets still apply if a G92.1 hisn't given before closing the file.

When you use G92 nothing moves it just defines a new Point which you then work from. Plus the other thing which can cause problems is that G92 only works with Absolute moves so any incremental moves will use the WORK coordinate offset.

A much better way is to Define a user Macro which has the G31 move to find material height which then Zero's the WORK coordinate DRO's, then move to any heights you'd like. With this setup you don't run the risk of falling foul with offsets and can have much more flexabilty and control of what happens.
You can even setup User DRO's on the screen set to enter preset and pierce height etc.
All you do then is alter the Sheet cam post so it enters the Macro name in the G-code at the appropriate point or points needed. Mach3 does the rest.

Davek0974
01-02-2014, 10:16 PM
Brilliant,

so where do I find this macro method ?

sounds much better

or I could alter the post to issue a g92.1 at the end of each run?

JAZZCNC
01-02-2014, 10:40 PM
Brilliant,

so where do I find this macro method ?

sounds much better

or I could alter the post to issue a g92.1 at the end of each run?

Just try searching the Mach3 forum and look at the Wiki for it's Commands etc.

Yes you could just have it insert g92.1 and maybe thats how it's done in plasma but me personally I would use the more conventional Macro approach.
To be honest I'm sure I've seen some thing around for Sheet Cam that use's modified M3 spindle Macro to do this very thing you want.? If I was doing it that's how I'd approach it and just have sheet cam insert M3 in the G-code.

Davek0974
02-02-2014, 08:04 AM
Ok I'll go search again, sheetcam already inserts M3/M5 as they control the torch on/off for plasma.


dave

JAZZCNC
02-02-2014, 09:58 AM
Ok I'll go search again, sheetcam already inserts M3/M5 as they control the torch on/off for plasma.


dave

Ok well just insert the G31 and all the Dro Zeroing code and any other things you want it to do before the On/Off in the M3 macro.

To be honest after thinking about it just using the G31 G92 way is a little risky because it doesn't do any Error checking on the probe.
By that I mean lets say if your material has curved and is touching the torch or bit of dross just happens to short or cut the wire so it's gone to ground the machine won't know about. The G31 will work just the same has far the g-code is concerned, but in affect it did nothing other than register the point the machine was at already. The G92 offset and retract etc will be applied from this wrong point.!!

So to stay correct you should really have some error checking Code testing if the probe Input is at ground before using G31 which using a Macro you can do.

Your probably thinking not a big deal but I use probe plate all the time and it happens more often than you probably realise and while it not life threatening it's a pain in the arse when you have accidentally grounded the plate. Which by the way your material will act has My plate so if it touchs any part of machine that my ground it same will occur.
So if I didn't have Error checking warning me before starting same would happen and crashes and all sorts of unwanted head scratching stuff would occur.!

Davek0974
02-02-2014, 12:26 PM
I see, but in my case, I have a micro switch connected to the floating head, I know it would not be good to start if the torch is already down but my torch parks at the top so may not be an issue.

i can't find a decent, understandable macro anywhere.

Davek0974
03-02-2014, 06:41 PM
I've had it running today, have been manual feeding it these commands...
G31 Z-100 F300 this lowered the head from wherever it was sitting and stopped when the probe switch closed.
G92 Z0 Set offset to zero.
G00 Z20 This moved the head back up by the amount of float head travel I have.
G92 Z0 Set offset to zero.
G00 Z1 This raised the head a further millimetre.

It it all seemed to work ok, I would use a macro with error checking but really can't find any understandable code.

it would be useful if someone could post some macro code that could be inserted into the M3 command, all I want to do is probe the surface before every cut starts.

Davek0974
03-02-2014, 08:44 PM
What would this code do if place into the M3 command in mach...

DoOEMButton (1010) 'reset z DRO
Code "G4 P1" 'wait
Code "G31 Z-100 F250" 'probe surface
While isMoving()
Wend
ZprobePos = GetVar(2002) 'get contact point
Code "G0 Z" &ZprobePos 'return to point to remove overshoot
While IsMoving()
Wend
DoOEMButton (1010) 'reset z DRO
Code "G4 P1" 'wait
Code "G0 Z20" 'remove floating head travel
DoOEMButton (1010) 'reset the z DRO
Code "G4 P1" 'wait
.....continue on with normal M3 stuff


Would that not probe the surface and leave my Z DRO at zero ready for the M3 command to complete?


This is all theory but I do write VB programs in my day job and it seems very similar

Davek0974
06-02-2014, 02:58 PM
Ignoring the probing code for a while, is there any reason that the probe switch distance should not be as short as possible, maybe 5mm?

I have mine built at 20mm but having sat and watched it today, it looks like 5mm would save a lot of Z axis travel time.

Is there any reason for a bigger gap or is smaller always better?

JAZZCNC
06-02-2014, 04:08 PM
Ignoring the probing code for a while, is there any reason that the probe switch distance should not be as short as possible, maybe 5mm?

I have mine built at 20mm but having sat and watched it today, it looks like 5mm would save a lot of Z axis travel time.

Is there any reason for a bigger gap or is smaller always better?

Sorry Dave I've been busy and had no time to reply regards Code. I'll have a look at what you put earlier and get back to you thou other than checking OEM codes etc it looks about right.

Only reason I can see for higher switch is in case material sprung or fell between grid and angled up slightly then you'd have some clearence for traveling between pierce points.?

Davek0974
06-02-2014, 05:51 PM
Thanks, I'll try lowering it tomorrow, can't see any point in wasting time while it just goes up and down :)

stirling
08-02-2014, 02:19 PM
FWIW - the *conventional* way of doing this is to use gcode IHS (Initial Height Sensing). No reason why you shouldn't use a/the M3 macro - just saying that it's *usually* done in gcode.

One thing you might want to consider if you go the macro route is you'd really need to pass a parameter to M3 because your pierce/cut heights will differ depending on what material type/thickness it is you're cutting. You're then going to have to mod your SCam post to pass this/these params and.... well you might as well have used one of the posts supplied by SCam in the first place that do all this for you. At the end of the day there are many ways to skin this puppy but why re-invent the wheel?

Davek0974
08-02-2014, 02:52 PM
Yeah, I've got it working nicely now by using a sheetcam post, there was bit of early confusion because it appeared the post did not work as good as it does but the author then realised that he fixed it a while ago and forgot it :)

it it does exactly what I wanted it too.

JAZZCNC
08-02-2014, 03:14 PM
FWIW - the *conventional* way of doing this is to use gcode IHS (Initial Height Sensing). No reason why you shouldn't use a/the M3 macro - just saying that it's *usually* done in gcode.

One thing you might want to consider if you go the macro route is you'd really need to pass a parameter to M3 because your pierce/cut heights will differ depending on what material type/thickness it is you're cutting.

Wouldn't need to pass anything to m3 because G31 was just being used to set Z zero to height of material rather than using G92 coordinate offset. Difference being some error checking and intelligence could be applied.! The pierce height etc would still be in G-code.

But like you say more than one way to do it and if does the Job then great.

stirling
08-02-2014, 03:24 PM
How so? You call your modified M3 and it does it's G31 to set Z zero - then what? - you then have to cater for the float switch offset - then move to pierce height THEN fire the torch - where are you intending on firing the torch if not in - erm - M3?

JAZZCNC
08-02-2014, 04:26 PM
How so? You call your modified M3 and it does it's G31 to set Z zero - then what? - you then have to cater for the float switch offset - then move to pierce height THEN fire the torch - where are you intending on firing the torch if not in - erm - M3?

No sorry we are at crossed purposes I was meaning using G31 etc with it's own Macro which would get called before Pierce height etc and not in the M3 macro. This I thought would mean Float switch could be done away with.?
To be honest I've never messed with Plasma so didn't exactly know how the torch was fired but did suspect M3 would play apart.

stirling
08-02-2014, 05:11 PM
Ah right - with you.

Yes - *usually* - after you've done your IHS and then retracted to pierce height you'd fire with M3. In Mach some leave M3 as it is and just have the default DoSpinCW() which will fire your torch via your relay or whatever OR as I prefer - change it to activateSignal(OUTPUT?) - simply because it doesn't have the slight delay that DoSpinCW() has even when you set it to zero - but that's another story.

Cheers

Ian

BigdogBro1
29-12-2014, 04:02 PM
Yeah, I've got it working nicely now by using a sheetcam post, there was bit of early confusion because it appeared the post did not work as good as it does but the author then realised that he fixed it a while ago and forgot it :)

it it does exactly what I wanted it too.


Any chance of you helping me out with the same problem on a new IHS design. I followed the thread but don't see a final solution. A newbie with Mach3/Scam and could use a jumpstart. Is THC required to do an initial IHC or can the software and IHS top switch do it all? Macros (code) and IHS switch input info would be greatly appreciated.

Davek0974
01-01-2015, 12:52 PM
No THC is not required for the IHS but IHS is required for THC :)

the he top switch will provide the response for the IHS which is triggered by the code generated by the CAM software/post, the THC if used will then try and maintain that height based upon the voltage created across the arc, this varies with height.

there are many sheetcam posts that have the IHS code, I'm using ones designed for my THC system so you need to find one that will do what you need, have you tried the sheetcam forum?

Note, some THC systems do not need the code as they also deal directly with the IHS too as a total system.

dave