Author Topic: Post-procesor fro SELCA S1000  (Read 8412 times)

Offline Kredyl

  • Ewok
  • *
  • Posts: 5
    • View Profile
Post-procesor fro SELCA S1000
« on: May 11, 2014, 20:12:40 pm »
Hi everyone !

I have amended the post-pro "default" into cambam in order to generate the Gcode for my milling C.B .Ferrari F48

I only have a problem with the moving in G1 on Z axis. In SELCA Gcode, you don't add any G1 for a Z moving, thus my question.
How can I amend the post-pro in order to cancel the G1 for movings on Z, but it needs to appear for movings on X and Y.

This is an example :



M3 S1000
Z10.000R>>>>>>>ok
X10.000Y40.000R>>>>>>>ok
G1Z-5.000F300.000>>>>>>>NOK Z-5.000F300 ok
G3X20.000Y30.000I20.000J40.000F800.000
G1X60.000
G2X80.000Y10.000I60.000J10.000
G1Y0.000
G1X0.000
G1X20.000Y30.000
G1X60.000Z-3.987
G2X80.000Y10.000I60.000J10.000
G1Y0.000Z-2.939
G1X0.000Z-0.913
G1X20.000Y30.000Z0.000
Z10.000R
M5
M30

Online lloydsp

  • CNC Jedi
  • *****
  • Posts: 8318
    • View Profile
Re: Post-procesor fro SELCA S1000
« Reply #1 on: May 11, 2014, 20:57:17 pm »
Before I even look at a possible solution, I must know this:  Is a G0 for Z permitted?  Or is it necessary to ALWAYS issue the Z without a Gx command?

The problem is knowing the difference between 'rapids' and 'feed rate moves'.

Lloyd
"Pyro for Fun and Profit for More Than Fifty Years"

Offline Kredyl

  • Ewok
  • *
  • Posts: 5
    • View Profile
Re: Post-procesor fro SELCA S1000
« Reply #2 on: May 11, 2014, 21:38:10 pm »
Thanks for replying so quick !

I always have to create a Z without a Gx command, and G0 doesn't exist, it's replaced by the "R" at the end of the coordinate.
ex : X0Y0R
Z100R

The rapids always get an "R" at the end of the move.

At the moment, for all not "rapids" moves on Z, a Gx command is automatically generated by CamBam, and I want to cancel this Gx command. Can I cancel this ? If yes, how ?
ex : G1Z100F400 -> NOK
Z100F400 -> OK

Online lloydsp

  • CNC Jedi
  • *****
  • Posts: 8318
    • View Profile
Re: Post-procesor fro SELCA S1000
« Reply #3 on: May 11, 2014, 21:50:05 pm »
Yes, I think that's possible in the post-processor.  If not, there is another 'fix'.  Let me explore it for a couple of hours, and I'll get back to you.

Lloyd
"Pyro for Fun and Profit for More Than Fifty Years"

Online lloydsp

  • CNC Jedi
  • *****
  • Posts: 8318
    • View Profile
Re: Post-procesor fro SELCA S1000
« Reply #4 on: May 11, 2014, 22:07:49 pm »
This may not be the whole of the solution, but try this, placing it on the next line right AFTER the </MOP> tag:

 <FeedMove>{$g1}{$x}{$y}{$_f}
  {$_z}{$_f}</FeedMove>

The only problem I see with this is that it will (must) issue both X and Y, even if only Z changes, but it will issue the Z position on its own line without the G1.

If you were to change the x and y values to modal, then it could issue a 'bare' G1, and I don't know how that would be handled.

If this isn't elegant enough, someone else might have another idea.  If not, there is yet another way, through what's called the "post build processor".  It involves an external script automatically invoked by the post-processor (no human intervention).


Lloyd
PS... you'll almost always get quick help here.  There are a bunch of users here with lots of experience who like to help anyone they can.  Also... just a minor 'nit'... there is a subject header for post-processor questions, and further ones should be directed there.  This subject group is for scripts and plugins apart from post-processors (which are, yes, also 'scripts' in xml <G>).
« Last Edit: May 11, 2014, 22:24:01 pm by lloydsp »
"Pyro for Fun and Profit for More Than Fifty Years"

Offline Kredyl

  • Ewok
  • *
  • Posts: 5
    • View Profile
