CamBam
News:
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
September 26, 2017, 06:15:56 am


Login with username, password and session length


Pages: 1 [2]
  Print  
Author Topic: Lathe C-axis  (Read 587 times)
coolant slinger
Wookie
****
Offline Offline

Posts: 306



View Profile
« Reply #15 on: August 31, 2017, 00:53:28 am »

Kvom,

Doubling the X in CAD. 
I am doing a Hex shape. I am not sure it will even resemble a hex when I do that. Besides I would have to draw it line by line. No thanks. I am drawing it in Draftsight anyway and importing to Cambam just to get the hex in one shot and not draw it line by line. I never liked the way Cambam draws a hex. It does not let you dimension to flat it draws it across corners. No one wants to draw a hex from across corners. Sure I know you can do the math. And getting the hex in cambam orientated like I want it without having to rotate later. A video would be nice on the hex drawing part of Cambam.

Yes, I can wait on you guru's to figure it out. I will just edit the code untill then.
Man, is there a day when we will not have to edit code by hand. That is the glorious day.
Seems like Lloyd said he doesn't. But then again he is very good at post editing too.
Thanks for the ideas guys.
Logged

lloydsp
CNC Jedi
*****
Offline Offline

Posts: 7086



View Profile
« Reply #16 on: August 31, 2017, 01:59:04 am »

Slinger,
I can't help with the polygon tool because I didn't write it, but so far as post-build processors... they're usually just simple BASIC routines... It's not at all complex to parse text for particular strings and change them.

And... Andy put that feature in so we could do such things that aren't directly-accommodated in the post-processor itself.  In fact, I was the original 'guinea pig'.  I had an ancient machine that would NOT accept the standard xyz coordinates that ALL CAMs generate these days, and Andy came up with a way of letting me edit my own g-code as if it were part of the post-processor, yet, apart from it.

As soon as I get done with this current project, I'll be more than willing to help.  But I have a J.O.B.... and I have to do it first.

Lloyd
Logged

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

Posts: 987


View Profile
« Reply #17 on: August 31, 2017, 02:30:59 am »

I will bet draftsight has a scale function in one dimension. Draw the hex, scale on X axis only, done!
Logged

Gary H. Lucas

Have you read my blog?
 http://a-little-business.blogspot.com/
jk
Storm Trooper
***
Offline Offline

Posts: 199


View Profile
« Reply #18 on: August 31, 2017, 02:35:10 am »

CB-only solution:

1) change Y to C
replace all {$_y} and {$y} strings in postprocessor with C{$move.y}

2) set x2 scale for all used MOPs via Transform field.
Click Experimental->Transform->... field of MOP, enter 2 instead of 1 in the top left box, OK.
Now the generated toolpaths are scaled x2 in X direction, while original geometry is not.
Logged
coolant slinger
Wookie
****
Offline Offline

Posts: 306



View Profile
« Reply #19 on: August 31, 2017, 02:43:13 am »

Gary,
All I know is it is easier to draw a hex shape in Draftsight and AutoCad. I love Cambam for cam though. Or maybe I am not using the polygon feature in Cambam right. I could use a tutorial.
Logged

coolant slinger
Wookie
****
Offline Offline

Posts: 306



View Profile
« Reply #20 on: August 31, 2017, 02:48:21 am »

JK,
I'll give that a shot tomorrow.

Thanks,
Logged

lloydsp
CNC Jedi
*****
Offline Offline

Posts: 7086



View Profile
« Reply #21 on: August 31, 2017, 02:49:17 am »

"CB-only solution:

1) change Y to C
replace all {$_y} and {$y} strings in postprocessor with C{$move.y}

2) set x2 scale for all used MOPs via Transform field.
Click Experimental->Transform->... field of MOP, enter 2 instead of 1 in the top left box, OK.
Now the generated toolpaths are scaled x2 in X direction, while original geometry is not."
------------

JK... that's inspired.  I knew about changing the post for the C text/value, but (with all the time I have on it) not about the experimental transform!

Thank you!

Like I said... every day is a learning exercise, and sometimes from people newer to the package than me!

Lloyd
Logged

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

Posts: 987


View Profile
« Reply #22 on: August 31, 2017, 02:50:54 am »

Don't draw much in CamBam as nearly everything I do comes out of SolidWorks. I do use AutoCad for some stuff.
Logged

Gary H. Lucas

Have you read my blog?
 http://a-little-business.blogspot.com/
dh42
Administrator
CNC Jedi
*****
Offline Offline

Posts: 4628



