Author Topic: Cool... ehrhm.. now what?  (Read 2236 times)

Offline lloydsp

  • CNC Jedi
  • *****
  • Posts: 8233
    • View Profile
Re: Cool... ehrhm.. now what?
« Reply #30 on: February 24, 2020, 13:17:55 pm »
Arie,
A simple change to the post-build processor would allow the original .nc file to be kept, and the post-build version saved under a slightly different name... say, with one extra character appended to the filename.

Then you wouldn't have to remember 'which post' you're using.

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

Offline dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 5960
    • View Profile
    • Cambam French Doc
Re: Cool... ehrhm.. now what?
« Reply #31 on: February 24, 2020, 14:36:04 pm »
Hello

If you want to try this version of the .exe ; the original file (.nc) is not deleted and can be used for simulation, the modified file is created with the same name but with a .txt extension, so you end up with 2 files.

this is the code in Visual Basic Express .net 2010 (if you want to modify and compile the code yourself, in VB .net, create a "console application" then copy the whole code in the editor)

Code: [Select]
Imports System.IO
Module Module1
    Sub Main(ByVal args() As String)
        ' post traitement remove dot in lines to obtain size in µm
        ' do some cleaning to remove "rests" after Z moves are removed by the PP
        ' to use for EDM with 0.000 number formatting in the post processor
        ' for Arie kabaalstra and Brother HS 100 Wire EDM
        ' use post processor: Brother HS 100-EDM
        ' dh42 - 02/2020
        ' v2 kept both original and modified files

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

        fname = args(0)

        If fname <> "" Then
            outname = Left(fname, Len(fname) - 3)   'full pathname without '.nc'

            Try
                Using sr As StreamReader = New StreamReader(fname)

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

                    Do
                        line = sr.ReadLine() 'read a line in the file

                        ' .... start processing lines

                        'skip lines that contain only G00 or G01 (because Z moves are removed in the post processor)
                        'skip empty lines
                        If line = "G00" Or line = "G01" Or line = "" Then
                            GoTo skipline
                        Else
                            line_out = Replace(line, ".", "") 'remove dots in the line
                            line_out = Replace(line_out, "X0000", "X0") 'change X0000 to X0
                            line_out = Replace(line_out, "Y0000", "Y0") 'change Y0000 to Y0
                        End If

                        PrintLine(1, line_out) 'write line in the .txt file
skipline:
                    Loop Until line Is Nothing

                    sr.Close()
                    FileClose(1)

                    'not used if both files are kept
                    'FileSystem.Kill(fname)  'delete old .nc file
                    'FileSystem.Rename(outname & ".txt", outname & ".nc")   'rename .txt file to .nc

                End Using

            Catch E As Exception
                ' errors managing
                MsgBox("Error" & E.Message)
            End Try
        End If
    End Sub
End Module


++
David
« Last Edit: February 25, 2020, 09:43:28 am by dh42 »

Offline Arie kabaalstra

  • CNC Jedi
  • *****
  • Posts: 606
  • why buy one, if you can build one?
    • View Profile
    • DUMET Watches
Re: Cool... ehrhm.. now what?
« Reply #32 on: February 24, 2020, 23:15:17 pm »
Thanks!.. that is nice.. i might use that code to make a little post treatment application, First make the code with the HS100-EDM post, and then process batches of code with the Posttreatment Application..

I haven't been programming in VB in years now.. i need to pick that up again..

Offline Arie kabaalstra

  • CNC Jedi
  • *****
  • Posts: 606
  • why buy one, if you can build one?
    • View Profile
    • DUMET Watches
Re: Cool... ehrhm.. now what?
« Reply #33 on: March 02, 2020, 11:30:27 am »
I'm Still in the process of building up the machine..

One of the linear bearings was missing.. so i inquired with the seller.. hard to find part..

Well.. i'm a Toolmaker after all..





So.. I made a set of new ones.. 50 new steel balls.. to make sure the slide sits level..



Installed them in the Y-axis.. put some Lube on it..



Everything runs smoothly, Motors are hooked up to the Control, Linear encoders also hooked up, let's put some power into the machine..


Offline Bubba

  • CNC Jedi
  • *****
  • Posts: 2922
    • View Profile
Re: Cool... ehrhm.. now what?
« Reply #34 on: March 02, 2020, 12:50:44 pm »
Arie, That's what I'm talking about! Nice job!
My 2¢

Win 10 64 bit, CB [1.0} rc 1 64 bit, Mach3, ESS, G540