Re: Post-procesor fro SELCA S1000
« Reply #5 on: May 12, 2014, 21:08:34 pm »
Hi, thanks a lot, I'll try this ASAP and will come back to you if it works.

Actually I posted here cos I thought I needed a script for my problem. If it doesn't work with your proposal, I'll post in the correct subject :)

Michel

Offline Kredyl

  • Ewok
  • *
  • Posts: 5
    • View Profile
Re: Post-procesor fro SELCA S1000
« Reply #6 on: May 13, 2014, 21:18:53 pm »
I just checked, and I don't see the </MOP> tag. My software is in French, maybe it's called another way.
Can you let me know in which part of the system tab do I have to place the "feedmove" part ?
thks

Online lloydsp

  • CNC Jedi
  • *****
  • Posts: 8318
    • View Profile
Re: Post-procesor fro SELCA S1000
« Reply #7 on: May 13, 2014, 21:23:56 pm »
The instruction I gave above is a "feedmove" clause.  That's in the system tab.  You can edit the feedmove section to do what I showed.

OR...

Don't do it in the system tab.  Open the system/post-processors folder (tools, browse system folder), and EDIT the post-processor you're using (whatever you've called it, it will be "yourname.cbpp").

Notepad works.  I prefer Jedit, but that's just personal.  Do NOT use a word processor.

This will also give you a much better feel for what is IN the post-processors!

Lloyd
« Last Edit: May 13, 2014, 22:04:49 pm by lloydsp »
"Pyro for Fun and Profit for More Than Fifty Years"

Offline dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 6078
    • View Profile
    • Cambam V1.0 French Doc
Re: Post-procesor fro SELCA S1000
« Reply #8 on: May 16, 2014, 18:27:55 pm »
Hello,

You can find an selca.exe file that will perform a post build treatment.

- Unpack and copy the .exe in a place of you choice on your hard drive.

- in your post processor designed for SELCA, do the following change:

   *  in the property Post-Build Command Args (Cmd. de post-traitement - args) write:

"{$outfile}"  (keep the quotes, they are needed)

  * in the Post-Build Command (Commande de post-traitement), click on the |...| and search for the selca.exe file you have just copied.

- save your modified PP.

Now, when you generate a Gcode with this PP, the output code (it must have a .nc extension) is catched by the selca.exe and replaced by the modified .nc file.


For Lloyd ;)  ... the code of the .exe

Code: [Select]
Imports System.IO
Module Module1
    Sub Main(args() As String)

        'post traitement pour SELCA V 1.00
        'remplace G1Zxxx par Zxx
        'dh42 - 2014

        Dim line, line_out As String
        Dim fname, outname As String

        fname = args(0)

        If fname <> "" Then
            outname = Left(fname, Len(fname) - 3)   'nom complet sans le '.nc'

            Try
                Using sr As StreamReader = New StreamReader(fname)

                    FileOpen(1, outname & ".tmp", OpenMode.Output)

                    Do
                        line = sr.ReadLine()
                        'MsgBox(line)

                        ' .... traiter les lignes
                        line_out = Replace(line, "G1Z", "Z")

                        PrintLine(1, line_out)

                    Loop Until line Is Nothing
                    sr.Close()
                    FileClose(1)

                    FileSystem.Kill(fname)  'effacer ancien fichier .nc
                    FileSystem.Rename(outname & ".tmp", outname & ".nc")   'renommer le fichier temporaire en .nc

                End Using

            Catch E As Exception
                ' gestion erreurs

                MsgBox("Erreur" & E.Message)

            End Try

        End If


    End Sub
End Module

Note: you must create a console application on VB to compile this code

++
David


Online lloydsp

  • CNC Jedi
  • *****
  • Posts: 8318
    • View Profile
Re: Post-procesor fro SELCA S1000
« Reply #9 on: May 16, 2014, 18:34:18 pm »
Hah!  Thanks, David!

I had not the time now to do that.

That will be a more elegant solution than the 'crippled' feedmove I showed him.

Lloyd
"Pyro for Fun and Profit for More Than Fifty Years"

Offline Kredyl

  • Ewok
  • *
  • Posts: 5
    • View Profile
Re: Post-procesor fro SELCA S1000
« Reply #10 on: May 17, 2014, 22:44:59 pm »
It works perfectly fine, thank you everybody and especially David for that piece of code !