View Profile WWW
« Reply #23 on: August 31, 2017, 19:25:52 pm »

Hello

Quote
The Lathe Radial/Diameter is a good idea, but I am using the mill function of Cambam to get the current code.

Ok, I'll add that in the post build code soon Wink

To draw hex, the Polygon plugin is no longer working on 1.0, unfortunately, the source code is not provided and the dll is also protected, so we can't explore it.

Have a look on this plugin ; I don't use it, but I think that hex can by created with both methods
http://www.atelier-des-fougeres.fr/Cambam/Aide/Plugins/ShapesPlugin.html

++
David
Logged
Garyhlucas
CNC Jedi
*****
Offline Offline

Posts: 987


View Profile
« Reply #24 on: August 31, 2017, 19:39:44 pm »

You don't really have to ever draw a hex more than one time. Make it 1" across flats, the any time you need a hex copy it and scale to the size you need. I have a drawing of a DC gearmotor I drew in my first cad program 30 years ago and still use it occasionly today.
Logged

Gary H. Lucas

Have you read my blog?
 http://a-little-business.blogspot.com/
dh42
Administrator
CNC Jedi
*****
Offline Offline

Posts: 4628



View Profile WWW
« Reply #25 on: August 31, 2017, 21:18:28 pm »

Hello

Have a try with this new version in attachment

the source code Wink

Code:
Imports System.IO
Module Module1
    Sub Main(ByVal args() As String)

        ' change Y axis to C axis
        ' double X values
        ' dh42 - 2017

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

        fname = args(0)

        If fname <> "" Then
            outname = Left(fname, Len(fname) - 3)   'filename without ".nc"
            Try
                Using sr As StreamReader = New StreamReader(fname)
                    FileOpen(1, outname & ".tmp", OpenMode.Output)
                    Do
                        line = sr.ReadLine()    'read a line in the file
                        If Len(line) > 0 And Left(line, 1) <> "(" Then   'if line is not empty and do not start with a comment
                            line = DoubleX(line)    'call function to double X values
                            line_out = Replace(line, "Y", "C")  'change Y to C
                            PrintLine(1, line_out)  'print the new line in the file
                        Else
                            PrintLine(1, line)  'print an unchanged line
                        End If

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

                    FileSystem.Kill(fname)  'delete old .nc file
                    FileSystem.Rename(outname & ".tmp", outname & ".nc")   'rename .temp file to .nc

                End Using

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

    Function DoubleX(l As String)as string

        Dim s_mod As String = ""
        Dim parsed() As String
        Dim s As String
        Dim value As Double

        parsed = Split(l, " ", -1, 1)   'split line in an array with space as delimiter

        For n As Integer = 0 To UBound(parsed)

            s = parsed(n)

            If Left(s, 1) = "X" Then
                value = val(Right(s, Len(s) - 1))  'extract the numérical datas
                s = "X" & Trim(Str(value * 2))    'redo the string with "X" and value x2
                parsed(n) = s   'change the data in the array

                'redo the whole string
                For li As Integer = 0 To Ubound(parsed)
                    s_mod = s_mod & parsed(li) & " "
                Next li
                Return s_mod
            End If
        Next
        Return l 'no change in the line, return the source line
    End Function
End Module

++
David

* Y2C.zip (5.05 KB - downloaded 10 times.)
« Last Edit: August 31, 2017, 21:22:17 pm by dh42 » Logged
coolant slinger
Wookie
****
Offline Offline

Posts: 306



View Profile
« Reply #26 on: September 01, 2017, 00:33:12 am »

JK,
Thanks for the solution. But it does require more clicks of the mouse than the updated Y2C from David.

David,
That is what I was looking for. The updated Y2C Doubles the X values and changes Y's to C's. Simple for the user. No extra clicks of the mouse. Now I will try to get the header and footer code added to the post processor, like M45, G112, G113 and so on. I will try to post that when I get done. Hopefully we will have a good solution for C-axis lathe work. I do some from time to time at my day gig. Should work on most Fanuc controllers. 

Thanks guys for the time you spent on this. This is the best forum out there as far as I am concerned. You guys are uptight and out of sight.(That means great here in the USA).

Slinger
Logged

EddyCurrent
CNC Jedi
*****
Offline Offline

Posts: 3066



View Profile
« Reply #27 on: September 01, 2017, 07:37:03 am »


You guys are uptight and out of sight.(That means great here in the USA).

Slinger

In the 60's maybe  Cheesy Grin
Logged
Pages: 1 [2]
  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.15 seconds with 18 queries.

Copyright © 2008 HexRay Ltd. | Sitemap