Offline Arie kabaalstra

  • CNC Jedi
  • *****
  • Posts: 606
  • why buy one, if you can build one?
    • View Profile
    • DUMET Watches
Re: Cool... ehrhm.. now what?
« Reply #35 on: March 03, 2020, 00:40:28 am »
Today i did some preparation work, Tomorrow will be a big day.. i'm gonna power up the machine for the first time.. Fingers crossed!

Offline Arie kabaalstra

  • CNC Jedi
  • *****
  • Posts: 606
  • why buy one, if you can build one?
    • View Profile
    • DUMET Watches
Re: Cool... ehrhm.. now what?
« Reply #36 on: March 03, 2020, 22:34:48 pm »


Jay!... Powered her up, and.. oh.. wait.. System Constant 255.. that's not good.. but.. a Reset fixed that problem.
The Cross-Slide is moving, Homing works, settings filled in (wire offsets), so next step, putting the wireheads on the top and bottom arm, installing the nozzles, filling and connecting the watertank, and we should be good to go!

Offline lloydsp

  • CNC Jedi
  • *****
  • Posts: 8233
    • View Profile
Re: Cool... ehrhm.. now what?
« Reply #37 on: March 04, 2020, 00:41:50 am »
Good deal, Arie!  I'm looking forward to seeing your results.

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

Offline Arie kabaalstra

  • CNC Jedi
  • *****
  • Posts: 606
  • why buy one, if you can build one?
    • View Profile
    • DUMET Watches
Re: Cool... ehrhm.. now what?
« Reply #38 on: May 11, 2020, 11:13:53 am »


She made her first sparks this morning... i went conventional on the Energy settings..i'll ramp that up when i get more confident with the machine again..

Offline Arie kabaalstra

  • CNC Jedi
  • *****
  • Posts: 606
  • why buy one, if you can build one?
    • View Profile
    • DUMET Watches
Re: Cool... ehrhm.. now what?
« Reply #39 on: May 11, 2020, 22:24:24 pm »


The first workpiece!..



And the machine that  made it possible..

I  still have to learn some code.. have to polish up old programming trics..

Offline lloydsp

  • CNC Jedi
  • *****
  • Posts: 8233
    • View Profile
Re: Cool... ehrhm.. now what?
« Reply #40 on: May 11, 2020, 22:40:53 pm »
Neat stuff, Arie!

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

Offline Bubba

  • CNC Jedi
  • *****
  • Posts: 2922
    • View Profile
Re: Cool... ehrhm.. now what?
« Reply #41 on: May 12, 2020, 00:07:59 am »
"Neat stuff, Arie!"

+1 ;)
My 2¢

Win 10 64 bit, CB [1.0} rc 1 64 bit, Mach3, ESS, G540

Offline Arie kabaalstra

  • CNC Jedi
  • *****
  • Posts: 606
  • why buy one, if you can build one?
    • View Profile
    • DUMET Watches
Re: Cool... ehrhm.. now what?
« Reply #42 on: May 25, 2020, 21:59:14 pm »


in the mean time, i'm making watchcases!.. I've determined the settings for roughing and finishing..
I still have to make an RS 232 Cable to Connect with  a Computer..

Offline Arie kabaalstra

  • CNC Jedi
  • *****
  • Posts: 606
  • why buy one, if you can build one?
    • View Profile
    • DUMET Watches
Re: Cool... ehrhm.. now what?
« Reply #43 on: June 03, 2020, 13:24:10 pm »
Code: [Select]
G90
G92 X-0500 Y0
G0G41H1 Y-22000
G01 X0
G03 X1500 Y-20500 I0000 J1500
G01 Y-9736
G01 Y-4500
G03 X1000 Y-4000 I-0500 J0000
G01 X0705
G01 X0 Y0
G01 X3000 Y-0529
G01 X6500 Y-4029
G0G40 Y0500
G0 X-0500
G0 Y0
M2

Got the Post-post set up properly, and i'm getting good code.. I only have to modify the code slightly, inserting the Radius Compensation and a G92, and some G0's instead of G1's to get the wire faster to the starting point



I made a boring bar out of a broken Solid Carbide Endmill.. Works like a charm

Offline Bubba

  • CNC Jedi
  • *****
  • Posts: 2922
    • View Profile
Re: Cool... ehrhm.. now what?
« Reply #44 on: June 03, 2020, 13:58:24 pm »
I like the boring bar. Can use one today. ;D ;D
My 2¢

Win 10 64 bit, CB [1.0} rc 1 64 bit, Mach3, ESS, G540