CamBam
News:
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
November 19, 2017, 21:19:54 pm


Login with username, password and session length


Pages: [1]
  Print  
Author Topic: Set S0 when Z axis moves  (Read 628 times)
Mark81
Droid
**
Offline Offline

Posts: 55


View Profile
« on: September 23, 2017, 12:13:07 pm »

Hi! I'm reading through the post-processor documentation (http://www.cambam.info/doc/plus/cam/PostProcessor.htm) and the other threads, but I can't understand if it's possible to set-up a post-processor that add an S0 command before moves the Z-axis. Example:

original
Code:
G1 F1000.0 Z-0.3
S1000
G3 F800.0 X-7.5 Y12.9904 I-15.0 J0.0
G3 Y-12.9904 I7.5 J-12.9904
G3 X15.0 Y0.0 I7.5 J12.9904
G1 F1000.0 Z-0.6
G3 F800.0 X-7.5 Y12.9904 I-15.0 J0.0
G3 Y-12.9904 I7.5 J-12.9904
...

desired
Code:
G1 F1000.0 Z-0.3 S0
S1000
G3 F800.0 X-7.5 Y12.9904 I-15.0 J0.0
G3 Y-12.9904 I7.5 J-12.9904
G3 X15.0 Y0.0 I7.5 J12.9904
G1 F1000.0 Z-0.6 S0
G3 F800.0 X-7.5 Y12.9904 I-15.0 J0.0
G3 Y-12.9904 I7.5 J-12.9904


Another way I can live with is use G0 for all Z moves.
Thanks!
Logged
EddyCurrent
CNC Jedi
*****
Offline Offline

Posts: 3217



View Profile
« Reply #1 on: September 23, 2017, 13:13:01 pm »

It would be useful if you could describe in words, without reference to g-code, what you are trying to achieve.
Logged
Mark81
Droid
**
Offline Offline

Posts: 55


View Profile
« Reply #2 on: September 23, 2017, 13:35:22 pm »

I'm sorry for my English, anyway it's exactly what I tried to describe above:

add an S0 command when moving the Z-axis

OR

use G0 instead of G1 when moving the Z-axis
Logged
EddyCurrent
CNC Jedi
*****
Offline Offline

Posts: 3217



View Profile
« Reply #3 on: September 23, 2017, 17:00:58 pm »

I was really asking WHY you wanted to do that.
Logged
Mark81
Droid
**
Offline Offline

Posts: 55


View Profile
« Reply #4 on: September 23, 2017, 17:04:46 pm »

To turn off the laser when moving up or down. Until now I manually edit the resulting g-code, and the results are as expected.
Logged
dh42
Administrator
CNC Jedi
*****
Offline Offline

Posts: 4745



View Profile WWW
« Reply #5 on: September 23, 2017, 18:47:10 pm »

Hello

In CB you can use the Start Cut & End Cut macros that react to a Z move ; if the Z go bellow the stock surface the Start cut macro is executed, if the Z go above the stock surface, the End cut is executed.

Have a look here.

http://www.cambam.co.uk/forum/index.php?topic=5059.0

In this case, it's not the S that is changed, but the macro on/off the laser with the M10 M11 commands (= M3 M5)

LOL, I retrieve a similar post from you Wink
http://www.cambam.co.uk/forum/index.php?topic=6298.0

++
David
Logged
Mark81
Droid
**
Offline Offline

Posts: 55


View Profile
« Reply #6 on: September 23, 2017, 19:04:12 pm »

Yes, it is similar, but slightly different!
In that thread we discussed about other things, but I never fixed this one (apart editing each file manually).

I have to stop the laser every time the Z move, even if it is already below 0 and stay there (i.e. it goes down a bit). As far as I understand in this case the end cut event won't be fired.

Logged
dh42
Administrator
CNC Jedi
*****
Offline Offline

Posts: 4745



View Profile WWW
« Reply #7 on: September 23, 2017, 20:31:32 pm »

Hello

I think that only a post treatment can do what you want, but I do not understand how that works in the case of your example.

G1 F1000.0 Z-0.6 S0
G3 F800.0 X-7.5 Y12.9904 I-15.0 J0.0
G3 Y-12.9904 I7.5 J-12.9904

After the S0 is set, the 2 G3 lines that follow will run with the laser OFF ?  Huh Huh

++
David
Logged
lloydsp
CNC Jedi
*****
Offline Offline

Posts: 7153



View Profile
« Reply #8 on: September 23, 2017, 23:00:29 pm »

Yes... a VERY simple post-build processor can effect the change you wish.

But I, too, wonder how turning the laser OFF just before other moves could possibly work?

I think I understand why you might wish to turn it off with Z-moves... but once it's off, what do you do to cut afterwards?

Lloyd
Logged

"Pyro for Fun and Profit for More Than Fifty Years"
Mark81
Droid
**
Offline Offline

Posts: 55


View Profile
« Reply #9 on: September 24, 2017, 09:27:45 am »

Sorry guys, you are right. In the example I mixed the two options....

Option 1:
Code:
G1 F1000.0 Z-0.3 S0
S1000
G3 F800.0 X-7.5 Y12.9904 I-15.0 J0.0
G3 Y-12.9904 I7.5 J-12.9904
G3 X15.0 Y0.0 I7.5 J12.9904
G1 F1000.0 Z-0.6 S0
G3 F800.0 X-7.5 Y12.9904 I-15.0 J0.0 S1000
G3 Y-12.9904 I7.5 J-12.9904

Option 2:
Code:
G0 Z-0.3
G3 F800.0 X-7.5 Y12.9904 I-15.0 J0.0
G3 Y-12.9904 I7.5 J-12.9904
G3 X15.0 Y0.0 I7.5 J12.9904
G0 Z-0.6
G3 F800.0 X-7.5 Y12.9904 I-15.0 J0.0
G3 Y-12.9904 I7.5 J-12.9904

Currently I'm using the second one and it works.
One thing I don't understand: you both talked about a "post treatment" or "post-build processor". But this isn't the purpose of the Post Processor? Or you're saying that it's simple but CamBam cannot do it? In that case I will write my own.

Logged
lloydsp
CNC Jedi
*****
Offline Offline

Posts: 7153



View Profile
« Reply #10 on: September 24, 2017, 14:09:17 pm »

A post-processor is any given CAM's way of putting that particular CAM's 'internal language' into a form suitable for a particular machine.

As such, there's almost always some machine that requires some 'special syntax' not in keeping with ordinary 3-axis milling (which is what CamBam is truly intended to do).

To that end, Andy made available a feature OF THE POST-PROCESSOR that enables the user to make those 'special' changes to code as if they had been done by the post-processor, but written by the user.  The post-build processor allows a user to extend the capabilities of the post-processor.

Lloyd
Logged

"Pyro for Fun and Profit for More Than Fifty Years"
kvom
CNC Jedi
*****
Offline Offline

Posts: 1387


View Profile
« Reply #11 on: September 24, 2017, 23:12:26 pm »

Does the laser actually move when the Z changes?  In any case, I'd assume that whatever the cutting height is you could zero Z so that the "off" height is positive.
Logged
Dragonfly
CNC Jedi
*****
Offline Offline

Posts: 1699



View Profile
« Reply #12 on: September 25, 2017, 11:19:43 am »

If it is for simple laser on/off (not actual vertical movement for focus change) one can tap the 'dir' signal to the motor driver to turn it off and on. In this case just the change of direction of Z will trigger the laser.
Logged

Before asking a question do some effort and walk through all menus and options in CamBam.  Maybe the answer is there. Please.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM
Page created in 0.13 seconds with 18 queries.

Copyright © 2008 HexRay Ltd. | Sitemap